-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix fatal error when OPCache preloading is used #13709
Fix fatal error when OPCache preloading is used #13709
Conversation
The build is red but I don't think it's related to these changes. |
Which was removed in Symfony 5.
6c52a8e
to
1b555f9
Compare
Hey @mmenozzi! I finally tried to reproduce this issue and it occurs with PHP 8.0, but not with PHP 8.1. @Sylius/core-team I would like to see more opinions on this. |
I was also able to encounter this problem on ex. on Sylius-Standard.
From my perspective preloading provide value in production. If Symfony 4 is not supported anymore by Sylius and the class |
Thank you @Ferror this is exactly what I think. |
Removing the reference to that interface will mitigate the problem at hand. |
Yes I agree it could be useful to have a test for that but I think it should be done in a separate PR. Note also that there's already a kind of test: it's PHPStan/psalm. |
Sure, I was also thinking of a separate PR. Psalm/PHPStorm will probably be enough for Sylius code, but another issue might be coming from it's 3rd party dependencies. |
@mmenozzi are you willing to do the PR with testing for it? |
Thank you, Manuele! 🥇 |
@lchrusciel do you have any idea on how to test it? AFAIK the preload is done only in the |
While in Symfony 5 the
Symfony\Bundle\FrameworkBundle\Templating\EngineInterface
was removed, in Sylius there were still references to that interface in docblock comments.With Sylius 1.11 (with this commit) the type hint has been promoted to a PHP type hint. This normally does not cause any problem because apparently the class loading is lazy and does not try to load the non-existent interface.
But if PHP OPCache preload is used, like suggested here, it appears that PHP switches to eager class loading and you get the following fatal error:
With this PR we propose to remove all references to the old interface as Symfony 4 is not supported anymore by Sylius.