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

Clears PHPCompatibility phpcs warnings #1919

Merged
merged 1 commit into from
Dec 29, 2020

Conversation

pschoffer
Copy link
Contributor

@pschoffer pschoffer commented Dec 18, 2020

Description

  • Switches func_get_args to spread operator
  • Ignores debug_backtrace warning
    Details bellow vvv

Changelog Description

Resolves PHPCompatibility phpcs warnings for PHP 7.4

The warnings were already reviewed previously and deemed false positive in this case.

However, we updated the implementation here to silence/resolve the warnings.

Checklist

Please make sure the items below have been covered before requesting a review:

  • This change works and has been tested locally (or has an appropriate fallback).
  • This change works and has been tested on a Go sandbox.
  • This change has relevant unit tests (if applicable).
  • This change has relevant documentation additions / updates (if applicable).
  • (For Automatticians) I've created a changelog draft.

Steps to Test

Add folowing code after logger was loaded (e.g. debug.php):

foreach( [1,2] as $ix) {
	lo("foo", "bar");
}

Running any request/CLI (e.g. wp post list) should then print foo and bar (only once as we are using lo - log once in the example).

Note:
In vip-dev environment, you might need to set a constant (as logs are not printed in prod environments):

define('WPCOM_SANDBOXED', true);

@pschoffer pschoffer requested a review from a team as a code owner December 18, 2020 12:33
* Switches func_get_args to spread operator
* Ignores debug_backtrace warning
@pschoffer pschoffer force-pushed the update/logger_php7.4_compatibility_warnings branch from 8fa0d30 to ee6903d Compare December 18, 2020 12:37
Copy link

@netsuso netsuso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me (and works for me)!

@brandon-m-skinner
Copy link
Contributor

The Changelog Description template isn't filled in and is just sitting at the bottom of the description. Please use the template 🙇.

@pschoffer pschoffer merged commit 93db653 into master Dec 29, 2020
@pschoffer pschoffer deleted the update/logger_php7.4_compatibility_warnings branch December 29, 2020 10:18
@pschoffer
Copy link
Contributor Author

Stacks-1314.

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.

3 participants