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'|null

Parameters

$sqlstring

Returns

'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|null
Test cases 1
Called from 1
Calls 5
public function classifySimpleStatement(string $sql): 'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|'TRUNCATE'|'CREATE_TABLE'|'DROP_TABLE'|'ALTER_TABLE'|'DO'|'TCL'|null

Parameters

$sqlstring

Returns

'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|'TRUNCATE'|'CREATE_TABLE'|'DROP_TABLE'|'ALTER_TABLE'|'DO'|'TCL'|null
Test cases 1
Called from 1
Calls 2
public function keywordAt(
    string $stripped,
    int $position,
): array{keyword: 'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|null, end: int}|null

Reads a statement keyword only at an unquoted word boundary.

Parameters

$strippedstring
$positionint

Returns

array{keyword: 'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|null, end: int}|null
Test cases 1
Called from 1
Calls 4
public function classifyStatement(string $sql): 'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|'TRUNCATE'|'CREATE_TABLE'|'DROP_TABLE'|'ALTER_TABLE'|'DO'|'TCL'|null

Classify a SQL statement type.

Parameters

$sqlstring

Returns

'SELECT'|'INSERT'|'UPDATE'|'DELETE'|'MERGE'|'TRUNCATE'|'CREATE_TABLE'|'DROP_TABLE'|'ALTER_TABLE'|'DO'|'TCL'|null
Test cases 1
Called from 1
Calls 4

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

Relations§

Instantiated in 1
Method calls 1