Skip to content
PHP Ecosystem
Explore

ReceiverPropertyReflection

API reference › PHPStan › reflection › ReceiverPropertyReflection

final classyii2\extensions\phpstan\reflection\ReceiverPropertyReflection
ImplementsPropertyReflection
Sourcesrc/reflection/ReceiverPropertyReflection.php

Wraps an inherited PropertyReflection so that it’s declared by the class it was resolved on.

PHPStan resolves a property again on the ancestor that declares it. An application class unrelated to the configured application type inherits annotations from Application, which is refined to the configured type, so declaring the property on the receiver keeps the configured components from replacing its own annotated type. Delegates every other aspect of the property to the wrapped instance.

PropertyReflection for property reflection contract.

MethodDescriptionDefined by
__construct()Creates a new instance of the ReceiverPropertyReflection class.ReceiverPropertyReflection
canChangeTypeAfterAssignment()Determines whether the type of the property can change after assignment.ReceiverPropertyReflection
getDeclaringClass()Retrieves the receiver class reflection the property was resolved on.ReceiverPropertyReflection
getDeprecatedDescription()Retrieves the deprecation description of the property, if available.ReceiverPropertyReflection
getDocComment()Retrieves the PHPDoc comment of the property, if available.ReceiverPropertyReflection
getReadableType()Retrieves the type that can be read from the property.ReceiverPropertyReflection
getWritableType()Retrieves the type that can be written to the property.ReceiverPropertyReflection
isDeprecated()Determines whether the property is deprecated.ReceiverPropertyReflection
isInternal()Determines whether the property is internal to the library or framework.ReceiverPropertyReflection
isPrivate()Determines whether the property is private.ReceiverPropertyReflection
isPublic()Determines whether the property is public.ReceiverPropertyReflection
isReadable()Determines whether the property is readable.ReceiverPropertyReflection
isStatic()Determines whether the property is static.ReceiverPropertyReflection
isWritable()Determines whether the property is writable.ReceiverPropertyReflection
public function __construct(PHPStan\Reflection\PropertyReflection $property, PHPStan\Reflection\ClassReflection $declaringClass)

Creates a new instance of the ReceiverPropertyReflection class.

Parameters

ParameterTypeDescription
$propertyPropertyReflectionInherited property reflection instance for delegation.
$declaringClassPHPStan\Reflection\ClassReflectionClass reflection of the receiver the property was resolved on.
public function canChangeTypeAfterAssignment(): bool

Determines whether the type of the property can change after assignment.

Returns

bool: true if the property type can change after assignment; false otherwise.

public function getDeclaringClass(): PHPStan\Reflection\ClassReflection

Retrieves the receiver class reflection the property was resolved on.

Returns

PHPStan\Reflection\ClassReflection: Declaring class reflection instance for the property.

public function getDeprecatedDescription(): string|null

Retrieves the deprecation description of the property, if available.

Returns

string|null: Deprecation description if available, or null if not deprecated or no description is set.

public function getDocComment(): string|null

Retrieves the PHPDoc comment of the property, if available.

Returns

string|null: PHPDoc comment string for the property, or null if no comment is set.

public function getReadableType(): PHPStan\Type\Type

Retrieves the type that can be read from the property.

Returns

PHPStan\Type\Type: Type that can be read from the property for static analysis.

public function getWritableType(): PHPStan\Type\Type

Retrieves the type that can be written to the property.

Returns

PHPStan\Type\Type: Type that can be written to the property for static analysis.

public function isDeprecated(): PHPStan\TrinaryLogic

Determines whether the property is deprecated.

Returns

TrinaryLogic: Deprecation status of the property as a TrinaryLogic value.

public function isInternal(): PHPStan\TrinaryLogic

Determines whether the property is internal to the library or framework.

Returns

TrinaryLogic: Internal status of the property as a TrinaryLogic value.

public function isPrivate(): bool

Determines whether the property is private.

Returns

bool: true if the property is private; false otherwise.

public function isPublic(): bool

Determines whether the property is public.

Returns

bool: true if the property is public; false otherwise.

public function isReadable(): bool

Determines whether the property is readable.

Returns

bool: true if the property is readable; false otherwise.

public function isStatic(): bool

Determines whether the property is static.

Returns

bool: true if the property is static; false otherwise.

public function isWritable(): bool

Determines whether the property is writable.

Returns

bool: true if the property is writable; false otherwise.