mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
PersistentCollection::removeElement() returns object or NULL instead of boolean #5071
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 @holtkamp on GitHub (Mar 29, 2016).
Originally assigned to: @alcaeus on GitHub.
When using strict typing in PHP 7.0.4:
declare (strict_types = 1);, I noticed that an error is returned for userland code likeThis results in an error message like:
I had a look at all
removeElement()functions used in the project and I suspect this sectionWill try to come up with a test but already wanted to register this issue so I will not forget it.
UPDATE
It appears that this can be tested in ExtraLazyCollectionTest::testRemoveElementManyToMany():
However, this made me wonder, why does this part returns
NULLwhile the Collection interface indicates it should return aboolean? Is returning the element/null on purpose?@holtkamp commented on GitHub (Jul 12, 2017):
Anything else I can do to resolve this issue?
@Ocramius commented on GitHub (Jul 13, 2017):
@holtkamp see #6550