You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The WooCommerce logging interface module attempt to use Psr\Log\LoggerTrait with invalid interface. The classes WooCommerceLogger and NullLogger both implement Psr\Log\LoggerInterface and declare the log function without a function return type.
The solution is to include the return type for the log functions which is supposed to be void.
To Reproduce
Install and activate plugin
See error
Screenshots
Expected Behavior
Plugin activated, no errors.
Actual Behavior
Error message Fatal error: Declaration of WooCommerce\WooCommerce\Logging\Logger\WooCommerceLogger::log($level, $message, array $context = []) must be compatible with Psr\Log\LoggerTrait::log($level, Stringable|string $message, array $context = []): void
Environment
WordPress Version 6.2.2
WooCommerce Version 7.9.0
Plugin Version 2.2.0
Roots Bedrock
The text was updated successfully, but these errors were encountered:
InpsydeNiklas
changed the title
Logger interface incompatible with Psr\Log\LoggerTrait:log()
Logger interface incompatible with Psr\Log\LoggerTrait:log() (968)
Jul 18, 2023
Hi @areklam, thanks for the issue & PR.
However, psr/logversion 3.0.0 supports only php >=8.0.0 and the declaration of arguments are using “Union types”, as seen here. PayPal Payments supports PHP 7.2, so it cannot be made compatible with this at this time. This means the primary suggestion would be to downgrade this library in your theme, while the development team is investigating other ways to improve the compatibility with third-party plugins/themes that use a newer psr/log version.
Hi, using Sword (Bedrock-like for Symfony) this error makes it impossible to use this plugin as well.
Maybe it's too late at this stage of development, but an option would be to prefix namespaces with https://github.com/typisttech/imposter-plugin so there's no conflict to external plugins or apps.
Describe the Bug
The WooCommerce logging interface module attempt to use
Psr\Log\LoggerTrait
with invalid interface. The classesWooCommerceLogger
andNullLogger
both implementPsr\Log\LoggerInterface
and declare the log function without a function return type.The solution is to include the return type for the log functions which is supposed to be void.
To Reproduce
Screenshots
Expected Behavior
Plugin activated, no errors.
Actual Behavior
Error message
Fatal error: Declaration of WooCommerce\WooCommerce\Logging\Logger\WooCommerceLogger::log($level, $message, array $context = []) must be compatible with Psr\Log\LoggerTrait::log($level, Stringable|string $message, array $context = []): void
Environment
The text was updated successfully, but these errors were encountered: