final class StatementSimulator

Executes rewritten statements and applies shadow mutations for exec().

Exception handling for unsupported SQL and unknown schema is now done in QueryExecutor::rewrite(), so this class simply delegates to the core executor.

Methods§

public function __construct(QueryExecutor $executor)

Parameters

$executorQueryExecutorCore execution pipeline.
public function simulate(
    string $statement,
    callable(string): StatementInterface|false $executor,
): int|false

Simulate exec() by running result-select and updating shadow state.

QueryExecutor::rewrite() now handles exceptions for unsupported SQL and unknown schema based on config, so we no longer need to handle FORBIDDEN/UNKNOWN_SCHEMA here.

Parameters

$statementstring
$executorcallable(string): StatementInterface|false

Returns

int|false
Test cases 5
Calls 5

Private surface 1§

Implementation details, listed for orientation only.

private QueryExecutor $executor

Test cases 5§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5