-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Description
Since a recent release of the Psalm-doctrine plugin (psalm/psalm-plugin-doctrine#115) the following code conflicts with Phpstan.
Can the new TKey parameter also be supported by the phpstan-docrine plugin? It looks like Psalm is more correct here.
Code:
/** @var Query<array-key, Country> $query */
$query = $this->createQueryBuilder('country')->getQuery();Without TKey (/** @var Query<Country> $query */) produces the following error in Psalm:
psalm: InvalidTemplateParam: Extended template param TKey of Doctrine\ORM\Query<App\Entity\Country\Country> expects type array-key, type App\Entity\Country\Country given
psalm: MissingTemplateParam: Doctrine\ORM\Query has missing template params, expecting 2
With TKey (/** @var Query<array-key, Country> $query */) procesed the following error in PHPStan:
phpstan: Generic type Doctrine\ORM\Query<(int|string), App\Entity\Country\Country> in PHPDoc tag @var for variable $query specifies 2 template types, but class Doctrine\ORM\Query supports only 1: TResult
Metadata
Metadata
Assignees
Labels
No labels