classStatementClassifier
final class StatementClassifier
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Classification operations for PostgreSQL statement.
Methods§
public function classifyWithStatement(string $sql): 'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|nullParameters
$sql | string |
Returns
'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|nullTest cases 1
Called from 1
Calls 5
- static-call PostgreSqlLexicalMasker::maskStringLiterals() line 21
- function-call
strlenline 22 - function-call
strposline 30 - function-call
ctype_alphaline 48 - method-call StatementClassifier::keywordAt() line 52
public function classifySimpleStatement(string $sql): 'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|'TRUNCATE'|'CREATE_TABLE'|'DROP_TABLE'|'ALTER_TABLE'|'DO'|'TCL'|nullParameters
$sql | string |
Returns
'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|'TRUNCATE'|'CREATE_TABLE'|'DROP_TABLE'|'ALTER_TABLE'|'DO'|'TCL'|nullTest cases 1
Called from 1
public function keywordAt(
string $stripped,
int $position,
): array{keyword: 'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|null, end: int}|nullReads a statement keyword only at an unquoted word boundary.
Parameters
$stripped | string | |
$position | int |
Returns
array{keyword: 'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|null, end: int}|nullTest cases 1
Called from 1
public function classifyStatement(string $sql): 'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|'TRUNCATE'|'CREATE_TABLE'|'DROP_TABLE'|'ALTER_TABLE'|'DO'|'TCL'|nullClassify a SQL statement type.
Parameters
$sql | string |
Returns
'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|'TRUNCATE'|'CREATE_TABLE'|'DROP_TABLE'|'ALTER_TABLE'|'DO'|'TCL'|nullTest cases 1
Called from 1
Calls 4
- static-call PostgreSqlLexicalMasker::maskComments() line 150
- function-call
preg_matchline 152 - method-call StatementClassifier::classifyWithStatement() line 153
- method-call StatementClassifier::classifySimpleStatement() line 156
Test cases 21§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
Other tests reaching this symbol 17
PgSqlSessionFactoryTestcallsTableContextTestcallsPgSqlQueryGuardTestcallsPgSqlRewriterTestcallsStatementRewriterTestcallsDeleteTransformerTestcallsSelectProjectionTestcallsUpsertProjectionTestcallsValueProjectionTestcallsInsertSelectRendererTestcallsInsertTransformerTestcallsPgSqlTransformerTestcallsUpdateTransformerTestcallsRowMutationResolverTestcallsTableMutationResolverTestcallsPgSqlMutationResolverTestcallsPgSqlParserTestcalls