mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Typehint change in UniteOfWork::gettScheduledCollection* couses phpstan to fail after v2.8.3 #6681
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mmarton on GitHub (Apr 6, 2021).
Hi!
In the UnitOfWork class getScheduledCollectionUpdates and getScheduledCollectionDeletions methods got new return typehints:
@psalm-return array<string, Collection<array-key, object>>I think this should be
@psalm-return array<string, PersistentCollection<array-key, object>>as every time when a ScheduledCollection item is set it is explicitly checked for PersistentCollection. (like https://github.com/doctrine/orm/blob/2.8.x/lib/Doctrine/ORM/UnitOfWork.php#L775 and https://github.com/doctrine/orm/blob/2.8.x/lib/Doctrine/ORM/UnitOfWork.php#L898)Because of this change phpstan fails on my eventsubscriber with:
I know I can manually typehint it to PersistentCollection, and I'm doing it right now. Just wanted to report this.
@mmarton commented on GitHub (Oct 2, 2024):
no longer relevant / got fixed sometime