classValueBinder
final class ValueBinder
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Attaches the values a call binds to the statements they are bound to.
Drivers offer several ways to say the same thing: one array of values, a variadic list, or one name and one value at a time. The binder reads all of them into the same record, so a statement carries what it is given however it was given.
Methods§
public function __construct(StatementRecorder $recorder)Wires the binder to the recorder holding the open statements.
Parameters
$recorder | StatementRecorder |
public function openRecords(Domain $receiver): list<QueryRecord>The statements a receiver's handle stands for.
Parameters
$receiver | Domain |
Returns
list<QueryRecord>Test cases 2
Called from 1
Calls 2
- method-call Domain::soleObject() line 39
- method-call StatementRecorder::prepared() line 41
public function bindValues(
list<QueryRecord> $records,
SinkSpec $sink,
list<Domain> $arguments,
): voidAttaches the values a call binds to every statement it binds them to.
Parameters
$records | list<QueryRecord> | |
$sink | SinkSpec | |
$arguments | list<Domain> |
Test cases 1
Called from 2
Calls 1
- method-call ValueBinder::bindOneRecord() line 53
public function bindOneRecord(
QueryRecord $record,
SinkSpec $sink,
list<Domain> $arguments,
): voidAttaches the values a call binds to one statement.
Parameters
$record | QueryRecord | |
$sink | SinkSpec | |
$arguments | list<Domain> |
Test cases 9
ValueBinderTest::testBindOneRecordAppendsAValueWhoseNameDidNotResolvecallsValueBinderTest::testBindOneRecordDoesNothingWhenTheCallBindsNothingcallsValueBinderTest::testBindOneRecordIgnoresAValuesArgumentThatDidNotResolvecallsValueBinderTest::testBindOneRecordLeavesAnArrayOfValuesThatDidNotResolveUnboundEvenWhenValuesCouldBeListedcallsValueBinderTest::testBindOneRecordNeedsBothTheNameAndTheValueOfASingleBindcallsValueBinderTest::testBindOneRecordReadsAnArrayOfValuescallsValueBinderTest::testBindOneRecordReadsOneNamedValuecallsValueBinderTest::testBindOneRecordReadsVariadicValuescallsValueBinderTest::testBindOneRecordReadsVariadicValuesWithoutAlsoReadingOneNamedValuecalls
Called from 1
Calls 5
- static-call Domain::unknown() line 65
- method-call QueryRecord::bind() line 67
- function-call
array_sliceline 73 - method-call QueryRecord::bindOne() line 81
- method-call ValueBinder::bindingKey() line 81
public function bindingKey(string|int|float|bool|null $written): string|int|nullThe key a single bind writes its value under.
Parameters
$written | string|int|float|bool|null |
Returns
string|int|nullTest cases 1
Called from 1
Private surface 1§
Implementation details, listed for orientation only.
private StatementRecorder $recorderTest cases 30§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 13
ValueBinderTest::testBindingKeyReadsOnlyScalarKeyscallsValueBinderTest::testBindOneRecordAppendsAValueWhoseNameDidNotResolvecallsValueBinderTest::testBindOneRecordDoesNothingWhenTheCallBindsNothingcallsValueBinderTest::testBindOneRecordIgnoresAValuesArgumentThatDidNotResolvecallsValueBinderTest::testBindOneRecordLeavesAnArrayOfValuesThatDidNotResolveUnboundEvenWhenValuesCouldBeListedcallsValueBinderTest::testBindOneRecordNeedsBothTheNameAndTheValueOfASingleBindcallsValueBinderTest::testBindOneRecordReadsAnArrayOfValuescallsValueBinderTest::testBindOneRecordReadsOneNamedValuecallsValueBinderTest::testBindOneRecordReadsVariadicValuescallsValueBinderTest::testBindOneRecordReadsVariadicValuesWithoutAlsoReadingOneNamedValuecallsValueBinderTest::testBindValuesReachesEveryStatementcallsValueBinderTest::testOpenRecordsFindsTheStatementsAHandleStandsForcallsValueBinderTest::testOpenRecordsIsEmptyForAReceiverWithoutAHandlecalls
Other tests reaching this symbol 17
CatalogCommandTestcallsCallEvaluatorTestcallsExpressionEvaluatorTestcallsInterpreterTest::testRecordStatementsFilesTheStatementsOfEveryReadingUnderThePreparedHandlecallsInterpreterTest::testRecordStatementsMarksAStatementCombinedWhenEitherTheTextOrTheReadingIscallsInterpreterTest::testRecordStatementsRecordsACallNothingCouldBeReadFromAsUnreadcallsInterpreterTest::testRecordStatementsSkipsAReadingWithoutTheStatementcallsInterpreterTest::testVisitHandsBackNothingForABindingCallWrittenWithoutAReceivercallsInterpreterTest::testVisitHandsBackWhatAnExecuteBindscallsInterpreterTest::testVisitRecordsAStatementAndHandsBackNothingToBindLatercallsInterpreterTest::testVisitRecordsNothingForACallWithoutItsStatementcallsInterpreterTest::testVisitRecordsNothingForADatabaseCallThatTakesNoStatementcallsReferenceEvaluatorTestcallsCallModelTestcallsAnalyzerTestcallsJsonReporterTestcallsTextReporterTestcalls
Relations§
Instantiated in 1
Method calls 3
- method-call SqlCatalog\Core\Analysis\Interpreter::analyze() packages/sql-catalog/src/Core/Analysis/Interpreter.php:123
- method-call SqlCatalog\Core\Analysis\Interpreter::analyze() packages/sql-catalog/src/Core/Analysis/Interpreter.php:123
- method-call SqlCatalog\Core\Analysis\Interpreter::recordStatements() packages/sql-catalog/src/Core/Analysis/Interpreter.php:343