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

Address some PHP 8.1 deprecation notices#5658

Merged
danielbachhuber merged 2 commits into
masterwp-cli/wp-cli:masterfrom
fix/5623-deprecation-noticeswp-cli/wp-cli:fix/5623-deprecation-noticesCopy head branch name to clipboard
Jul 28, 2022
Merged

Address some PHP 8.1 deprecation notices#5658
danielbachhuber merged 2 commits into
masterwp-cli/wp-cli:masterfrom
fix/5623-deprecation-noticeswp-cli/wp-cli:fix/5623-deprecation-noticesCopy head branch name to clipboard

Conversation

@swissspidy

Copy link
Copy Markdown
Member

Ensure Runner::find_wp_root() always returns a directory

According to the docblock, the method is supposed to default to the current working dir, but in reality it could return null if nothing was found.

This breaks other methods like ::set_wp_root() which expect a string.

Prevents PHP deprecation notices because null was passed to realpath().

Handle null values in trailingslashit util

Prevents PHP deprecation notices when inadvertently passing null to the function and thus rtrim.

According to the docblock, the method is supposed to default to the current working dir, but in reality it could return `null` if nothing was found.

This breaks other methods like `::set_wp_root()` which expect a string.

Prevents PHP deprecation notices because `null` was passed to `realpath()`.
Prevents PHP deprecation notices when inadvertently passing `null` to the function and thus `rtrim`.
@swissspidy swissspidy requested a review from a team as a code owner July 18, 2022 13:01
@danielbachhuber danielbachhuber added this to the 2.7.0 milestone Jul 28, 2022
@danielbachhuber danielbachhuber merged commit f3e4b07 into master Jul 28, 2022
@danielbachhuber danielbachhuber deleted the fix/5623-deprecation-notices branch July 28, 2022 15:10
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.

2 participants

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