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.4] left-associativity of the ternary operator has been deprecated in resource update controller #14655

Open
Mark-H opened this issue Aug 2, 2019 · 0 comments

Comments

@Mark-H
Copy link
Collaborator

commented Aug 2, 2019

Bug report

Summary

Potential PHP 7.4/8.0 compatibility issue in the resource/update controller.

Step to reproduce

Static analysis run on the core with phpcs/phpcompatibility for 7.4

Observed behavior

https://github.com/modxcms/revolution/blob/2.x/manager/controllers/default/resource/update.class.php#L127-L129

FILE: manager/controllers/default/resource/update.class.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 128 | ERROR | The left-associativity of the ternary operator has been deprecated in PHP 7.4 and removed in PHP 8.0. Multiple consecutive ternaries detected. Use
     |       | parenthesis to clarify the order in which the operations should be executed
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Expected behavior

Code could definitely be clarified and fixing the warning would be a good bonus.

Environment

PHP 7.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.