-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Check and update codebase to avoid fatal error for ReflectionType::isBuiltin() #34194
Comments
Hi @karyna-tsymbal-atwix. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento I am working on this |
@magento export issue to Jira project AC as Story |
❌ You don't have permission to export this issue. |
Preconditions (*)
In PHP 8, \ReflectionType has become abstract and ReflectionType::isBuiltin() has been moved to ReflectionNamedType::isBuiltin() .
Now, if $method->getReturnType() is called, it may return ReflectionNamedType (which has isBuiltin method) or ReflectionUnionType (which doesn't).
Details: https://www.php.net/manual/en/class.reflectiontype.php#reflectiontype.changelog
There are several places in the code where a construction like this is used:
$method->getReturnType()->isBuiltin()
and because of changes described it may cause Fatal error in some cases.
We need to check our codebase in all repositories and add an additional check to be sure that such fatal error will not occur.
Expected result (*)
Check and update the codebase to avoid fatal error when using ReflectionType::isBuiltin() method.
example of a possible fix:
https://github.com/magento/magento2/pull/34192/files#diff-d4ad1b0935431ef01f9f01309d7a3990f0eaef6c9bc0e0a52be4c6533ec7fefdR129
The text was updated successfully, but these errors were encountered: