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

[PHP 7.1 Compatibility] Void became a reserved word #8609

Merged

Conversation

orlangur
Copy link
Contributor

@orlangur orlangur commented Feb 20, 2017

Before this change Creditmemo > Void and Invoice > 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

@@ -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',
Copy link
Contributor Author

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?

@okorshenko okorshenko self-assigned this Feb 21, 2017
@okorshenko okorshenko added this to the February 2017 milestone Feb 21, 2017
@mmansoor-magento mmansoor-magento merged commit 1b5e028 into magento:develop Feb 22, 2017
@csdougliss
Copy link
Contributor

@okobchenko when can we expect this in a release? Thank you

@orlangur orlangur deleted the php71-compatibility-void-keyword branch February 22, 2017 09:43
@okorshenko
Copy link
Contributor

@orlangur thank you for your contribution.
@craigcarnell this fix will be a part of 2.2.0 release

@lucasvm
Copy link

lucasvm commented Oct 12, 2017

Any fix on this for 2.1.9.? Im getting the same problem with Void word.

@orlangur
Copy link
Contributor Author

@lucasvm 2.1.x is not going to become PHP 7.1 compatible, please stick to PHP 7.0 until you have a chance to upgrade Magento.

@bellodaniel
Copy link

bellodaniel commented May 3, 2018

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`

@orlangur
Copy link
Contributor Author

orlangur commented May 8, 2018

@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 vendor folder and running composer install should help.

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

Successfully merging this pull request may close these issues.

7 participants