Skip to content
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

[PHPDoc] Parameter #4 of method QueryBuilder::innerJoin() expects string|null, Func given. #8151

Open
soullivaneuh opened this issue May 19, 2020 · 1 comment

Comments

@soullivaneuh
Copy link

soullivaneuh commented May 19, 2020

Bug Report

Q A
BC Break no
Version v2.7.2

Summary

The QueryBuilder::innerJoin does not expect Doctrine\ORM\Query\Expr\Func #4 parameter type according to the PHPDoc.

This typing should be added for a stronger typing and to make tools like PHPStan happier.

Current behavior

PHPStan error:

Parameter #4 $condition of method Doctrine\ORM\QueryBuilder::innerJoin() expects string|null, Doctrine\ORM\Query\Expr\Func given.

How to reproduce

Related code producing the error (currently working properly):

$qb = $this->getRepository(PowerDNSRecord::class)->createQueryBuilder('r');
$qb->innerJoin('r.domain', 'd', Expr\Join::WITH, $qb->expr()->in('d.name', ':domains'))
    ->select('d.name, r.content, r.type')
    ->where($qb->expr()->in('r.type', ':types'))
    ->andWhere('r.name = d.name')
    ->setParameters(['domains' => $hostings, 'types' => ['A', 'AAAA']])
;

Expected behavior

Everything should be ok as the method works with a func.

@soullivaneuh soullivaneuh changed the title [PHPDoc] Parameter #4 of method Doctrine\ORM\QueryBuilder::innerJoin() expects st ring|null, Doctrine\ORM\Query\Expr\Func given. [PHPDoc] Parameter #4 of method QueryBuilder::innerJoin() expects st ring|null, Func given. May 19, 2020
@soullivaneuh soullivaneuh changed the title [PHPDoc] Parameter #4 of method QueryBuilder::innerJoin() expects st ring|null, Func given. [PHPDoc] Parameter #4 of method QueryBuilder::innerJoin() expects string|null, Func given. May 19, 2020
@najmi9
Copy link

najmi9 commented Jan 30, 2021

The same problem, any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants