-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Incompatible with PHP 8.1 #16
Comments
Closing because Ocramius/ProxyManager#737 is enough |
@nicolas-grekas Actually, I do not agree with the other issue being enough. This library promotes itself as being compatible with a broader PHP range, while it currently isn't compatible with PHP 8.1. That is a clear and important issue for this project. The library it is based on explicitly doesn't support PHP 8.1 at this time, so either work must be put in this library to add support (and hopefully to be backported to the upstream as well) or it should be marked as incompatible with PHP 8.1 because it is. With Symfony requiring PHP 8.1 starting from 6.1, the proxy-manager-bridge will be broken as well... |
The fix for this issue should land in ocramius/proxy-manager. Once it will land there, I'll sync this fork, as I always do when a new release of ocramius/proxy-manager happens. As such, there is no need to keep track of this specific issue here. |
In its current state, this library does not work fully with PHP 8.1. 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);
).Also posted at Ocramius/ProxyManager#737.
The text was updated successfully, but these errors were encountered: