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

PHP8 Compatibility #3621

Open
dd32 opened this issue Sep 21, 2020 · 0 comments · May be fixed by #3622
Open

PHP8 Compatibility #3621

dd32 opened this issue Sep 21, 2020 · 0 comments · May be fixed by #3622

Comments

@dd32
Copy link

dd32 commented Sep 21, 2020

Do You Need Immediate Help?

No

Is This A Feature Request?

No

What Version Of Caldera Forms, WordPress and PHP Are You Using?

PHP8, Github develop branch.

What Is The Unexpected Behaviour?

  • PHP8 Linting fatal error, PHPCompatibility warnings.

What PHP Errors Have You Logged While Reproducing This Bug?

PHP8 is due for release on November 26th, running PHP8 Linting, and PHPCS PHPCompatility checks have revealed a few warnings for Caldera Forms:

includes/cf-pro-client/classes/api/local/files.php
  PHP Fatal error: Unparenthesized `a ? b : c ? d : e` is not supported.
      Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
      on line 48
FILE: caldera-forms/includes/cf-pro-client/classes/api/local/files.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 48 | 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
    |       | (PHPCompatibility.Operators.RemovedTernaryAssociativity.Found)
 49 | 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
    |       | (PHPCompatibility.Operators.RemovedTernaryAssociativity.Found)
----------------------------------------------------------------------


FILE: caldera-forms/classes/field/util.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 500 | ERROR | Function money_format() is deprecated since PHP 7.4
     |       | and removed since PHP 8.0; Use
     |       | NumberFormatter::formatCurrency() instead
     |       | (PHPCompatibility.FunctionUse.RemovedFunctions.money_formatDeprecatedRemoved)
----------------------------------------------------------------------


FILE: caldera-forms/classes/core.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1441 | ERROR | Function create_function() is deprecated since PHP
      |       | 7.2 and removed since PHP 8.0; Use an anonymous
      |       | function instead
      |       | (PHPCompatibility.FunctionUse.RemovedFunctions.create_functionDeprecatedRemoved)
----------------------------------------------------------------------

The errors in util.php and core.php are in deprecated code paths, but can probably be removed.

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

Successfully merging a pull request may close this issue.

1 participant