classObjectMemory
final class ObjectMemory
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Immutable object snapshots indexed by allocation, shared by aliases within one run.
Methods§
public function __construct(private array<string, Domain> $objects = [])Parameters
$objects | array<string, Domain> |
public function remember(ObjectTerm $object): voidStores a new snapshot without changing other runs.
Parameters
$object | ObjectTerm |
Test cases 6
ObjectMemoryTest::testCopyIsIndependentOfLaterMutationscallsObjectMemoryTest::testImportDoesNotOverwriteAMutatedObjectWithAnOldAliascallsObjectMemoryTest::testJoinPreservesBothBranchesWithoutMutatingEithercallsObjectMemoryTest::testReadRefreshesObjectsStoredInArrayscallsObjectMemoryTest::testRememberMakesAliasesReadTheLatestSnapshotcallsObjectMemoryTest::testSignatureDoesNotDependOnInsertionOrdercalls
Called from 1
Calls 1
- static-call Domain::of() line 27
public function rememberValue(Domain $value): voidStores alternative snapshots of each allocation as one domain.
Parameters
$value | Domain |
Called from 1
Calls 1
- static-call Domain::fromTerms() line 43
public function import(Domain $value): voidRegisters an incoming object, preserving any later local snapshot.
Parameters
$value | Domain |
Test cases 1
Called from 1
Calls 2
- method-call ObjectMemory::remember() line 54
- method-call ObjectMemory::import() line 58
Resolves references, including references stored in arrays.
Parameters
$value | Domain |
Returns
Test cases 7
ObjectMemoryTest::testCopyIsIndependentOfLaterMutationscallsObjectMemoryTest::testImportDoesNotOverwriteAMutatedObjectWithAnOldAliascallsObjectMemoryTest::testInvalidateOpensAliasedObjectsInsideArraysAndKeepsUntrackedValuescallsObjectMemoryTest::testJoinPreservesBothBranchesWithoutMutatingEithercallsObjectMemoryTest::testReadRefreshesObjectsStoredInArrayscallsObjectMemoryTest::testRememberMakesAliasesReadTheLatestSnapshotcallsObjectMemoryTest::testRememberValueRetainsAlternativeSnapshotsAndBudgetFlagscalls
Called from 1
Calls 6
- function-call
array_mergeline 78 - new ArrayTerm line 82
- function-call
array_mapline 82 - new ArrayEntry line 82
- method-call ObjectMemory::read() line 82
- static-call Domain::fromTerms() line 88
public function copy(): selfCopies the map; its domain and term values are immutable.
Returns
selfTest cases 2
Calls 1
- new
selfline 96
public function join(self $other): selfPreserves both snapshots when runs must be joined.
Parameters
$other | self |
Returns
selfTest cases 1
Calls 1
- new
selfline 109
public function signature(): stringThe snapshots that distinguish otherwise equal variable bindings.
Returns
stringTest cases 2
Opens tracked object state when an unknown call can mutate an escaped reference.
Parameters
$value | Domain |
Returns
Test cases 1
Called from 1
Calls 7
- new ObjectTerm line 133
- new ArrayTerm line 135
- function-call
array_mapline 135 - new ArrayEntry line 135
- method-call ObjectMemory::invalidate() line 135
- static-call Domain::fromTerms() line 139
- method-call ObjectMemory::rememberValue() line 140
Private surface 1§
Implementation details, listed for orientation only.
private array<string, Domain> $objects = []Test cases 20§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 8
ObjectMemoryTest::testCopyIsIndependentOfLaterMutationscallsObjectMemoryTest::testImportDoesNotOverwriteAMutatedObjectWithAnOldAliascallsObjectMemoryTest::testInvalidateOpensAliasedObjectsInsideArraysAndKeepsUntrackedValuescallsObjectMemoryTest::testJoinPreservesBothBranchesWithoutMutatingEithercallsObjectMemoryTest::testReadRefreshesObjectsStoredInArrayscallsObjectMemoryTest::testRememberMakesAliasesReadTheLatestSnapshotcallsObjectMemoryTest::testRememberValueRetainsAlternativeSnapshotsAndBudgetFlagscallsObjectMemoryTest::testSignatureDoesNotDependOnInsertionOrdercalls
Other tests reaching this symbol 12
CallEvaluatorTestcallsCalleeReturnsTestcallsDeriverTestcallsCallbackEffectsTestcallsSliceExecutorTestcallsExpressionEvaluatorTestcallsEnvironmentTestcallsBuilderCallsTestcallsBuilderQueriesTestcallsCallbackModelTestcallsCallModelTestcallsAnalyzerTestcalls
Relations§
Instantiated in 1
Type declarations 3
- type SqlCatalog\Core\Evaluation\Environment packages/sql-catalog/src/Core/Evaluation/Environment.php:22
- type SqlCatalog\Core\Evaluation\Environment packages/sql-catalog/src/Core/Evaluation/Environment.php:35
- type SqlCatalog\Core\Evaluation\Environment packages/sql-catalog/src/Core/Evaluation/Environment.php:218