Add validate param occurence feature + tests - #274
sander-hash wants to merge 1 commit into
Conversation
|
Thanks for the PR — the idea is right, the implementation is clean, and the tests, docs and CHANGELOG are all in place. Unfortunately I'm closing it as-is because the placeholder regex introduces a regression for existing 1. False positive on JSON literals (blocking)
$db->selectWithParams("SELECT '{\"a\":1}' AS j, {id:UInt32} AS id", ['id' => 1]);
// MissingBindingParamsException: Missing params for placeholders: {"a":1}Same for Fix: restrict the name to a ClickHouse identifier, e.g. preg_match_all('/\{(\w+):([^{}]+)\}/', $this->sql, $matches, PREG_SET_ORDER);Quoted JSON keys no longer match. Please also add a test with a JSON literal in the SQL to lock this in. 2. Validation is silently skipped for types with commas/spaces (non-blocking)
Minor
Everything else checks out: PHPStan clean, no new phpcs issues (it actually removes nine old ones), public API untouched, the new exception is caught by existing |
No description provided.