[PR #11385] Fix psalm errors: remove override of template type #12988

Open
opened 2026-01-22 16:15:48 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/11385

State: closed
Merged: No


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

The issue happens when using ->contains(). Running psalm emits

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.

**Original Pull Request:** https://github.com/doctrine/orm/pull/11385 **State:** closed **Merged:** No --- See https://github.com/doctrine/collections/issues/368 for the same issue in doctrine/collections which has been fixed there. The issue happens when using `->contains()`. Running psalm emits > 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.
admin added the pull-request label 2026-01-22 16:15:48 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#12988