Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix psalm errors: remove override of template type #11389

Merged
merged 1 commit into from Mar 23, 2024

Conversation

tantegerda1
Copy link
Contributor

See doctrine/collections#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
Copy link
Contributor Author

Recreation of PR #11385 onto proper target branch 2.19.x as per #11208 How to choose the right branch.

@derrabus
Copy link
Member

Psalm is failing.

See doctrine/collections#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.

Solution: we should either not define @template TMaybeContained or
re-define the complete psalm docblock from ReadableCollection.

Repairing the docblock necessitates an update to the psalm baseline:
one "known issue" is no longer an issue and thus removed.
@greg0ire greg0ire added this to the 2.19.4 milestone Mar 23, 2024
@greg0ire greg0ire merged commit 6090141 into doctrine:2.19.x Mar 23, 2024
58 checks passed
@greg0ire
Copy link
Member

Thanks @tantegerda1 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants