[PR #11389] Fix psalm errors: remove override of template type #12990

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

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

State: closed
Merged: Yes


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.

**Original Pull Request:** https://github.com/doctrine/orm/pull/11389 **State:** closed **Merged:** Yes --- 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.
admin added the pull-request label 2026-01-22 16:15:48 +01:00
admin closed this issue 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#12990