-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Update AbstractFactory.php #1860
Conversation
Remove reflection from code!
Currently Magento is supports php from version 5.5, but as you mentioned in the comment your code is working only from php 5.6. But thanks you for contribution anyway. |
We should postpone merge of this PR till minimum supported version is PHP 5.6 |
We have automated a Magento Contributor License Agreement verifier for contributions sent to our GitHub projects. |
@vasiljok Can you check the CLA requirement please? |
Hello @vasiljok, are you still interested in this pull request? If yes, could you please sign the CLA agreement? |
Hello @KrystynaKabannyk I have signed CLA |
return $reflection->newInstanceArgs($args); | ||
// TODO:remove if after end support 5.5 version of php | ||
if (version_compare(phpversion(), '5.6.0', '>='))) { | ||
return new $type(... $args); // will work in PHP >= 5.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is invalid syntax for PHP < 5.6 so this will lead to fatal error. When minimal supported version of Magento became 5.6 this PR may be merged if last commit will be rolled back.
So since minimal supported PHP version became greater than 5.6 method body should contains only
return new $type(... $args);
Until that time there is no way to avoid reflection (any workaround will not have performance benefits)
This PR is obsoleted by #4766. /cc @vkublytskyi |
Remove reflection from code!