profile-command icon indicating copy to clipboard operation
profile-command copied to clipboard

Dynamic property warnings in `Logger` class on PHP 8.2

Open swissspidy opened this issue 2 years ago • 0 comments

Bug Report

Describe the current, buggy behavior

When running tests locally on PHP 8.2 (and with SQLite) I am getting the following errors:

Deprecated: Creation of dynamic property WP_CLI\Profile\Logger::$stage is deprecated in src/Logger.php on line 31

It's because of calls like $logger = new Logger( array( 'stage' => 'bootstrap' ) );. The Logger then tries to set the stage property that doesn't exist.

Describe how other contributors can replicate this bug

Run tests on PHP 8.2

I don't know why these warnings are not surfaced on CI. Is it a bug with our test suite? Error reporting disabled?

Describe what you would expect as the correct outcome

No

Let us know what environment you are running this on

(Paste the output of "wp cli info" into this box)

Provide a possible solution

If you happen to have a suggestion on how to fix this bug, please tell us in here.

Just leave this section out if you don't know how to fix it.

Provide additional context/Screenshots

Add any other context about the problem here.

If applicable, add screenshots to help explain (you can just drag&drop images into the Github issue).

swissspidy avatar Oct 22 '23 09:10 swissspidy