classCallbackModel
final class CallbackModel
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Models nested predicates and source-declared local scopes through shared callback execution.
Methods§
public function __construct(
private ProgramIndex $index,
private CallbackEffects $effects,
private Dialects $dialects = new \SqlCatalog\Core\Sql\Dialects(),
)Uses source metadata and the current derivation's callback runner.
Parameters
$index | ProgramIndex | |
$effects | CallbackEffects | |
$dialects | Dialects |
public function apply(
CallLike $call,
ObjectTerm $object,
string $method,
list<Domain> $arguments,
Environment $environment,
FunctionScope $scope,
ExpressionEvaluator $expressions,
): ?DomainA nested where callback or local scope, otherwise null.
Parameters
$call | CallLike | |
$object | ObjectTerm | |
$method | string | |
$arguments | list<Domain> | |
$environment | Environment | |
$scope | FunctionScope | |
$expressions | ExpressionEvaluator |
Returns
Test cases 2
Calls 16
- method-call
CallLike::getArgs()line 37 - function-call
in_arrayline 38 - function-call
countline 39 - static-call Domain::of() line 40
- static-call QueryState::from() line 40
- method-call CallbackModel::nested() line 43
- method-call CallbackModel::conditional() line 46
- method-call ProgramIndex::findMethod() line 49
- method-call FunctionScope::enter() line 53
- method-call FunctionScope::isFollowing() line 54
- method-call CallbackEffects::apply() line 57
- function-call
array_mergeline 57 - new Environment line 57
- new ObjectTerm line 57
- class-const ModelMetadata::MODEL() line 57
- method-call CallbackModel::checked() line 59
public function conditional(
CallLike $call,
ObjectTerm $object,
list<Domain> $arguments,
Environment $environment,
FunctionScope $scope,
ExpressionEvaluator $expressions,
): DomainBoth outcomes of a conditional callback, since the condition is not evaluated.
Parameters
$call | CallLike | |
$object | ObjectTerm | |
$arguments | list<Domain> | |
$environment | Environment | |
$scope | FunctionScope | |
$expressions | ExpressionEvaluator |
Returns
Called from 1
Calls 8
- method-call
CallLike::getArgs()line 71 - function-call
countline 76 - static-call Domain::of() line 77
- static-call QueryState::from() line 77
- method-call CallbackEffects::apply() line 81
- function-call
array_mergeline 82 - method-call CallbackModel::closed() line 82
- static-call Domain::fromTerms() line 88
public function closed(Domain $result, ObjectTerm $original, string $reason): DomainThe callback's states of the same builder, or a visible gap when its effects escaped or widened.
Parameters
$result | Domain | |
$original | ObjectTerm | |
$reason | string |
Returns
Test cases 1
Called from 1
Calls 2
- static-call Domain::of() line 98
- static-call QueryState::from() line 98
public function nested(
Closure|ArrowFunction $callback,
ObjectTerm $object,
string $method,
Environment $environment,
FunctionScope $scope,
ExpressionEvaluator $expressions,
): DomainParenthesizes only the callback's predicates, then restores the outer query's fields.
Parameters
$callback | Closure|ArrowFunction | |
$object | ObjectTerm | |
$method | string | |
$environment | Environment | |
$scope | FunctionScope | |
$expressions | ExpressionEvaluator |
Returns
Called from 1
Calls 18
- static-call QueryState::from() line 110
- method-call FreeNames::read() line 111
- new FreeNames line 111
- method-call Environment::read() line 112
- method-call BuilderCalls::unsupported() line 114
- new BuilderCalls line 114
- static-call QueryState::list() line 118
- new ObjectTerm line 119
- function-call
spl_object_idline 119 - method-call CallbackEffects::apply() line 120
- static-call Domain::of() line 120
- new Grammar line 122
- method-call Dialects::find() line 122
- static-call Domain::literal() line 133
- method-call Grammar::join() line 133
- method-call Predicates::add() line 134
- new Predicates line 134
- static-call Domain::fromTerms() line 139
public function checked(Domain $result, ObjectTerm $original): DomainLeaves a visible gap when a callback loses its receiver or exceeds the budget.
Parameters
$result | Domain | |
$original | ObjectTerm |
Returns
Called from 1
Calls 5
- method-call Domain::soleObject() line 147
- static-call Domain::of() line 149
- static-call QueryState::from() line 149
- function-call
is_stringline 154 - function-call
str_starts_withline 154
Private surface 3§
Implementation details, listed for orientation only.
private ProgramIndex $indexprivate CallbackEffects $effectsprivate Dialects $dialects = new \SqlCatalog\Core\Sql\Dialects()Test cases 10§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
CallbackModelTest::testApplyRunsSourceDeclaredLocalScopescallsCallbackModelTest::testCheckedPreservesAVisibleGapWhenTheCallbackExceedsItsBudgetcallsCallbackModelTest::testClosedRejectsWidenedResultsAndForeignIdentitiescallsCallbackModelTest::testConditionalKeepsBothOutcomesOfWhenAndUnlesscallsCallbackModelTest::testNestedRestoresOuterClausesAndGroupsOnlyNewPredicatescalls
Other tests reaching this symbol 5
CallbackEffectsTestcallsBuilderQueriesTestcallsCallModelTestcallsLaravelExtensionTestcallsAnalyzerTestcalls