classArrayTerm
final class ArrayTerm
implements Term
An array literal the analyzer reconstructed element by element.
Bound parameters reach the database as an array, so keeping element order and keys is what lets the catalog line placeholders up with the values they take.
Properties§
public list<ArrayEntry> $entriespublic bool $complete = trueMethods§
public function __construct(public list<ArrayEntry> $entries, public bool $complete = true)Parameters
$entries | list<ArrayEntry> | Elements in source order |
$complete | bool | Whether every element of the runtime array is present |
public function positional(): list<Domain>public function named(): array<string, Domain>The elements reached by a string key.
Returns
array<string, Domain>Test cases 1
Called from 6
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::update() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:64
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::update() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:68
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::update() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:77
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::insertGetId() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:135
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::rows() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:153
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::rows() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:154
Calls 1
- function-call
is_stringline 66
public function element(string|int|float|bool|null $key): ?DomainThe element stored under a key, or null when the array does not hold one.
Parameters
$key | string|int|float|bool|null |
Returns
Test cases 2
Calls 1
- function-call
is_boolline 79
Whatever one element can be, or null when the array holds none.
The union of every element covers the value whichever key selects it, which is what turns self::TABLES[$kind] with an unknown $kind into one statement per table instead of a gap. An array known only in part may hold elements the walk never saw, so the union keeps a gap for them.
Parameters
$origin | Origin | |
$expression | ?string |
Returns
Test cases 3
Calls 2
- static-call Domain::opaque() line 112
- static-call TypeShape::unknown() line 112
public function toPattern(): TextPatternAn array never resolves to text, so it becomes a gap.
Returns
Test cases 2
Calls 4
- static-call TextPattern::fromHole() line 121
- new TextHole line 121
- class-const Origin::Unresolved() line 121
- static-call TypeShape::of() line 121
public function type(): TypeShapepublic function signature(): stringThe elements, in order, tagged as complete or partial.
Returns
stringTest cases 2
Calls 1
- function-call
implodeline 147
Private surface 1§
Implementation details, listed for orientation only.
private ?string $signature = nullTest cases 101§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 10
ArrayTermTest::testAnyValueIsTheUnionOfEveryElementcallsArrayTermTest::testAnyValueOfAnArrayKnownOnlyInPartKeepsAGapWhereItWasReadcallsArrayTermTest::testAnyValueOfAnArrayWithNoElementsIsNothingcallsArrayTermTest::testElementFindsAnElementByItsKeycallsArrayTermTest::testElementNeverReadsAnElementUnderABooleanOrANullKeycallsArrayTermTest::testNamedKeepsStringKeyedElementscallsArrayTermTest::testPositionalKeepsUnkeyedAndIntegerKeyedElementscallsArrayTermTest::testSignatureRecordsWhetherEveryElementIsKnowncallsArrayTermTest::testToPatternLeavesAGapcallsArrayTermTest::testTypeIsArraycalls
Other tests reaching this symbol 91
PairModel::evaluatecallsCatalogCommandTestcallsBuiltinCallModelTest::providerEvaluatecallsBuiltinCallModelTest::testArrayArgumentFindsTheArrayInAnyPositioncallsBuiltinCallModelTest::testImplodeJoinsTheElementsOfAKnownArraycallsBuiltinCallModelTest::testImplodeLeavesAGapWhenTheArrayIsIncompletecallsBuiltinCallModelTest::testImplodeOfAnIncompleteArrayEndsInAStringGapcallsBuiltinCallModelTest::testImplodeWithoutGlueJoinsTheElementsDirectlycallsBuiltinCallModelTest::testVsprintfTakesItsArgumentsFromAnArraycallsCallEvaluatorTest::testInvalidateEscapesOpensAliasedObjectStatecallsCalleeReturnsTest::testCacheableRejectsAllocationsEvenInsideArrayscallsCallbackEffectsTestcallsObjectEffectsTestcallsSliceExecutorTest::providerAnyElementcallsSliceExecutorTest::providerIteratecallsSliceExecutorTest::testAnyElementOfAnArrayKnownOnlyInPartQuotesTheIteratedValuecallsSliceExecutorTest::testApplyGoesOnFromThePassAForeachReachedOverWhatItFirstReadcallsSliceExecutorTest::testApplySplitsAForeachPastItsElementsWithinTheLimitcallsSliceExecutorTest::testApplyStartsAForeachByReadingWhatItGoesOvercallsSliceExecutorTest::testIterateWithoutAKeyBindsOnlyTheValuecallsExpressionEvaluatorTest::testEvaluateCloneCreatesAnIndependentTrackedAllocationcallsExpressionEvaluatorTest::testEvaluateInvalidatesAllAliasesOfAReferenceAssignedObjectcallsNamedModelTestcallsInterpreterTestcallsReferenceEvaluatorTest::testAssignElementKeepsWhetherTheArrayIsKnownInFullcallsReferenceEvaluatorTest::testAssignElementMarksTheArrayANestedWriteGoesIntoAsIncompletecallsReferenceEvaluatorTest::testAssignListDescendsIntoANestedListcallsReferenceEvaluatorTest::testAssignListLeavesAGapForAnElementTheArrayDoesNotHoldcallsReferenceEvaluatorTest::testAssignListReadsAKeyedTargetByItsKeycallsReferenceEvaluatorTest::testAssignListWritesEachElementIntoTheTargetAtItsPositioncallsReferenceEvaluatorTest::testLoseTrackMarksAnArrayHeldByAPropertyOfThisAsIncompletecallsReferenceEvaluatorTest::testLoseTrackMarksTheArrayANestedWriteGoesIntoAsIncompletecallsValueBinderTest::testBindOneRecordReadsAnArrayOfValuescallsValueBinderTest::testBindValuesReachesEveryStatementcallsValueDomainTest::testFromDomainRecordsAnUnresolvedOriginForANonScalarTermcallsDomainTest::testSelectClaimsNothingItCannotReadcallsDomainTest::testSelectKeepsAGapForAnArrayKnownOnlyInPartcallsDomainTest::testSelectKeepsTheElementsMarkedAsCombinedWhenTheKeysWerecallsDomainTest::testSelectReadsAcrossEveryArrayAlternativecallsDomainTest::testSelectReadsEachElementAKeyWithSeveralValuesNamescallsDomainTest::testSelectReadsEveryElementUnderAKeyThatDidNotResolvecallsDomainTest::testSelectReadsTheElementUnderAResolvedKeycallsDomainTest::testSoleArrayOnlyAnswersForOneArraycallsEnvironmentTest::testObjectsSharesSnapshotsAcrossAliasesButNotCopiescallsEnvironmentTest::testRefreshObservesLaterMutationsThroughAnAlreadyEvaluatedReferencecallsEnvironmentTest::testReplaceKeepsJoinedAlternativeObjectStatescallsObjectMemoryTest::testCopyIsIndependentOfLaterMutationscallsObjectMemoryTest::testImportDoesNotOverwriteAMutatedObjectWithAnOldAliascallsObjectMemoryTest::testInvalidateOpensAliasedObjectsInsideArraysAndKeepsUntrackedValuescallsObjectMemoryTest::testJoinPreservesBothBranchesWithoutMutatingEithercallsObjectMemoryTest::testReadRefreshesObjectsStoredInArrayscallsObjectMemoryTest::testRememberMakesAliasesReadTheLatestSnapshotcallsObjectMemoryTest::testRememberValueRetainsAlternativeSnapshotsAndBudgetFlagscallsObjectTermTest::testSignatureDistinguishesAllocationsAndSnapshotsWithoutLosingOtherIdentitycallsTermTest::testSignatureSeparatesTermsOfDifferentKindscallsTermTest::testToPatternIsExactOnlyForResolvedTermscallsTermTest::testTypeIsReportedByEveryKindOfTermcallsDialectTest::testInsertPrefixComesFromThePolicycallsDialectTest::testInsertSuffixComesFromThePolicycallsDialectTest::testReturningSuffixComesFromThePolicycallsBuilderCallsTestcallsBuilderQueriesTestcallsCallbackModelTest::testCheckedPreservesAVisibleGapWhenTheCallbackExceedsItsBudgetcallsCallbackModelTest::testClosedRejectsWidenedResultsAndForeignIdentitiescallsCallModelTestcallsClausesTest::testColumnsRequiresCompletePositionalArrayscallsClausesTest::testGroupAppendsIdentifiersAndRetainsUnknownColumnscallsGrammarTest::testElementIsOneUnknownValueFromTheListsOrigincallsGrammarTest::testPlaceholdersStandForAListOfUnknownLengthFromTheSameOrigincallsGrammarTest::testRawBindingsCountPlaceholdersWhenTheArrayIsUnknowncallsModelMetadataTestcallsPredicatesTest::testEntryReadsKeyedComparisonsAndPositionalArgumentListscallsPredicatesTest::testGroupNestsArrayEntriesInParenthesesWithTheOuterBooleancallsPredicatesTest::testInPreservesValuesFromAssociativeArraysAndRejectsNestedArrayscallsPredicatesTest::testNullsDoesNotDropUnknownColumnsOrAssociativeValuescallsPredicatesTest::testRawKeepsBindingsAndLeavesIncompleteArraysOpencallsQueryStateTestcallsSelectCompilerTestcallsWriteCompilerTest::testCompileDoesNotInterpretACompleteRowAsAnUnknownWriteOperationcallsWriteCompilerTest::testCompileSelectsTheWriteOperationcallsWriteCompilerTest::testInsertGetIdReturnsTheKeyOnlyWhereTheDialectAsksForItcallsWriteCompilerTest::testInsertRejectsBulkRowsWithDifferentColumnscallsWriteCompilerTest::testInsertSortsBothColumnNamesAndValuesAcrossBulkRowscallsWriteCompilerTest::testInsertUsesEachDialectsIgnoreSyntaxAndPreservesColumnOrdercallsWriteCompilerTest::testRowsSortsBulkKeysAndRejectsIncompleteRowscallsWriteCompilerTest::testStepWritesLaravelsRawArithmeticBeforeExtraColumnscallsWriteCompilerTest::testUpdateOrdersAssignmentsBeforePredicateBindingscallsAnalyzerTestcallsConfigurationTestcallsJsonReporterTestcallsTextReporterTestcalls
Relations§
Instantiated in 10
- new SqlCatalog\Core\Analysis\BuiltinCallModel::fill() packages/sql-catalog/src/Core/Analysis/BuiltinCallModel.php:244
- new SqlCatalog\Core\Analysis\ReferenceEvaluator::readArray() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:128
- new SqlCatalog\Core\Analysis\ReferenceEvaluator::assignElement() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:384
- new SqlCatalog\Core\Analysis\ReferenceEvaluator::loseTrack() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:398
- new SqlCatalog\Core\Evaluation\ObjectMemory::read() packages/sql-catalog/src/Core/Evaluation/ObjectMemory.php:82
- new SqlCatalog\Core\Evaluation\ObjectMemory::invalidate() packages/sql-catalog/src/Core/Evaluation/ObjectMemory.php:135
- new SqlCatalog\Extension\Laravel\BuilderCalls::unsupported() packages/sql-catalog/src/Extension/Laravel/BuilderCalls.php:308
- new SqlCatalog\Extension\Laravel\QueryState::list() packages/sql-catalog/src/Extension/Laravel/QueryState.php:75
- new SqlCatalog\Extension\Laravel\QueryState::array() packages/sql-catalog/src/Extension/Laravel/QueryState.php:106
- new SqlCatalog\Extension\Laravel\WriteCompiler::step() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:96
Method calls 7
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::update() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:64
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::update() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:68
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::update() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:77
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::insertGetId() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:135
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::rows() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:153
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::rows() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:154
- method-call SqlCatalog\Extension\Laravel\WriteCompiler::rows() packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:157
Type checks 7
- instanceof SqlCatalog\Core\Analysis\Derivation\CalleeReturns::cacheable() packages/sql-catalog/src/Core/Analysis/Derivation/CalleeReturns.php:121
- instanceof SqlCatalog\Core\Evaluation\Domain::select() packages/sql-catalog/src/Core/Evaluation/Domain.php:161
- instanceof SqlCatalog\Core\Evaluation\Domain::soleArray() packages/sql-catalog/src/Core/Evaluation/Domain.php:219
- instanceof SqlCatalog\Core\Evaluation\ObjectMemory::import() packages/sql-catalog/src/Core/Evaluation/ObjectMemory.php:56
- instanceof SqlCatalog\Core\Evaluation\ObjectMemory::read() packages/sql-catalog/src/Core/Evaluation/ObjectMemory.php:81
- instanceof SqlCatalog\Core\Evaluation\ObjectMemory::invalidate() packages/sql-catalog/src/Core/Evaluation/ObjectMemory.php:134
- instanceof SqlCatalog\Extension\Laravel\BuilderCalls::unsupported() packages/sql-catalog/src/Extension/Laravel/BuilderCalls.php:307
Type declarations 9
- type SqlCatalog\Core\Analysis\BuiltinCallModel packages/sql-catalog/src/Core/Analysis/BuiltinCallModel.php:220
- type SqlCatalog\Core\Evaluation\Domain packages/sql-catalog/src/Core/Evaluation/Domain.php:215
- type SqlCatalog\Core\Evaluation\ObjectTerm packages/sql-catalog/src/Core/Evaluation/ObjectTerm.php:38
- type SqlCatalog\Extension\Laravel\Predicates packages/sql-catalog/src/Extension/Laravel/Predicates.php:136
- type SqlCatalog\Extension\Laravel\QueryState packages/sql-catalog/src/Extension/Laravel/QueryState.php:99
- type SqlCatalog\Extension\Laravel\WriteCompiler packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:62
- type SqlCatalog\Extension\Laravel\WriteCompiler packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:104
- type SqlCatalog\Extension\Laravel\WriteCompiler packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:133
- type SqlCatalog\Extension\Laravel\WriteCompiler packages/sql-catalog/src/Extension/Laravel/WriteCompiler.php:151