Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix PHP deprecation warnings#5897

Merged
swissspidy merged 1 commit into
wp-cli:mainwp-cli/wp-cli:mainfrom
christianwach:warningchristianwach/wp-cli:warningCopy head branch name to clipboard
Feb 6, 2024
Merged

Fix PHP deprecation warnings#5897
swissspidy merged 1 commit into
wp-cli:mainwp-cli/wp-cli:mainfrom
christianwach:warningchristianwach/wp-cli:warningCopy head branch name to clipboard

Conversation

@christianwach

@christianwach christianwach commented Feb 6, 2024

Copy link
Copy Markdown
Contributor

Please see #5896 for details and code to replicate.

tl;dr In versions of PHP greater than 8.1.x, when WP_CLI::error() and WP_CLI::halt() are called in a separate command via WP_CLI::runcommand(), then PHP Deprecated notices are written to the logs. Passing an empty string is compatible with the signature of the Exception constructor and avoids the warnings.

Edit: since there are no functional changes in this PR, I haven't included tests.

@christianwach christianwach requested a review from a team as a code owner February 6, 2024 19:48
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 this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.