Skip to content
PHP Ecosystem
Explore

ComponentPropertyReflection

API reference › PHPStan › reflection › ComponentPropertyReflection

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

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.

MethodDescriptionDefined 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
public function __construct(PHPStan\Reflection\PropertyReflection $fallbackProperty, PHPStan\Type\Type $type, PHPStan\Reflection\ClassReflection $declaringClass)

Creates a new instance of the ComponentPropertyReflection class.

Parameters

ParameterTypeDescription
$fallbackPropertyPropertyReflectionFallback property reflection instance for delegation.
$typePHPStan\Type\TypeType of the dynamic component as resolved by the service map or dependency injection.
$declaringClassPHPStan\Reflection\ClassReflectionClass reflection of the class declaring the dynamic property.
public function canChangeTypeAfterAssignment(): bool

Determines 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.

public function getDeclaringClass(): PHPStan\Reflection\ClassReflection

Retrieves 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.

public function getDeprecatedDescription(): string|null

Retrieves 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.

public function getDocComment(): string

Retrieves 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.

public function getReadableType(): PHPStan\Type\Type

Retrieves 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.

public function getWritableType(): PHPStan\Type\Type

Retrieves 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.

public function isDeprecated(): PHPStan\TrinaryLogic

Determines 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.

public function isInternal(): PHPStan\TrinaryLogic

Determines 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.

public function isPrivate(): bool

Determines 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.

public function isPublic(): bool

Determines 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.

public function isReadable(): bool

Determines 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.

public function isStatic(): bool

Determines 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.

public function isWritable(): bool

Determines 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.