phpstan-doctrine
phpstan-doctrine copied to clipboard
Enforce literal string for connection execute methods
Friendly ping on this @craigfrancis, I'm never sure when dealing with literal-string.
In the same way that we enforce passing literal string to QueryBuilder methods in https://github.com/phpstan/phpstan-doctrine/blob/1.4.x/stubs/bleedingEdge/ORM/QueryBuilder.stub
I wonder if we shouldn't enforce literal string to for Connection::execute* methods which executes SQL directly.
This would help chaning query like
->executeQuery('SELECT foo where foo.bar = '.$nonLiteralValue);
to
->executeQuery('SELECT foo where foo.bar = :value', ['value' => $nonLiteralValue]);