We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
vimeo/psalm 4.8.1 weirdan/doctrine-psalm-plugin 1.0.0
/** @param Collection<int, A>|Collection<int, B> */ public function deleteItemById(Collection $collection, int $id): void { $matchedItems = $collection->filter( static function ($inCollectionItem) use ($id): bool { return $inCollectionItem->haveId($id); } ); if (!$matchedItems->isEmpty()) { $collection->removeElement($matchedItems->first()); // yields PossiblyInvalidArgument } }
psalm: PossiblyInvalidArgument: Argument 1 of Doctrine\Common\Collections\Collection::removeElement expects A, possibly different type A|B provided
It looks false-positive to me, it's impossible to call here Collection<int, A>::removeElement(B).
Collection<int, A>::removeElement(B)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
vimeo/psalm 4.8.1
weirdan/doctrine-psalm-plugin 1.0.0
psalm: PossiblyInvalidArgument: Argument 1 of Doctrine\Common\Collections\Collection::removeElement expects A, possibly different type A|B provided
It looks false-positive to me, it's impossible to call here
Collection<int, A>::removeElement(B)
.The text was updated successfully, but these errors were encountered: