| Methods |
public
|
__construct(
FunctionLike $functionLike,
list<VariableWrite> $writes,
array<int, true> $readWriteIds,
array<int, true> $usedWriteIds,
array<int, true> $coveredWriteIds,
array<string, true> $readVariableNames,
array<int, Type> $redundantWriteTypes,
array<string, true> $referencedVariableNames,
array<string, true> $untrackedVariableNames,
array<int, Foreach_|For_> $variableOverwritingLoops,
bool $opaque,
bool $allVariableNamesReferenced,
)
Parameters
| $functionLike |
Array of attributes
|
Overrides
|
#
|
public
|
getFunctionLike(): FunctionLike
|
#
|
public
|
getWrites(): list<VariableWrite>
|
#
|
public
|
getWriteForNode(Variable $variable): ?VariableWrite
The write whose target is this exact node (a parameter's or closure
use's variable), if it is tracked.
The write whose target is this exact node (a parameter's or closure
use's variable), if it is tracked.
|
#
|
public
|
areAllVariableNamesReferenced(): bool
Whether a construct that can observe every variable by name without
reading its current value (func_get_args()) appears in the body.
Whether a construct that can observe every variable by name without
reading its current value (func_get_args()) appears in the body.
|
#
|
public
|
isUsed(VariableWrite $write): bool
Whether the value reaches an observable use, directly or through another write.
Whether the value reaches an observable use, directly or through another write.
|
#
|
public
|
flowsIntoNeverReadWrite(VariableWrite $write): bool
Whether the value flows into a write that is never read at all - that
write is the one to report, this one only feeds it.
Whether the value flows into a write that is never read at all - that
write is the one to report, this one only feeds it.
|
#
|
public
|
isRead(VariableWrite $write): bool
Whether some path from the write reaches a read of the written value.
Whether some path from the write reaches a read of the written value.
|
#
|
public
|
isVariableEverRead(string $variableName): bool
Whether the variable name appears at a read site anywhere in the body,
regardless of which writes the read observed.
Whether the variable name appears at a read site anywhere in the body,
regardless of which writes the read observed.
|
#
|
public
|
getRedundantType(VariableWrite $write): ?Type
The type of the assigned value when the write assigns the value the
variable provably already has, null otherwise.
The type of the assigned value when the write assigns the value the
variable provably already has, null otherwise.
|
#
|
public
|
getVariableOverwritingLoop(VariableWrite $write): Foreach_|For_|null
The loop statement that binds this write in its head - a foreach key
or value variable, a for-loop initial assignment - when the variable
was assigned before the loop and is read after it with no assignment
in between other than the loop's own bindings and updates: the loop
takes over a variable still in use, rather than a spent loop variable.
Null for every other write.
The loop statement that binds this write in its head - a foreach key
or value variable, a for-loop initial assignment - when the variable
was assigned before the loop and is read after it with no assignment
in between other than the loop's own bindings and updates: the loop
takes over a variable still in use, rather than a spent loop variable.
Null for every other write.
|
#
|
public
|
isVariableReferenced(string $variableName): bool
Whether the body mentions the variable at all: a read, a write, a
statement naming it (global, static, a reference alias), or a construct
that can observe every variable (eval, include, a dynamic compact() or
$$name, func_get_args()).
Whether the body mentions the variable at all: a read, a write, a
statement naming it (global, static, a reference alias), or a construct
that can observe every variable (eval, include, a dynamic compact() or
$$name, func_get_args()).
|
#
|
public
|
isUntracked(string $variableName): bool
Variables whose writes escape the body (by-ref parameters and uses,
global/static variables, reference aliases) - every write counts as used.
Variables whose writes escape the body (by-ref parameters and uses,
global/static variables, reference aliases) - every write counts as used.
|
#
|
public
|
isOpaque(): bool
The body contains a construct (goto) that defeats reaching-write tracking.
The body contains a construct (goto) that defeats reaching-write tracking.
|
#
|
public
|
getType(): string
Gets the type of the node.
Gets the type of the node.
Returns
Implements
|
#
|
public
|
getSubNodeNames(): string[]
Gets the names of the sub nodes.
Gets the names of the sub nodes.
Returns
Implements
|
#
|