-
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
[PHP 7.1 Compatibility] Void became a reserved word #8609
[PHP 7.1 Compatibility] Void became a reserved word #8609
Conversation
@@ -34,7 +34,7 @@ class ActionList | |||
'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'instanceof', | |||
'insteadof','interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected', | |||
'public', 'require', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', | |||
'while', 'xor', | |||
'while', 'xor', 'void', |
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.
@antonkril why do we even need such check instead of simple fallback to a VoidAction
in case Void
class is not available?
@okobchenko when can we expect this in a release? Thank you |
@orlangur thank you for your contribution. |
Any fix on this for 2.1.9.? Im getting the same problem with Void word. |
@lucasvm |
Hello, I'm using magento 2.2.2, and still get this error when running php bin/magento setup:di:compile `app@b585e061527e:~/html$ bin/magento setup:di:compile Compilation was started. Repositories code generation... 1/7 [====>-----------------------] 14% 4 secs 46.0 MiB Fatal error: Cannot use 'Void' as class name as it is reserved in /var/www/html/vendor/magento/module-sales/Controller/Adminhtml/Order/Creditmemo/Void.php on line 10` |
@bellodaniel please check if contents of this file in your instance correspond to changes in this PR, probably upgrade to 2.2.2 was unsuccessful somehow in your case, clearing |
Before this change
Creditmemo > Void
andInvoice > Void
actions in Admin UI had no chance to work under PHP 7.1 as "void" became a reserved word.Unit and static tests are now able to complete on Travis CI under PHP 7.1: https://travis-ci.org/orlangur/magento2/builds/203260140 (this temporary branch includes #7688 changes).
Corresponding PHPCS sniff is expanded with new reserved words and executed against full codebase.
Before: https://travis-ci.org/orlangur/magento2/jobs/203213045
After: https://travis-ci.org/orlangur/magento2/jobs/203230641