Address some PHP 8.1 deprecation notices by swissspidy · Pull Request #5658 · wp-cli/wp-cli

added 2 commits

July 18, 2022 14:55
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`.

danielbachhuber