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

Reads constants: global ones, class ones, enum cases and ::class.

A constant is a value the source writes down once and names everywhere else, which is exactly the kind of value that decides a table or a column name, so it is resolved to what the declaration says.

Methods§

public function __construct(ProgramIndex $index, NodeText $text)

Wires the reader to the declarations it resolves names against.

Parameters

public function constantName(ConstFetch $node): string

The name a constant reference resolves to.

An unqualified constant is looked for in its own namespace first and in the global one second, which is the order PHP itself resolves it in.

Parameters

$nodeConstFetch

Returns

string
Test cases 2
Called from 1
Calls 1
public function readRuntimeConstant(string $name): Domain

The value of a constant the running process already defines.

Parameters

$namestring

Returns

Test cases 2
Called from 1
Calls 10

Private surface 2§

Implementation details, listed for orientation only.

private ProgramIndex $index
private NodeText $text

Test cases 37§

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

Dedicated tests 14
Other tests reaching this symbol 23

Relations§

Instantiated in 1
Method calls 4
Type declarations 1