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

What a bound value can be, reported in the form the catalog stores.

A value that resolves statically is reported as the literals it can take, so a parameter typed as a backed enum becomes the union of that enum's values rather than a bare string. A value the analyzer could not follow is reported as its static type and where it came from.

Properties§

public string $type
public list<string|int|float|bool|null> $values
public bool $exhaustive
public list<string> $origins

Methods§

public function __construct(
    public string $type,
    public list<string|int|float|bool|null> $values,
    public bool $exhaustive,
    public list<string> $origins,
)

Parameters

$typestringThe static type, written the way PHP writes it
$valueslist<string|int|float|bool|null>The values it can take, when they are known
$exhaustiveboolWhether the listed values are all of them
$originslist<string>Where unresolved parts of the value come from
public function isResolved(): bool
public function admits(string|int|float|bool|null $value): bool

Whether a runtime value is one the domain admits.

An unresolved domain admits everything, which is what makes it a sound over-approximation rather than a claim about the value.

Parameters

$valuestring|int|float|bool|null

Returns

bool
Calls 2
public function display(): string

The domain written for a reader.

Returns

string
Calls 4

Test cases 32§

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

Dedicated tests 9
Other tests reaching this symbol 23

Relations§

Static calls 1
Type declarations 2