-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
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
Create ReflectionReadonlyProperty
from their declaring class so their value can be set
#10666
Create ReflectionReadonlyProperty
from their declaring class so their value can be set
#10666
Conversation
c30d469
to
f2e335a
Compare
You can keep the entity classes and functional tests in a single file, other tests do this as well. Personally, I find it much easier to understand tests when everything is in a single place. |
Done; how can I make the CI green for PHP < 8.1? |
200cb89
to
2261433
Compare
2261433
to
6a3c091
Compare
6a3c091
to
181460b
Compare
Okay I followed #10683 (comment) Not sure about the naming though, feel free to suggest. |
181460b
to
b5647c5
Compare
tests/Doctrine/Tests/ORM/Functional/Ticket/GH10049/SetInheritedReadOnlyPropertyValueTest.php
Outdated
Show resolved
Hide resolved
tests/Doctrine/Tests/ORM/Functional/Ticket/GH10049/SetInheritedReadOnlyPropertyValueTest.php
Outdated
Show resolved
Hide resolved
tests/Doctrine/Tests/ORM/Functional/Ticket/GH10049/SetInheritedReadOnlyPropertyValueTest.php
Outdated
Show resolved
Hide resolved
c3d6594
to
1c8d296
Compare
Sorry when I caused too much confusion by asking for keeping everything in a single file 👌🏻 |
No worries, in the end it resulted in a better directory layout for tests IMO. |
1c8d296
to
2f46e5a
Compare
Thanks @MatTheCat ! |
Fixes #10049 and supersedes #10059.
I must have missed an RFC because from https://wiki.php.net/rfc/readonly_properties_v2#reflection
But that does not seem to be the case. This makes
ReflectionReadonlyProperty::setValue()
crash when hydrating an inherited readonly property.This PR makes
ClassMetadataInfo
buildReflectionReadonlyProperty
with a property whose class is its declaring one to avoid this issue.