mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #677] Type fix in ORM\PersistentCollection #8545
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?
Original Pull Request: https://github.com/doctrine/orm/pull/677
State: closed
Merged: No
The
ORM\PersistentCollectionclass accepts anything as 3rd argument to its constructor while it should be either array orCollectionobject. The$this->collphpdoc says that it's aCollectionwhile the constructor's phpdoc says it's an array.The class assumes
Collectionbut there isn't any type check at all. I have added conversion of array intoArrayCollectionin the constructor as in some (very unclear) cases it likes to die with a fatal error:Fatal error: Call to a member function add() on a non-object in Doctrine/ORM/PersistentCollection.php on line 169