Skip to content
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

Closed
karyna-tsymbal-atwix opened this issue Sep 29, 2021 · 4 comments

Comments

@karyna-tsymbal-atwix
Copy link
Contributor

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

@m2-assistant
Copy link

m2-assistant bot commented Sep 29, 2021

Hi @karyna-tsymbal-atwix. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 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

@karyna-tsymbal-atwix
Copy link
Contributor Author

@magento I am working on this

@xmav
Copy link
Contributor

xmav commented Sep 29, 2021

@magento export issue to Jira project AC as Story

@github-jira-sync-bot
Copy link

❌ You don't have permission to export this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

4 participants