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

Captures constant ownership, access, and target initializer type independently of its value.

Properties§

public string $className
public string $name
public Visibility $visibility = Visibility::Public
public string $type = 'mixed'
public bool $enum = false
public string $docComment = ''

Methods§

public function __construct(
    public string $className,
    public string $name,
    public Visibility $visibility = Visibility::Public,
    public string $type = 'mixed',
    public bool $enum = false,
    public string $docComment = '',
)

Parameters

$classNamestringDeclaring class after trait composition
$namestringCase-sensitive constant or enum case name
$visibilityVisibilityPHP access level
$typestringDeclared constant type or backed enum scalar type
$enumboolWhether the initializer constructs a singleton enum case
$docCommentstringRaw declaration doc comment, or an empty string
Calls 1

Test cases 21§

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

Dedicated tests 1
Other tests reaching this symbol 20

Relations§

Instantiated in 4
Type declarations 3