woocommerce / wc-smooth-generator

Smooth product, customer and order generation for WooCommerce
315 stars 49 forks source link

[PHP 8] Make the methods in the CLI class static #39

Closed Konamiman closed 4 years ago

Konamiman commented 4 years ago

Methods in the CLI class are registered using WP_CLI::add_command, passing array('WC\SmoothGenerator\CLI', 'method') as callbacks. This kind of callback is not supported in PHP 8 when the method is not static, as per the upgrading guide:

Removed ability to call non-static methods statically. Thus is_callable will fail when checking for a non-static method with a classname (must check with an object instance).

The fix consists of simply making these methods static, which semantically they are already anyway.