classReferenceEffects
final class ReferenceEffects
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Names which may share storage in a body, without deciding which paths execute.
Methods§
public function __construct()Starts an empty cache of reference exposure per body.
Calls 1
- new
WeakMapline 29
public function affected(Node $node, array<string, true> $written): array<string, true>Names potentially sharing storage with a write in this body.
Parameters
$node | Node | |
$written | array<string, true> |
Returns
array<string, true>Test cases 3
Calls 5
- method-call
Node::getAttribute()line 42 - method-call ReferenceEffects::collect() line 50
- function-call
is_arrayline 52 - class-const WriteEffects::ALL() line 60
- function-call
array_intersect_keyline 60
public function collect(Node $node, bool $root = false): array<string, true>Collects possible reference participants, excluding nested function bodies.
Parameters
$node | Node | |
$root | bool |
Returns
array<string, true>Test cases 3
Called from 3
- method-call SqlCatalog\Core\Analysis\Effect\ReferenceEffects::affected() packages/sql-catalog/src/Core/Analysis/Effect/ReferenceEffects.php:50
- method-call SqlCatalog\Core\Analysis\Effect\ReferenceEffects::affected() packages/sql-catalog/src/Core/Analysis/Effect/ReferenceEffects.php:54
- method-call SqlCatalog\Core\Analysis\Effect\ReferenceEffects::collect() packages/sql-catalog/src/Core/Analysis/Effect/ReferenceEffects.php:97
Calls 8
- new ModifiedNames line 70
- method-call ModifiedNames::targets() line 75
- method-call ModifiedNames::all() line 85
- new WriteEffects line 87
- method-call WriteEffects::dynamicTarget() line 89
- function-call
get_object_varsline 94 - function-call
is_arrayline 95 - method-call ReferenceEffects::collect() line 97
Private surface 1§
Implementation details, listed for orientation only.
private WeakMap<Node, array<string, true>> $cacheTest cases 31§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
ReferenceEffectsTest::testAffectedFindsAliasesAcrossStatementsAndCachesTheBodycallsReferenceEffectsTest::testAffectedSharesReferencesAcrossFileScopeSiblingscallsReferenceEffectsTest::testCollectIncludesEscapedCapturesButNotNestedBodiescallsReferenceEffectsTest::testCollectLeavesByValueCapturesAndNestedFunctionsIndependentcallsReferenceEffectsTest::testCollectRetainsByReferenceCapturesInsideTheClosureBodycalls
Other tests reaching this symbol 26
CatalogCommandTestcallsCallEvaluatorTestcallsConstantReaderTestcallsBindingTestcallsCalleeReturnsTestcallsCallersTestcallsDeriverTestcallsEntryBinderTestcallsModifiedNamesTestcallsCallbackEffectsTestcallsPropertyWritesTestcallsAssignmentStepsTestcallsBackwardSlicerTestcallsLoopPassesTestcallsSliceExecutorTestcallsWriteEffectsTestcallsExpressionEvaluatorTestcallsInterpreterTestcallsModelQueriesTestcallsReferenceEvaluatorTestcallsBuilderQueriesTestcallsCallbackModelTestcallsCallModelTestcallsAnalyzerTestcallsJsonReporterTestcallsTextReporterTestcalls
Relations§
Instantiated in 4
- new SqlCatalog\Core\Analysis\CallEvaluator::applyEffects() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:134
- new SqlCatalog\Core\Analysis\Derivation\ModifiedNames::collect() packages/sql-catalog/src/Core/Analysis/Derivation/ModifiedNames.php:85
- new SqlCatalog\Core\Analysis\Derivation\ModifiedNames::own() packages/sql-catalog/src/Core/Analysis/Derivation/ModifiedNames.php:132
- new SqlCatalog\Core\Analysis\Effect\WriteEffects::assignment() packages/sql-catalog/src/Core/Analysis/Effect/WriteEffects.php:68
Type declarations 3
- type SqlCatalog\Core\Analysis\CallEvaluator packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:51
- type SqlCatalog\Core\Analysis\Derivation\ModifiedNames packages/sql-catalog/src/Core/Analysis/Derivation/ModifiedNames.php:34
- type SqlCatalog\Core\Analysis\Effect\WriteEffects packages/sql-catalog/src/Core/Analysis/Effect/WriteEffects.php:29