final class ClassShape
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

One class, interface, trait or enum, reduced to the parts the analyzer reads.

Properties§

public string $name
public string|null $parent
public list<string> $interfaces
public list<string> $traits
public bool $enum
public array<string, Expr> $constants
public array<string, Expr|null> $enumCases
public array<string, TypeShape> $propertyTypes
public array<string, MethodShape> $methods
public array<string, Expr> $propertyDefaults = []
public array<string, true> $assignedProperties = []
public bool $hasAttributes = false

Methods§

public function __construct(
    public string $name,
    public string|null $parent,
    public list<string> $interfaces,
    public list<string> $traits,
    public bool $enum,
    public array<string, Expr> $constants,
    public array<string, Expr|null> $enumCases,
    public array<string, TypeShape> $propertyTypes,
    public array<string, MethodShape> $methods,
    public array<string, Expr> $propertyDefaults = [],
    public array<string, true> $assignedProperties = [],
    public bool $hasAttributes = false,
)

Parameters

$namestringThe declaration, fully qualified without a leading backslash
$parentstring|nullThe parent class, when one is extended
$interfaceslist<string>The implemented interfaces and extended interfaces
$traitslist<string>The used traits
$enumboolWhether the declaration is an enum
$constantsarray<string, Expr>Class constant expressions, keyed by name
$enumCasesarray<string, Expr|null>Enum case backing expressions, keyed by case name
$propertyTypesarray<string, TypeShape>Declared property types, keyed by property name
$methodsarray<string, MethodShape>Methods, keyed by lower-case name
$propertyDefaultsarray<string, Expr>Property default expressions, keyed by property name
$assignedPropertiesarray<string, true>Properties the class assigns to somewhere in its body
$hasAttributesboolWhether attributes may customize runtime behavior
public function settledDefault(string $property): ?Expr

The default expression of a property that nothing in the class overwrites.

A property declared with a default and never assigned again holds that default for the whole life of every instance, which is what lets a table name kept in a property resolve instead of becoming a gap.

Parameters

$propertystring

Returns

?Expr
Test cases 3
public function ancestors(): list<string>

The names this declaration inherits from, nearest first.

Returns

list<string>
Test cases 2
Calls 1

Test cases 22§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5
Other tests reaching this symbol 17

Relations§

Instantiated in 1
Type declarations 3