mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
PHPStan warning #6440
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kirya-dev on GitHub (Apr 8, 2020).
Bug Report
Summary
When im run phpstan analyser with 6 level i get error:
Parameter #1 $x of method Doctrine\ORM\Query\Expr::andX() expects Doctrine\ORM\Query\Expr\Comparison|Doctrine\ORM\Query\Expr\Func|Doctrine\ORM\Query\Expr\Orx|string|null, Doctrine\ORM\Query\Expr\Andx given.
Current behavior
8c259ea5cb/lib/Doctrine/ORM/Query/Expr.php (L31)How to reproduce
Run
vendor/bin/phpstan analyse -c phpstan.neon -l 6Expected behavior
No warnings
Just replace annotation on mixed?
@greg0ire commented on GitHub (Apr 8, 2020):
The list of allowed classes is shown here:
8c259ea5cb/lib/Doctrine/ORM/Query/Expr/Andx.php (L16-L21)So it would just be a matter of adding
Andxhere. Please send a PR against 2.7@kirya-dev commented on GitHub (Aug 5, 2020):
We can replace just on \Stringable (polyfill php8)?
@greg0ire commented on GitHub (Aug 5, 2020):
What do you want to replace with
\Stringableand why? We don't cast to string, do we?@kirya-dev commented on GitHub (Aug 6, 2020):
Want use this interface because all Expr has __toString()
@kirya-dev commented on GitHub (Aug 6, 2020):
They just build DQL expression
@greg0ire commented on GitHub (Aug 6, 2020):
I see, but we don't actually want to allow any
\Stringable, do we?@kirya-dev commented on GitHub (Aug 6, 2020):
Using \Stringable able create own DQL classes
@greg0ire commented on GitHub (Aug 6, 2020):
It's called
$allowedClassesso I guess you can't just use any class.@kirya-dev commented on GitHub (Aug 6, 2020):
PR here: https://github.com/doctrine/orm/pull/8227