-
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
Fix broken assert(is_numeric($sql)) in DateAddFunction and DateSubFunction #11240
Comments
2 tasks
ondrejmirtes
added a commit
to phpstan/phpstan-doctrine
that referenced
this issue
Feb 9, 2024
ondrejmirtes
added a commit
to phpstan/phpstan-doctrine
that referenced
this issue
Feb 9, 2024
Related: doctrine/orm#11240 Related: doctrine/orm#11241
ondrejmirtes
added a commit
to phpstan/phpstan-doctrine
that referenced
this issue
Feb 9, 2024
ondrejmirtes
added a commit
to phpstan/phpstan-doctrine
that referenced
this issue
Feb 9, 2024
Related: doctrine/orm#11240 Related: doctrine/orm#11241
ondrejmirtes
added a commit
to phpstan/phpstan-doctrine
that referenced
this issue
Feb 9, 2024
ondrejmirtes
added a commit
to phpstan/phpstan-doctrine
that referenced
this issue
Feb 9, 2024
Related: doctrine/orm#11240 Related: doctrine/orm#11241
That looks like a valid bug. PR welcome if someone wants to give it a try before I find the time. |
I'm trying: #11243 |
derrabus
changed the title
3.0 - DQL AST - assert(is_numeric($sql)) is wrong in DateAddFunction and DateSubFunction
Fix broken assert(is_numeric($sql)) in DateAddFunction and DateSubFunction
Feb 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Summary
I'm working on ORM 3 and DBAL 4 support on phpstan-doctrine, and I have this test case:
Doctrine crashes on this line:
orm/src/Query/AST/Functions/DateAddFunction.php
Line 74 in 5a40b99
The
$sql
value is:m0_.intColumn
.I think the
assert
assumption is wrong, asinterval
does not have to refer to a scalar value, but can be a column as well. The job of this part of the codebase is to just generate the correct SQL query to execute against the database.Same problem is in DateSubFunction too.
Current behavior
Expected behavior
It should work and generate the right SQL.
The text was updated successfully, but these errors were encountered: