classEscapeCursor
final class EscapeCursor
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Tracks the source position and operand context while escaping PDO placeholders.
Properties§
public int $position = 0Next byte to inspect in the original SQL.
public string $result = ''Escaped SQL accumulated so far.
public bool $expectsOperand = trueWhether a question mark at the current position is a placeholder.
public string $sqlMethods§
public function __construct(public string $sql)Retains the source SQL while escaping its operator tokens.
Parameters
$sql | string |
public function preserve(int $length): voidPreserves the next source span and advances the scanner.
Parameters
$length | int |
Test cases 3
Called from 11
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\OperandInput::consumeOperator() packages/ztd-query-postgres/src/Connection/Parameter/OperandInput.php:22
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\OperandInput::consumeOperator() packages/ztd-query-postgres/src/Connection/Parameter/OperandInput.php:30
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\OperandInput::consumeOperand() packages/ztd-query-postgres/src/Connection/Parameter/OperandInput.php:55
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\OperandInput::consumeOperand() packages/ztd-query-postgres/src/Connection/Parameter/OperandInput.php:60
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\PgSqlPdoPlaceholderEscaper::escape() packages/ztd-query-postgres/src/Connection/Parameter/PgSqlPdoPlaceholderEscaper.php:29
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput::consumeIgnored() packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:25
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput::consumeIgnored() packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:30
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput::consumeIgnored() packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:34
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput::consumeQuoted() packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:50
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput::consumeQuoted() packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:63
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput::consumeQuoted() packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:66
Calls 1
- function-call
substrline 39
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 7
OperandInputTest::testConsumeOperandTracksKeywordsAndNamedParameterscallsOperandInputTest::testConsumeOperatorDistinguishesPlaceholdersAndOperatorscallsPgSqlPdoParameterBindingCompilerTestcallsPgSqlPdoPlaceholderEscaperTestcallsQuotedInputTest::testConsumeIgnoredPreservesNestedCommentsAndContextcallsQuotedInputTest::testConsumeQuotedPreservesLiteralQuestionMarkscallsPgSqlSessionFactoryTestcalls
Relations§
Instantiated in 1
Method calls 11
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\OperandInput::consumeOperator() packages/ztd-query-postgres/src/Connection/Parameter/OperandInput.php:22
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\OperandInput::consumeOperator() packages/ztd-query-postgres/src/Connection/Parameter/OperandInput.php:30
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\OperandInput::consumeOperand() packages/ztd-query-postgres/src/Connection/Parameter/OperandInput.php:55
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\OperandInput::consumeOperand() packages/ztd-query-postgres/src/Connection/Parameter/OperandInput.php:60
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\PgSqlPdoPlaceholderEscaper::escape() packages/ztd-query-postgres/src/Connection/Parameter/PgSqlPdoPlaceholderEscaper.php:29
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput::consumeIgnored() packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:25
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput::consumeIgnored() packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:30
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput::consumeIgnored() packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:34
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput::consumeQuoted() packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:50
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput::consumeQuoted() packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:63
- method-call ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput::consumeQuoted() packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:66
Type declarations 4
- type ZtdQuery\Platform\Postgres\Connection\Parameter\OperandInput packages/ztd-query-postgres/src/Connection/Parameter/OperandInput.php:17
- type ZtdQuery\Platform\Postgres\Connection\Parameter\OperandInput packages/ztd-query-postgres/src/Connection/Parameter/OperandInput.php:47
- type ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:20
- type ZtdQuery\Platform\Postgres\Connection\Parameter\QuotedInput packages/ztd-query-postgres/src/Connection/Parameter/QuotedInput.php:43