Fatal Error : WC_Logger and LoggerInterface in PHP 8.0+
-
Greetings,
Since the last version of the plugin (v3.1), the class “WC_BPost_Shipping_Logger” extends WC_Logger and implements “LoggerInterface”.
However, in PHP 8.0+, WC_Logger not being compatible with “LoggerInterface” triggers a fatal error for each of its method:
PHP Fatal error: Declaration of WC_Logger::emergency($message, $context = []) must be compatible with Psr\Log\LoggerInterface::emergency(Stringable|string $message, array $context = []): void in .../wp-content/plugins/woocommerce/includes/class-wc-logger.php on line 180
To fix the issue, I can either set the return type for each method of WC_Logger, or remove the implementation of LoggerInterface in your plugin (which seems the best solution).
Can you take a look and fix the issue?
Thank you
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Fatal Error : WC_Logger and LoggerInterface in PHP 8.0+’ is closed to new replies.