-
Notifications
You must be signed in to change notification settings - Fork 112
Closed
phpstan/phpstan-src
#1692Description
With the recent addition of literal-types to QueryBuilder (#327), I'm getting warnings when passing class-string there: Parameter #1 $from of method Doctrine\ORM\QueryBuilder::from() expects literal-string, class-string given
This is the simplified example to reproduce the issue:
/**
* @param class-string $className
*/
public function getSortable(
string $className,
): ?Sortable
{
return $this
->entityManager
->createQueryBuilder()
->select('sortable')
->from($className, 'sortable')
->getQuery()
->getOneOrNullResult();
}What is do you think is the correct way to handle this? To me it seems that class-string is more specific type than the literal-string.
Metadata
Metadata
Assignees
Labels
No labels