final class Registry
Public API: explicitly declared with @visibility public.

Registered interpretations of PHP function calls, from evaluated arguments to values.

Registering a constant resultdoctest
$models = \SqlCatalog\Core\Analysis\FunctionModel\Registry::withBuiltins();
    $models->register('App\table', static fn (array $arguments) => \SqlCatalog\Core\Evaluation\Domain::literal('users'));
    $models->evaluate('App\table', [])?->soleLiteral()?->value // => 'users'
    $models->evaluate('strtoupper', [\SqlCatalog\Core\Evaluation\Domain::literal('users')])?->soleLiteral()?->value // => 'USERS'

Methods§

public static function withBuiltins(): self

The standard models, which may be extended or overridden through register().

Returns

self
Test cases 33
Called from 4
Calls 3
public function register(string $name, callable(list<Domain>): ?Domain $model): void

Adds a model tried before earlier models of the same function. Return null to defer to earlier models, then ordinary source analysis.

Parameters

$namestring
$modelcallable(list<Domain>): ?DomainThe interpretation of the arguments in source order
Test cases 2
Called from 11
Calls 1
public function evaluate(string $name, list<Domain> $arguments): ?Domain

The first model that accepts the arguments, or null to use source analysis.

Parameters

$namestring
$argumentslist<Domain>

Returns

Test cases 2
Called from 1
Calls 2
public function registerCall(callable(CallContext): ?Domain $model): void

Adds a context-aware model for PHP calls, including methods and constructors.

Parameters

$modelcallable(CallContext): ?DomainThe AST, evaluated values and shared object state.
Test cases 1

Private surface 2§

Implementation details, listed for orientation only.

private array<string, list<callable(list<Domain>): ?Domain>> $models = []
private list<callable(CallContext): ?Domain> $calls = []

Test cases 60§

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

Dedicated tests 8
Other tests reaching this symbol 52

Relations§

Instantiated in 1
Static calls 4
Method calls 20
Type declarations 8