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

Binds what a path still needs when it reaches the start of its body.

A parameter is bound to what each call of the body passes for it, which is worked out at the call the same way the statement was worked out at the database call. A property of $this is bound to each value the class can leave it holding. A name read at the top of a file is bound to what an extension says it holds. Whatever cannot be bound this way is left open, and says why: nothing calls the body, the budget ran out, or the name is simply not defined anywhere the analysis can see.

Methods§

public function __construct(
    Callers $callers,
    ExpressionEvaluator $expressions,
    EvaluationBudget $budget,
    ?DeclaredGlobals $globals = null,
    ?PropertyWrites $properties = null,
)

Wires the binder to what it looks for callers and property values with.

Parameters

$callersCallers
$expressionsExpressionEvaluator
$budgetEvaluationBudget
$globals?DeclaredGlobals
$properties?PropertyWrites
Calls 2
public function affordable(list<Binding> $bindings, int $limit): list<Binding>

The ways in, with those beyond what the budget can run one at a time joined into one.

Every way in runs the whole path, so a long path with many ways in costs their product. The ways the budget cannot pay for are joined value by value into a single way in: every value is still there, and the result says that its values were paired without knowing they go together.

Parameters

$bindingslist<Binding>
$limitint

Returns

list<Binding>
Called from 1
Calls 5
public function bindings(Arrival $arrival, int $depth, Deriver $deriver): list<Binding>

The ways into the body a path arrived at the start of, each binding what the path still needs.

Parameters

$arrivalArrival
$depthint
$deriverDeriver

Returns

list<Binding>
Test cases 1
Called from 1
Calls 8
public function withProperty(
    list<Binding> $bindings,
    string $name,
    list<Domain> $values,
    bool $combined = false,
): list<Binding>

The ways in, one for each value a property can hold on each of them.

Properties are worked out one at a time, so once more than one of them can hold several values, the pairings are not known to occur together and the ways in say so.

Parameters

$bindingslist<Binding>
$namestring
$valueslist<Domain>
$combinedbool

Returns

list<Binding>
Called from 1
Calls 5
public function parameterValues(
    FunctionLike $body,
    string $name,
    int $depth,
    Deriver $deriver,
): list<Domain>

What a parameter of a body can be, for every way into the body.

Parameters

$bodyFunctionLike
$namestring
$depthint
$deriverDeriver

Returns

list<Domain>
Calls 3
public function evaluateConstant(Expr $expression, ?string $className): Domain

The value of an expression that reads nothing but constants, such as a property default.

Parameters

$expressionExpr
$className?string

Returns

Calls 4
public function parameterBindings(Arrival $arrival, int $depth, Deriver $deriver): list<Binding>

The ways into the body, each binding the parameters and other names the path still needs.

A local with no reaching definition starts absent. Reading it yields null; its existence remains separate from the values assigned later. Parameters, declared globals and exhausted paths keep their open values.

Parameters

$arrivalArrival
$depthint
$deriverDeriver

Returns

list<Binding>
Called from 2
Calls 18
public function fromCallers(
    CallerSet $callers,
    array<string, array{int, Param}> $parameters,
    Environment $outside,
    string $name,
    int $depth,
    Deriver $deriver,
): list<Binding>

One way in for every way each call can pass the arguments the path needs.

When not every caller could be asked — there are more than the limit, the budget ran out partway, or a call might reach the body without that being certain — every way in found is marked as cut short, not only the ones found after the search stopped: the set as a whole is what is incomplete.

Parameters

$callersCallerSet
$parametersarray<string, array{int, Param}>
$outsideEnvironment
$namestring
$depthint
$deriverDeriver

Returns

list<Binding>
Called from 1
Calls 13
public function argumentsFor(
    CallLike $call,
    array<string, array{int, Param}> $parameters,
): array<string, Expr|null>

The argument a call passes for each needed parameter, or null where it passes none.

Parameters

$callCallLike
$parametersarray<string, array{int, Param}>

Returns

array<string, Expr|null>
Called from 1
Calls 2
  • method-call CallLike::isFirstClassCallable() line 282
  • method-call CallLike::getArgs() line 282
public function defaultOf(Param $parameter): Domain

What a parameter holds when a call does not pass it.

Parameters

$parameterParam

Returns

Called from 1
Calls 7
public function parametersOf(
    FunctionLike $body,
    array<string, true> $needs,
): array<string, array{int, Param}>

The parameters of a body among the names a path needs, with their positions.

Parameters

$bodyFunctionLike
$needsarray<string, true>

Returns

array<string, array{int, Param}>
Called from 1
Calls 2
public function leaveOpen(array<string, true> $needs, Origin $origin): Environment

Every needed name left open, for the given reason.

Parameters

$needsarray<string, true>
$originOrigin
Called from 1
Calls 4
public function fileScope(array<string, true> $needs): Environment

What the names code at the top of a file reads without defining are known to hold.

Such code runs in the global scope, so a name it reads was set by whatever ran before it. An extension may say what that is; otherwise it is left open.

Parameters

$needsarray<string, true>
Test cases 1
Called from 1
Calls 8

Private surface 6§

Implementation details, listed for orientation only.

private Callers $callers
private ExpressionEvaluator $expressions
private EvaluationBudget $budget
private DeclaredGlobals $globals
private ?PropertyWrites $properties
private TypeReader $types

Test cases 28§

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

Dedicated tests 2
Other tests reaching this symbol 26

Relations§

Instantiated in 1
Method calls 2
Type declarations 3