-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Psalm annotations ArrayCollection->contains() incorrect #368
Comments
annervisser
added a commit
to annervisser/collections
that referenced
this issue
May 8, 2023
The override of this template type causes Psalm to throw an error whenever contains is called: https://psalm.dev/r/a2f9439bd2 Removing the extra type works as expected: https://psalm.dev/r/de5f58d52f Fixes doctrine#368
annervisser
added a commit
to annervisser/collections
that referenced
this issue
May 11, 2023
The override of this template type causes Psalm to throw an error whenever contains is called: https://psalm.dev/r/a2f9439bd2 Removing the extra type works as expected: https://psalm.dev/r/de5f58d52f Fixes doctrine#368
Hey, |
Sure, done. 🙂 |
tantegerda1
added a commit
to tantegerda1/orm
that referenced
this issue
Mar 20, 2024
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. We should either not define @template TMaybeContained or re-define the psalm docblock from ReadableCollection completely.
tantegerda1
added a commit
to tantegerda1/orm
that referenced
this issue
Mar 20, 2024
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
added a commit
to tantegerda1/orm
that referenced
this issue
Mar 20, 2024
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
added a commit
to tantegerda1/orm
that referenced
this issue
Mar 21, 2024
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.
tantegerda1
added a commit
to tantegerda1/orm
that referenced
this issue
Mar 21, 2024
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.
tantegerda1
added a commit
to tantegerda1/orm
that referenced
this issue
Mar 21, 2024
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.
tantegerda1
added a commit
to tantegerda1/orm
that referenced
this issue
Mar 22, 2024
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ArrayCollection->contains()
defines a psalm template forTMaybeContained
but does not define a param and return-type for that template. This gives the following psalm error:Psalm.dev example:
https://psalm.dev/r/aae16c4dc8
ArrayCollection
either needs to not define@template TMaybeContained
or re-define the psalm docblock fromReadableCollection
completely.ArrayCollection->indexOf()
re-defines all psalm docblocks and works correctly because of that.The text was updated successfully, but these errors were encountered: