-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync type of parameters accepted by ORM NativeQuery setParameter and the one returned by DBAL QueryBuilder getParameterTypes #11538
Comments
Hi mate! Hope you're doing well!
That does not seems to be the case on 3.2.x: Line 333 in 1fe1a6a
That's since #9950 and #10995, and as you can see, the type declaration is widened to include |
Hey hey Grégoire! I'm fine, hope the same for you!
I'm almost sure that I never get a |
I'm doing great, thanks! I think you might have found a DBAL bug, because when I run the entire test suite after dropping EDIT: it's not a DBAL bug. There is support for |
That sounds indeed like the way to go. Is there a reason not to do it at the |
Any reason I can think of :) |
Bug Report
Summary
For some complex queries, I use the following pattern in a repository:
it has the benefit to manager all parameters in the DBAL query builder, having it functional if used on it's own, and avoid forgetting to pass a parameter to the ORM native query.
But PHPStan is not OK with that.
Current behavior
I get the following PHPStan error:
How to reproduce
as shown in the Summary section:
Expected behavior
no PHPStan error, so maybe make the ORM NativeQuery setParameter methos accepts Doctrine\DBAL\Types\Type?
What do you think? Maybe there is a better way?
Note: for now the code works, it's PHPStan that complains
The text was updated successfully, but these errors were encountered: