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

The names an expression reads, which are what its value depends on.

A variable is named as itself; a property of the object a method runs on is named this->property, because an assignment to it earlier in the body is a definition in the same way an assignment to a variable is; the object itself is named this. Superglobals are not named: nothing in the source defines them, so there is nothing to look for.

A database call written inside the expression reads less than it passes. What a preparing or composing call hands back depends on the statement text alone, and what a query hands back does not depend on its arguments at all, so the values it binds are not looked for. Without this, a statement built from $wpdb->prepare('(%s, %s)', $option, $value) would chase every value it binds through every function that computes one, and none of that can change the text.

Constants§

public const THIS = 'this'

The name a property of $this is tracked under.

Methods§

public function __construct(
    list<SinkSpec> $sinks = [],
    ?ExternalInput $external = null,
    bool $trackObjectEffects = false,
)

Builds the reader over the database calls whose arguments it reads selectively.

Parameters

$sinkslist<SinkSpec>
$external?ExternalInput
$trackObjectEffectsbool
Calls 6
public function read(Node $node): array<string, true>

The names one node reads.

Parameters

$nodeNode

Returns

array<string, true>
Test cases 1
Called from 13
Calls 9
public function sinkArgumentsOf(CallLike $call): array<int, true>|null

The argument positions whose values decide what a database call hands back, or null when the call is not written as one.

Parameters

$callCallLike

Returns

array<int, true>|null
Test cases 1
Called from 1
Calls 2
public function sinkCall(CallLike $call, array<int, true> $positions): array<string, true>

The names a database call reads: what it is called on, and the arguments its result depends on.

Parameters

$callCallLike
$positionsarray<int, true>

Returns

array<string, true>
Test cases 1
Called from 1
Calls 3
public function targetReads(Node $target): array<string, true>

The names an assignment target reads without being what it writes.

Writing $rows[$key] reads $key, and reads $rows too, since the element is added to whatever the array already held. Writing $sql reads nothing: the old value is simply replaced.

Parameters

$targetNode

Returns

array<string, true>
Test cases 1
Called from 2
Calls 2
public function variable(Variable $node): array<string, true>

The name a variable is read under, or nothing when it is external or not a plain name.

Parameters

$nodeVariable

Returns

array<string, true>
Test cases 1
Called from 2
Calls 2
public function arrowFunction(ArrowFunction $node): array<string, true>

The names an arrow function captures from the scope it is written in.

Parameters

$nodeArrowFunction

Returns

array<string, true>
Test cases 1
Called from 1
Calls 2

Private surface 3§

Implementation details, listed for orientation only.

private ExternalInput $external
private array<string, array<int, true>> $sinkArguments = []
private bool $trackObjectEffects = false

Test cases 67§

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 59

Relations§

Instantiated in 9
Method calls 11
Constant reads 8
Type declarations 12