mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #10059] Fix setting readonly properties in different scopes #12064
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/10059
State: closed
Merged: No
Looks like #10049 can be fixed like this, it simply uses the described method from the RFC by changing the scope to the declaring class.
It will only be executed if the
isReadOnly-method is present, this will also check if PHP is 8.1 or higher, I am not sure if there is any performance impact on this.As I described in the
tests/Doctrine/Tests/ORM/Functional/Ticket/GH10049Mocks.phpfile, it is required to have them outside, otherwise, the file will be fully parsed by PHP 7.4 and will throw an error because the keywordreadonlyis new and not backwards compatible.Fixes: #10049