doctrine / orm

Doctrine Object Relational Mapper (ORM)
https://www.doctrine-project.org/projects/orm.html
MIT License
9.86k stars 2.5k forks source link

Fix psalm errors: remove override of template type #11389

Closed tantegerda1 closed 3 months ago

tantegerda1 commented 3 months ago

See https://github.com/doctrine/collections/issues/368 for the same issue in doctrine/collections which has been fixed there.

The issue happened when using ->contains(). Running psalm emitted

InvalidArgument - Argument 1 of Doctrine\ORM\PersistentCollection::contains expects TMaybeContained:fn-doctrine\common\collections\readablecollection::contains as mixed, but … provided.

We should either not define @template TMaybeContained or re-define the psalm docblock from ReadableCollection completely.

Repairing the docblock necessitates an update to the psalm baseline: one "known issue" is no longer an issue and could thus be removed.

tantegerda1 commented 3 months ago

Recreation of PR https://github.com/doctrine/orm/pull/11385 onto proper target branch 2.19.x as per #11208 How to choose the right branch.

derrabus commented 3 months ago

Psalm is failing.

greg0ire commented 3 months ago

Thanks @tantegerda1 !