-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
WP_CLI::error() doesn't always terminate #213
Comments
I tell you not to use that Line 119 in f7ff091
It feels really-really bad to handle these parts of WordPress. |
a conditional return type using https://phpstan.org/writing-php-code/phpdoc-types#bottom-type in stubs might work 🤔 https://phpstan.org/r/cf63373b-41ba-4298-9639-26051d6eb5fb |
Why is |
Stubs are not PHPStan extensions. |
Of course, but this could be handled quite easily with a conditional return type. Simply add a file, e.g., class WP_CLI
{
/**
* @return ($exit is true|int<1, max> ? never : void)
*/
public static function error($message, $exit = true)
{
}
} and instruct users to add it to |
The
WP_CLI::error()
method is marked as an early terminating method, but it doesn't terminate if the$exit
parameter is set tofalse
.Its entry in the
earlyTerminatingMethodCalls
config should be removed and replaced with something else that's conditional, but I'm not sure what.The text was updated successfully, but these errors were encountered: