| Methods |
public
|
__construct(
ClassReflection $declaringClass,
?ClassReflection $declaringTrait,
Type $nativeType,
?Type $readablePhpDocType,
?Type $writablePhpDocType,
ReflectionProperty $reflection,
?ExtendedMethodReflection $getHook,
?ExtendedMethodReflection $setHook,
?ResolvedPhpDocBlock $resolvedPhpDocBlock,
?string $deprecatedDescription,
bool $isDeprecated,
bool $isInternal,
bool $isReadOnlyByPhpDoc,
bool $isAllowedPrivateMutation,
list<AttributeReflection> $attributes,
bool $isFinal,
bool $readable,
bool $writable,
bool $private,
bool $public,
)
|
#
|
public
|
getName(): string
|
#
|
public
|
getDeclaringClass(): ClassReflection
For inherited members, this returns the original declaring class,
not the class where the member was accessed.
For inherited members, this returns the original declaring class,
not the class where the member was accessed.
Implements
|
#
|
public
|
getDeclaringTrait(): ?ClassReflection
|
#
|
public
|
getDocComment(): ?string
|
#
|
public
|
isStatic(): bool
|
#
|
public
|
isPrivate(): bool
|
#
|
public
|
isPublic(): bool
|
#
|
public
|
isReadOnly(): bool
|
#
|
public
|
isReadOnlyByPhpDoc(): bool
|
#
|
public
|
getReadableType(): Type
|
#
|
public
|
getWritableType(): Type
May differ from the readable type for properties with asymmetric visibility
or property hooks with different get/set types.
May differ from the readable type for properties with asymmetric visibility
or property hooks with different get/set types.
Implements
|
#
|
public
|
canChangeTypeAfterAssignment(): bool
Returns true when the readable and writable types are the same and no property hooks
transform the value — PHPStan can then narrow the property's type based on assignments.
Returns false when read and write types differ (e.g. @property with asymmetric types,
property hooks, virtual properties).
Returns true when the readable and writable types are the same and no property hooks
transform the value — PHPStan can then narrow the property's type based on assignments.
Returns false when read and write types differ (e.g. @property with asymmetric types,
property hooks, virtual properties).
Implements
|
#
|
public
|
isPromoted(): bool
|
#
|
public
|
hasPhpDocType(): bool
|
#
|
public
|
getPhpDocType(): Type
|
#
|
public
|
hasNativeType(): bool
|
#
|
public
|
getNativeType(): Type
|
#
|
public
|
isReadable(): bool
|
#
|
public
|
isWritable(): bool
|
#
|
public
|
getDeprecatedDescription(): ?string
|
#
|
public
|
isDeprecated(): TrinaryLogic
|
#
|
public
|
isInternal(): TrinaryLogic
|
#
|
public
|
isAllowedPrivateMutation(): bool
|
#
|
public
|
getNativeReflection(): ReflectionProperty
|
#
|
public
|
isAbstract(): TrinaryLogic
|
#
|
public
|
isFinalByKeyword(): TrinaryLogic
|
#
|
public
|
isFinal(): TrinaryLogic
|
#
|
public
|
isVirtual(): TrinaryLogic
Virtual properties (PHP 8.4+) exist only through their get/set hooks
and don't occupy memory in the object.
Virtual properties (PHP 8.4+) exist only through their get/set hooks
and don't occupy memory in the object.
Implements
|
#
|
public
|
hasHook(string $hookType): bool
|
#
|
public
|
isHooked(): bool
|
#
|
public
|
getHook(string $hookType): ExtendedMethodReflection
Property hooks (PHP 8.4+) are internally represented as methods.
Property hooks (PHP 8.4+) are internally represented as methods.
Implements
|
#
|
public
|
isProtectedSet(): bool
|
#
|
public
|
isPrivateSet(): bool
|
#
|
public
|
getAttributes(): array
|
#
|
public
|
isDummy(): TrinaryLogic
Returns yes() for properties that represent possibly-defined properties
on non-final classes, mixed, object, etc. — placeholders PHPStan creates
when it cannot prove a property doesn't exist.
Returns yes() for properties that represent possibly-defined properties
on non-final classes, mixed, object, etc. — placeholders PHPStan creates
when it cannot prove a property doesn't exist.
Implements
|
#
|
public
|
getResolvedPhpDoc(): ?ResolvedPhpDocBlock
|
#
|