-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Promoted readonly properties are not respected #737
Promoted readonly properties are not respected #737
Comments
Be aware that this library is not compatible with PHP 8.1.0: there's still lots to be done to include 8.1.0 within the supported version range. |
In fact, 8.1.0 is explicitly excluded: Line 22 in 21e2b4a
|
In fact, I'm using https://github.com/FriendsOfPHP/proxy-manager-lts which allows everything above 7.1. They state that issues should be opened here, but I will cross post one there that references this issue. |
That project is literally "how to step on @Ocramius' face without any respect", so I really don't care about what they do |
@bobvandevijver to be clear, the issue you reported is very clear and very much in need of research (which I will do, once I have time - mostly focused on My previous comments is just a rant about the fact that these forks are generally irresponsible towards end users, so it makes me extremely angry (to the point that I skip working on the library due to my mood) every time they come up. |
@Ocramius Luckily I understood :) I am sincerely sorry to hear you feel this way, unfortunately not something I can directly influence as the fork is being forced by default by the Symfony framework in order to use lazy services, which is how I ended up here. I almost regret mentioning it as it clearly triggered you 😶 Anyways, I do hope you will find some time in the near future to bring full PHP 8.1 support to this library (I only just hit this issue and am using 8.1 already since the 8.1.1 release, so it feels like it mostly works fine already). Keep up the good work! 👍🏻 |
FYI I'm working on this at FriendsOfPHP/proxy-manager-lts#22 |
When using a promoted readonly only property in a class, this library will generate code that tries to change the readonly property and therefor breaking execution. Consider the following class (all have been stripped to only show the constructor):
will generate the following proxy:
and thus throw
Cannot unset readonly property App\Service\AbstractCacheableService::$features from scope ContainerXH6sJpc\SystemNotificationService_6ddbdeb
, caused by theunset($instance->features)
.Note that the same will also happen with the
systemNotificationRepository
andserializer
properties (unset($instance->systemNotificationRepository, $instance->serializer);
).The text was updated successfully, but these errors were encountered: