ComponentPropertyReflection
API reference › PHPStan › reflection › ComponentPropertyReflection
Wraps a fallback PropertyReflection to expose the resolved component type for dynamic Yii application
components in PHPStan analysis.
Delegates visibility and mutability checks to the fallback instance while overriding the type to reflect the actual component type as determined by the service map or dependency injection.
PropertyReflection for property reflection contract.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a new instance of the ComponentPropertyReflection class. | ComponentPropertyReflection |
canChangeTypeAfterAssignment() | Determines whether the type of the dynamic Yii application component property can change after assignment. | ComponentPropertyReflection |
getDeclaringClass() | Retrieves the declaring class reflection for the dynamic Yii application component property. | ComponentPropertyReflection |
getDeprecatedDescription() | Retrieves the deprecation description for the dynamic Yii application component property, if available. | ComponentPropertyReflection |
getDocComment() | Retrieves the PHPDoc comment for the dynamic Yii application component property, if available. | ComponentPropertyReflection |
getReadableType() | Retrieves the readable type for the dynamic Yii application component property. | ComponentPropertyReflection |
getWritableType() | Retrieves the writable type for the dynamic Yii application component property. | ComponentPropertyReflection |
isDeprecated() | Determines whether the dynamic Yii application component property is deprecated. | ComponentPropertyReflection |
isInternal() | Determines whether the dynamic Yii application component property is internal to the library or framework. | ComponentPropertyReflection |
isPrivate() | Determines whether the dynamic Yii application component property is private. | ComponentPropertyReflection |
isPublic() | Determines whether the dynamic Yii application component property is public. | ComponentPropertyReflection |
isReadable() | Determines whether the dynamic Yii application component property is readable. | ComponentPropertyReflection |
isStatic() | Determines whether the dynamic Yii application component property is static. | ComponentPropertyReflection |
isWritable() | Determines whether the dynamic Yii application component property is writable. | ComponentPropertyReflection |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(PHPStan\Reflection\PropertyReflection $fallbackProperty, PHPStan\Type\Type $type, PHPStan\Reflection\ClassReflection $declaringClass)Creates a new instance of the ComponentPropertyReflection class.
Parameters
| Parameter | Type | Description |
|---|---|---|
$fallbackProperty | PropertyReflection | Fallback property reflection instance for delegation. |
$type | PHPStan\ | Type of the dynamic component as resolved by the service map or dependency injection. |
$declaringClass | PHPStan\ | Class reflection of the class declaring the dynamic property. |
canChangeTypeAfterAssignment()
Section titled “canChangeTypeAfterAssignment() ”public function canChangeTypeAfterAssignment(): boolDetermines whether the type of the dynamic Yii application component property can change after assignment.
Delegates the mutability checks to the fallback PropertyReflection instance, ensuring that type change
semantics are preserved according to the original property definition.
Returns
bool: true if the property type can change after assignment; false otherwise.
getDeclaringClass()
Section titled “getDeclaringClass() ”public function getDeclaringClass(): PHPStan\Reflection\ClassReflectionRetrieves the declaring class reflection for the dynamic Yii application component property.
Delegates to the fallback PropertyReflection instance to determine the class in which the property is
declared.
Returns
PHPStan\Reflection\ClassReflection: Declaring class reflection instance for the property.
getDeprecatedDescription()
Section titled “getDeprecatedDescription() ”public function getDeprecatedDescription(): string|nullRetrieves the deprecation description for the dynamic Yii application component property, if available.
Delegates the retrieval of the deprecation description to the fallback PropertyReflection instance,
ensuring that any deprecation metadata or rationale is preserved according to the original property definition.
Returns
string|null: Deprecation description if available, or null if not deprecated or no description is set.
getDocComment()
Section titled “getDocComment() ”public function getDocComment(): stringRetrieves the PHPDoc comment for the dynamic Yii application component property, if available.
Delegates the retrieval of the PHPDoc comment to the fallback PropertyReflection instance, ensuring that
documentation metadata is preserved according to the original property definition.
Returns
string: PHPDoc comment string for the property, or an empty string if no comment is set.
getReadableType()
Section titled “getReadableType() ”public function getReadableType(): PHPStan\Type\TypeRetrieves the readable type for the dynamic Yii application component property.
Delegates the readable type resolution to the fallback PropertyReflection instance ensuring that the type
exposed for reading is consistent with the original property definition.
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 writable type for the dynamic Yii application component property.
Delegates the writable type resolution to the fallback PropertyReflection instance ensuring that the type
exposed for writing is consistent with the original property definition.
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 dynamic Yii application component property is deprecated.
Delegates the deprecation status check to the fallback PropertyReflection instance, ensuring that
deprecation metadata is preserved according to the original property definition.
Returns
TrinaryLogic: Deprecation status of the property as a TrinaryLogic value.
isInternal()
Section titled “isInternal() ”public function isInternal(): PHPStan\TrinaryLogicDetermines whether the dynamic Yii application component property is internal to the library or framework.
Delegates the internal status check to the fallback PropertyReflection instance, ensuring that internal
metadata is preserved according to the original property definition.
Returns
TrinaryLogic: Internal status of the property as a TrinaryLogic value.
isPrivate()
Section titled “isPrivate() ”public function isPrivate(): boolDetermines whether the dynamic Yii application component property is private.
Delegates the privacy check to the fallback PropertyReflection instance ensuring that property visibility
is preserved according to the original property definition.
Returns
bool: true if the property is private; false otherwise.
isPublic()
Section titled “isPublic() ”public function isPublic(): boolDetermines whether the dynamic Yii application component property is public.
Delegates the public visibility check to the fallback PropertyReflection instance, ensuring that property
visibility is preserved according to the original property definition.
Returns
bool: true if the property is public; false otherwise.
isReadable()
Section titled “isReadable() ”public function isReadable(): boolDetermines whether the dynamic Yii application component property is readable.
Delegates the readability checks to the fallback PropertyReflection instance ensuring that visibility and
access rules are respected according to the original property definition.
Returns
bool: true if the property is readable; false otherwise.
isStatic()
Section titled “isStatic() ”public function isStatic(): boolDetermines whether the dynamic Yii application component property is static.
Delegates the static check to the fallback PropertyReflection instance, ensuring that static property
semantics are preserved according to the original property definition.
Returns
bool: true if the property is static; false otherwise.
isWritable()
Section titled “isWritable() ”public function isWritable(): boolDetermines whether the dynamic Yii application component property is writable.
Delegates the writability check to the fallback PropertyReflection instance, ensuring that mutability and
access rules are respected according to the original property definition.
Returns
bool: true if the property is writable; false otherwise.