szepeviktor/phpstan-wordpress

WP_CLI::error() doesn't always terminate

Opened this issue · 2 comments

The WP_CLI::error() method is marked as an early terminating method, but it doesn't terminate if the $exit parameter is set to false.

Its entry in the earlyTerminatingMethodCalls config should be removed and replaced with something else that's conditional, but I'm not sure what.

I tell you not to use that $exit parameter.
Just like

- Do not enable `exit_error` in `WP_CLI::launch` or `WP_CLI::runcommand` to keep your code testable

It feels really-really bad to handle these parts of WordPress.
That is all I could contribute.