classSinkSpec
final class SinkSpec
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
One call an extension recognises as reaching the database.
The parameter indexes say where the statement text and the bound values sit in the argument list, which is all the analyzer needs in order to treat a framework's own API the same way it treats a raw driver call.
Properties§
public ?int $sqlParameterSQL argument position, or the fixed SQL output position for a modelled sink.
public ?int $valuesParameterBindings argument position, or the fixed bindings output position for a modelled sink.
public string $idpublic SinkCallKind $callKindpublic string|null $receiverTypepublic string $namepublic SinkRole $rolepublic int|null $valuesFrom = nullpublic int|null $nameParameter = nullpublic int|null $valueParameter = nullpublic StatementKind|null $kind = nullpublic string|null $handleType = nullpublic string|null $model = nullMethods§
public function __construct(
public string $id,
public SinkCallKind $callKind,
public string|null $receiverType,
public string $name,
public SinkRole $role,
int|null $sqlParameter = null,
int|null $valuesParameter = null,
public int|null $valuesFrom = null,
public int|null $nameParameter = null,
public int|null $valueParameter = null,
public StatementKind|null $kind = null,
public string|null $handleType = null,
public string|null $model = null,
)Parameters
$id | string | The identifier reported on matched call sites |
$callKind | SinkCallKind | How the call is written |
$receiverType | string|null | The class the call is made on, or null for a free function |
$name | string | The method or function name |
$role | SinkRole | What the call does with the statement |
$sqlParameter | int|null | Where the statement text sits in the argument list |
$valuesParameter | int|null | Where an array of bound values sits |
$valuesFrom | int|null | Where variadic bound values start |
$nameParameter | int|null | Where the name of a single bound parameter sits |
$valueParameter | int|null | Where the value of a single bound parameter sits |
$kind | StatementKind|null | The statement kind the call implies, when it implies one |
$handleType | string|null | The class a preparing call returns, so later binds find the statement |
$model | string|null | The registered statement model for a modelled execution call |
Calls 1
- class-const SinkRole::Modelled() line 60
public function matchesName(string $name): boolWhether the call is written with the given name, ignoring case.
Parameters
$name | string |
Returns
boolTest cases 1
Test cases 53§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 50
CatalogCommandTestcallsCallEvaluatorTest::testApplySinkHandsBackWhatEachKindOfDatabaseCallHandsBackcallsCallEvaluatorTest::testEvaluateStaticHandsBackWhatADatabaseCallHandsBackcallsCallersTestcallsDeriverTestcallsFreeNamesTestcallsCallbackEffectsTestcallsExpressionEvaluatorTestcallsInterpreterTest::testSinkOfResolvesAStaticCallOnTheEnclosingClasscallsInterpreterTest::testVisitHandsBackNothingForABindingCallWrittenWithoutAReceivercallsInterpreterTest::testVisitRecordsNothingForADatabaseCallThatTakesNoStatementcallsSinkFinderTest::testFindAllCollectsEveryDatabaseCallButTheOnesThatComposeAStatementcallsSinkFinderTest::testFindAllFindsNothingWhenEverySinkComposesAStatementcallsSinkFinderTest::testNamesOfWritesEachNameInLowerCaseWithoutALeadingBackslashcallsSinkMatcherTest::testByNameKeepsEveryCallOfThatNamecallsSinkMatcherTest::testMatchStaticFindsTheCallOnAKnownClasscallsValueBinderTest::testBindOneRecordAppendsAValueWhoseNameDidNotResolvecallsValueBinderTest::testBindOneRecordDoesNothingWhenTheCallBindsNothingcallsValueBinderTest::testBindOneRecordIgnoresAValuesArgumentThatDidNotResolvecallsValueBinderTest::testBindOneRecordLeavesAnArrayOfValuesThatDidNotResolveUnboundEvenWhenValuesCouldBeListedcallsValueBinderTest::testBindOneRecordNeedsBothTheNameAndTheValueOfASingleBindcallsValueBinderTest::testBindOneRecordReadsAnArrayOfValuescallsValueBinderTest::testBindOneRecordReadsOneNamedValuecallsValueBinderTest::testBindOneRecordReadsVariadicValuescallsValueBinderTest::testBindOneRecordReadsVariadicValuesWithoutAlsoReadingOneNamedValuecallsValueBinderTest::testBindValuesReachesEveryStatementcallsExtensionInterfaceTest::testSinksAreIdentifiedUniquelyWithinAnExtensioncallsExtensionRegistryTest::testSinksOfCollectsTheCallsOfEveryNamedExtensioncallsDoctrineExtensionTest::testEverySinkIsDescribedExactlycallsDoctrineExtensionTest::testPreparingHandsBackADoctrineStatementcallsDoctrineExtensionTest::testSinksCoverPreparingBindingAndQueryingcallsBuilderQueriesTestcallsCallbackModelTestcallsCallModelTestcallsLaravelExtensionTest::testBuilderMethodsDeclareReadsWritesAndCompoundExecutionscallsLaravelExtensionTest::testEverySinkIsDescribedExactlycallsLaravelExtensionTest::testSinksCoverBothTheFacadeAndTheConnectioncallsMysqliExtensionTest::testEverySinkIsDescribedExactlycallsMysqliExtensionTest::testFunctionSinksTakeTheStatementAsTheSecondArgumentcallsMysqliExtensionTest::testMethodSinksBindVariadicValuescallsMysqliExtensionTest::testSinksCoverBothTheObjectAndTheProceduralApicallsPdoExtensionTest::testEverySinkIsDescribedExactlycallsPdoExtensionTest::testSinksCoverQueryingPreparingAndBindingcallsWordPressExtensionTest::testEverySinkIsDescribedExactlycallsWordPressExtensionTest::testPrepareHandsTheStatementBackRatherThanSendingItcallsWordPressExtensionTest::testSinksCoverInterpolatingAndIssuingAStatementcallsAnalyzerTest::testAnalyzeSourceKeepsAModelledSinkWithoutARegisteredCompilerVisiblecallsAnalyzerTest::testAnalyzeSourceSupportsRegisteredQueryModelsWithoutLaravelcallsJsonReporterTestcallsTextReporterTestcalls
Relations§
Instantiated in 28
- new SqlCatalog\Extension\Doctrine\DoctrineExtension::sinks() packages/sql-catalog/src/Extension/Doctrine/DoctrineExtension.php:52
- new SqlCatalog\Extension\Doctrine\DoctrineExtension::sinks() packages/sql-catalog/src/Extension/Doctrine/DoctrineExtension.php:61
- new SqlCatalog\Extension\Doctrine\DoctrineExtension::sinks() packages/sql-catalog/src/Extension/Doctrine/DoctrineExtension.php:70
- new SqlCatalog\Extension\Doctrine\DoctrineExtension::sinks() packages/sql-catalog/src/Extension/Doctrine/DoctrineExtension.php:81
- new SqlCatalog\Extension\Laravel\LaravelExtension::sinks() packages/sql-catalog/src/Extension/Laravel/LaravelExtension.php:61
- new SqlCatalog\Extension\Laravel\LaravelExtension::sinks() packages/sql-catalog/src/Extension/Laravel/LaravelExtension.php:71
- new SqlCatalog\Extension\Laravel\LaravelExtension::sinks() packages/sql-catalog/src/Extension/Laravel/LaravelExtension.php:85
- new SqlCatalog\Extension\Laravel\LaravelExtension::sinks() packages/sql-catalog/src/Extension/Laravel/LaravelExtension.php:87
- new SqlCatalog\Extension\Mysqli\MysqliExtension::methodSinks() packages/sql-catalog/src/Extension/Mysqli/MysqliExtension.php:57
- new SqlCatalog\Extension\Mysqli\MysqliExtension::methodSinks() packages/sql-catalog/src/Extension/Mysqli/MysqliExtension.php:58
- new SqlCatalog\Extension\Mysqli\MysqliExtension::methodSinks() packages/sql-catalog/src/Extension/Mysqli/MysqliExtension.php:59
- new SqlCatalog\Extension\Mysqli\MysqliExtension::methodSinks() packages/sql-catalog/src/Extension/Mysqli/MysqliExtension.php:60
- new SqlCatalog\Extension\Mysqli\MysqliExtension::methodSinks() packages/sql-catalog/src/Extension/Mysqli/MysqliExtension.php:69
- new SqlCatalog\Extension\Mysqli\MysqliExtension::methodSinks() packages/sql-catalog/src/Extension/Mysqli/MysqliExtension.php:78
- new SqlCatalog\Extension\Mysqli\MysqliExtension::methodSinks() packages/sql-catalog/src/Extension/Mysqli/MysqliExtension.php:86
- new SqlCatalog\Extension\Mysqli\MysqliExtension::functionSinks() packages/sql-catalog/src/Extension/Mysqli/MysqliExtension.php:105
- new SqlCatalog\Extension\Mysqli\MysqliExtension::functionSinks() packages/sql-catalog/src/Extension/Mysqli/MysqliExtension.php:106
- new SqlCatalog\Extension\Mysqli\MysqliExtension::functionSinks() packages/sql-catalog/src/Extension/Mysqli/MysqliExtension.php:107
- new SqlCatalog\Extension\Mysqli\MysqliExtension::functionSinks() packages/sql-catalog/src/Extension/Mysqli/MysqliExtension.php:108
- new SqlCatalog\Extension\Mysqli\MysqliExtension::functionSinks() packages/sql-catalog/src/Extension/Mysqli/MysqliExtension.php:117
- new SqlCatalog\Extension\Pdo\PdoExtension::sinks() packages/sql-catalog/src/Extension/Pdo/PdoExtension.php:47
- new SqlCatalog\Extension\Pdo\PdoExtension::sinks() packages/sql-catalog/src/Extension/Pdo/PdoExtension.php:48
- new SqlCatalog\Extension\Pdo\PdoExtension::sinks() packages/sql-catalog/src/Extension/Pdo/PdoExtension.php:49
- new SqlCatalog\Extension\Pdo\PdoExtension::sinks() packages/sql-catalog/src/Extension/Pdo/PdoExtension.php:58
- new SqlCatalog\Extension\Pdo\PdoExtension::sinks() packages/sql-catalog/src/Extension/Pdo/PdoExtension.php:66
- new SqlCatalog\Extension\Pdo\PdoExtension::sinks() packages/sql-catalog/src/Extension/Pdo/PdoExtension.php:75
- new SqlCatalog\Extension\WordPress\WordPressExtension::sinks() packages/sql-catalog/src/Extension/WordPress/WordPressExtension.php:56
- new SqlCatalog\Extension\WordPress\WordPressExtension::sinks() packages/sql-catalog/src/Extension/WordPress/WordPressExtension.php:67
Type declarations 9
- type SqlCatalog\Core\Analysis\CallEvaluator packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:383
- type SqlCatalog\Core\Analysis\Interpreter packages/sql-catalog/src/Core/Analysis/Interpreter.php:246
- type SqlCatalog\Core\Analysis\Interpreter packages/sql-catalog/src/Core/Analysis/Interpreter.php:325
- type SqlCatalog\Core\Analysis\SinkMatcher packages/sql-catalog/src/Core/Analysis/SinkMatcher.php:39
- type SqlCatalog\Core\Analysis\SinkMatcher packages/sql-catalog/src/Core/Analysis/SinkMatcher.php:53
- type SqlCatalog\Core\Analysis\SinkMatcher packages/sql-catalog/src/Core/Analysis/SinkMatcher.php:67
- type SqlCatalog\Core\Analysis\ValueBinder packages/sql-catalog/src/Core/Analysis/ValueBinder.php:50
- type SqlCatalog\Core\Analysis\ValueBinder packages/sql-catalog/src/Core/Analysis/ValueBinder.php:62
- type SqlCatalog\Core\Extension\Model\CallContext packages/sql-catalog/src/Core/Extension/Model/CallContext.php:39