mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Wrong return type for UnitOfWork::getOriginalEntityData #6683
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 @NicoHaase on GitHub (Apr 7, 2021).
In #8521, a new return type for
getOriginalEntityDatahas been introduced (see https://github.com/doctrine/orm/blob/2.8.x/lib/Doctrine/ORM/UnitOfWork.php#L2992).array<string, array<string, mixed>>does not look correct to me: when calling that method, it returnsarray<string, mixed>@greg0ire commented on GitHub (Apr 7, 2021):
I think you are correct. Can you please send a PR against 2.8.x?
It looks like I have blindly copied the annotation for the property:
5ac036de02/lib/Doctrine/ORM/UnitOfWork.php (L149-L151)@NicoHaase commented on GitHub (Apr 7, 2021):
@greg0ire I've linked a PR. What surprises me: I've adjusted the annotation, but nothing else. Is this such a special case that no code in the testsuite calls this method? I had expected that I also had to change other things anywhere else in the code
@tjveldhuizen commented on GitHub (Apr 7, 2021):
The tests directory is not analyzed by PHPStan, and PHPUnit does not do anything with the annotations. So it doesn't surprise me that it was not discovered before.
@NicoHaase commented on GitHub (Apr 7, 2021):
The annotation I've changed is not part of any test directory
@tjveldhuizen commented on GitHub (Apr 7, 2021):
But if the method where the annotation relates to is used in a test (which it doe, I assume), PHPStan would analyze it if it would analyse the tests.
@greg0ire commented on GitHub (Apr 7, 2021):
I think the actual reason is that we run Psalm and PHPstan at a too lenient level for them to detect this ATM:
2a87821b28/phpstan.neon (L2)2a87821b28/psalm.xml (L3)If you want to work on this, be my guest 🙂