ReceiverPropertyReflection
API reference › PHPStan › reflection › ReceiverPropertyReflection
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.
Methods
Section titled “Methods”| Method | Description | Defined 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 |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(PHPStan\Reflection\PropertyReflection $property, PHPStan\Reflection\ClassReflection $declaringClass)Creates a new instance of the ReceiverPropertyReflection class.
Parameters
| Parameter | Type | Description |
|---|---|---|
$property | PropertyReflection | Inherited property reflection instance for delegation. |
$declaringClass | PHPStan\ | Class reflection of the receiver the property was resolved on. |
canChangeTypeAfterAssignment()
Section titled “canChangeTypeAfterAssignment() ”public function canChangeTypeAfterAssignment(): boolDetermines whether the type of the property can change after assignment.
Returns
bool: true if the property type can change after assignment; false otherwise.
getDeclaringClass()
Section titled “getDeclaringClass() ”public function getDeclaringClass(): PHPStan\Reflection\ClassReflectionRetrieves the receiver class reflection the property was resolved on.
Returns
PHPStan\Reflection\ClassReflection: Declaring class reflection instance for the property.
getDeprecatedDescription()
Section titled “getDeprecatedDescription() ”public function getDeprecatedDescription(): string|nullRetrieves 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.
getDocComment()
Section titled “getDocComment() ”public function getDocComment(): string|nullRetrieves the PHPDoc comment of the property, if available.
Returns
string|null: PHPDoc comment string for the property, or null if no comment is set.
getReadableType()
Section titled “getReadableType() ”public function getReadableType(): PHPStan\Type\TypeRetrieves the type that can be read from the property.
Returns
PHPStan\Type\Type: Type that can be read from the property for static analysis.
getWritableType()
Section titled “getWritableType() ”public function getWritableType(): PHPStan\Type\TypeRetrieves the type that can be written to the property.
Returns
PHPStan\Type\Type: Type that can be written to the property for static analysis.
isDeprecated()
Section titled “isDeprecated() ”public function isDeprecated(): PHPStan\TrinaryLogicDetermines whether the property is deprecated.
Returns
TrinaryLogic: Deprecation status of the property as a TrinaryLogic value.
isInternal()
Section titled “isInternal() ”public function isInternal(): PHPStan\TrinaryLogicDetermines whether the property is internal to the library or framework.
Returns
TrinaryLogic: Internal status of the property as a TrinaryLogic value.
isPrivate()
Section titled “isPrivate() ”public function isPrivate(): boolDetermines whether the property is private.
Returns
bool: true if the property is private; false otherwise.
isPublic()
Section titled “isPublic() ”public function isPublic(): boolDetermines whether the property is public.
Returns
bool: true if the property is public; false otherwise.
isReadable()
Section titled “isReadable() ”public function isReadable(): boolDetermines whether the property is readable.
Returns
bool: true if the property is readable; false otherwise.
isStatic()
Section titled “isStatic() ”public function isStatic(): boolDetermines whether the property is static.
Returns
bool: true if the property is static; false otherwise.
isWritable()
Section titled “isWritable() ”public function isWritable(): boolDetermines whether the property is writable.
Returns
bool: true if the property is writable; false otherwise.