phpstan-dba
phpstan-dba copied to clipboard
question marks in comments are evaluated as query parameters
$query = '
Select * from ada
where adakzid = 15 -- customer ???
';
$stmt = $pdo->prepare($query);
$query = $stmt->execute([]);
phpstan reports:
------ ------------------------------------------------------------------------
Line example.php
------ ------------------------------------------------------------------------
7 Query expects 3 placeholders, but no values are given.
------ ------------------------------------------------------------------------
I guess the same is true for named placeholders within comments.
think we should strip comments before placeholder analysis in the QueryReflection class
hola,
@bloep could you see if https://github.com/staabm/phpstan-dba/pull/431 resolves your issue?