Skip to content

Fix PHP deprecation warnings #5897

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

Merged
merged 1 commit into from
Feb 6, 2024
Merged

Conversation

christianwach
Copy link
Contributor

@christianwach christianwach commented Feb 6, 2024

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