classClassConstant
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 $classNamepublic string $namepublic Visibility $visibility = Visibility::Publicpublic string $type = 'mixed'public bool $enum = falsepublic 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
$className | string | Declaring class after trait composition |
$name | string | Case-sensitive constant or enum case name |
$visibility | Visibility | PHP access level |
$type | string | Declared constant type or backed enum scalar type |
$enum | bool | Whether the initializer constructs a singleton enum case |
$docComment | string | Raw declaration doc comment, or an empty string |
Calls 1
- class-const Visibility::Public() line 21
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
AllocationTestcallsCaptureTestcallsAccessTestcallsConstantsTest::testAllowedUsesTheLexicalClassAndVisibilitycallsMethodInvocationTestcallsMethodsTestcallsTypeBindingTestcallsUnwindingTestcallsInstructionTransferTestcallsConversionsTestcallsInvocationTestcallsConstantTransferTest::providerFallbackConstantscallsConstantTransferTest::providerInitializerResultscallsConstantTransferTest::testInitializerPropagatesFailureBeforeEnforcingTheConstantTypecallsConstantTransferTest::testInitializerRetainsEnumCaseNameBackingValueAndDeclaringClasscallsConstantSignaturesTestcallsIndexerTestcallsIndexTestcallsCompositionTestcallsPropertyScopeTestcalls
Relations§
Instantiated in 4
- new Deriver\Deriver\Evaluator\Execution\Call\Member\Constants::find() packages/deriver/src/Deriver/Evaluator/Execution/Call/Member/Constants.php:44
- new Deriver\Deriver\Lowerer\Declaration\ConstantSignatures::read() packages/deriver/src/Deriver/Lowerer/Declaration/ConstantSignatures.php:34
- new Deriver\Deriver\Lowerer\Declaration\ConstantSignatures::read() packages/deriver/src/Deriver/Lowerer/Declaration/ConstantSignatures.php:38
- new Deriver\Deriver\Lowerer\Declaration\Traits\Composition::import() packages/deriver/src/Deriver/Lowerer/Declaration/Traits/Composition.php:106
Type declarations 3
- type Deriver\Deriver\Evaluator\Execution\Call\Member\Constants packages/deriver/src/Deriver/Evaluator/Execution/Call/Member/Constants.php:31
- type Deriver\Deriver\Evaluator\Execution\Call\Member\Constants packages/deriver/src/Deriver/Evaluator/Execution/Call/Member/Constants.php:57
- type Deriver\Deriver\Evaluator\Execution\Transfer\ConstantTransfer packages/deriver/src/Deriver/Evaluator/Execution/Transfer/ConstantTransfer.php:119