'Function parameter description
I've been building a blog on Symfony and noticed something in my code.
This is my query builder and when I set these two min and max parameters, in this order
public function filterPostsByComment($minComments, $maxComments)
{
$qb = $this->createQueryBuilder('p')
->addSelect("c")
->leftJoin("p.comments", "c")
->where('SIZE(p.comments) > :minComments')
->andWhere('SIZE(p.comments) < :maxComments')
->setParameters(
array(
'minComments' => $minComments,
'maxComments' => $maxComments,
)
)
->orderBy('SIZE(p.comments)', 'DESC');
return $qb->getQuery()->getResult();
}
Here is how my function is shown:
But when I change the order where the max value is first in my query builder, I get the function parameters description like below:
public function filterPostsByComment($maxComments, $minComments)
{
$qb = $this->createQueryBuilder('p')
->addSelect("c")
->leftJoin("p.comments", "c")
->where('SIZE(p.comments) > :minComments')
->andWhere('SIZE(p.comments) < :maxComments')
->setParameters(
array(
'minComments' => $minComments,
'maxComments' => $maxComments,
)
)
->orderBy('SIZE(p.comments)', 'DESC');
return $qb->getQuery()->getResult();
}
So, is this a coding syntax or just the IDE bug?
Solution 1:[1]
I think I found what's wrong here.
Go to Settings > Editor > Inlay Hints > [PHP] and click on Exclude list...
There you will find (min*, max*) as exclusion. Edit as needed
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Justinas |



