-
Notifications
You must be signed in to change notification settings - Fork 998
Closed
Description
The following test fails on PHP 8.
Error: Callable ["Foo_Class","foo"] does not exist, and cannot be registered as `wp foo`.
cwd: /var/folders/7d/mcmynw4x60v3y8nwlfz3ppg80000gn/T/wp-cli-test-run-command.feature.188-5fac2916853fc6.79146154/
run time: 0.10461497306824
exit status: 1
In step `When I run `wp --require=custom-cmd.php help`'. # vendor/wp-cli/wp-cli-tests/features/steps/when.php:29
From scenario `Use a class method as a command'. # features/command.feature:188
Of feature `WP-CLI Commands'. # features/command.feature
This looks to be because PHP 8 no longer considers that callable if the method isn't static.
I think the fix here would be adjusting the test in WP_CLI::add_command
and Dispatcher\CommandFactory::create
.
Are static methods supported as command callbacks?
schlessera