-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
| Q | A |
|---|---|
| Version | 4.3.4/3.10.1 |
Summary
Doctrine\DBAL\Query\Join class does not support CompositeExpression.
Current behavior
When having code similar to:
$query->innerJoin(
'r',
'rule',
'rt',
$query->expr()->and(
$query->expr()->eq('r.id', 'rt.rule_id'),
$query->expr()->eq('r.status', 'rt.status'),
),
)I'm getting the error Doctrine\DBAL\Query\QueryBuilder::innerJoin(): Argument #4 ($condition) must be of type ?string, Doctrine\DBAL\Query\Expression\CompositeExpression given
It seems that join/innerJoin/leftJoin/rightJoin methods do not support CompositeExpression class. Is there are reason for that behaviour?
Expected behavior
I expect this snippet to work fine. It works in 3.10.x because there are no typehints, but PHPStan emits an error nevertheless due to PHPDoc types.
How to reproduce
Just use a join with a condition expression that returns a CompositeExpression like and().