Open
Description
this commit 149cf71 makes the correct getResult
return type if the method within the class, but it does not work if the query builder comes from a trait
trait MyTrait
{
protected function getCustomQueryBuilder() {
return $this->createQueryBuilder('t')
->andWhere('t.enabled = true');
}
}
class MyRepository
{
use MyTrait;
public function findBySomething(): array
{
$qb = $this->getCustomQueryBuilder()
->andWhere('t.someInt = 1');
return $qb->getQuery()->getResult();
}
getting this error
Method App\Repository\MyRepository::findBySomething() should return
array<App\Entity\MyEntity> but returns mixed.
Metadata
Metadata
Assignees
Labels
No labels