phpstan-doctrine
phpstan-doctrine copied to clipboard
Type infering breaks when groupBy omits table alias
See following example, not sure this is possible to support or not.
$query = $em->createQueryBuilder()
->addSelect('COUNT(m.id) AS count, m.intColumn')
->from(Many::class, 'm')
->join('m.one', 'o')
->groupBy('intColumn'); // m.intColumn works
assertType(
'array<array{count: int<0, max>|numeric-string, intColumn: int}>', // fails, is mixed
$query->getQuery()->getResult()
);
cc @arnaud-lb