Compatibility with PSR-3 logging
-
This may not (yet) be a solvable problem but I wanted to share this…
The Flexible Shipping plugin uses the standard PSR-3 logger interface (https://www.php-fig.org/psr/psr-3/). It uses version 1 of PSR-3 that is compatible with PHP v7.
A problem can arise if another plugin is using PSR-3 version 2 or 3 and loads the logger after Flexible Shipping has loaded version 1. The resulting error will be something like:
Declaration of Logger::emergency(Stringable|string $message, array $context = []) must be compatible with Psr\Log\LoggerInterface::emergency($message, array $context = [])The problem is with type hinting in the function signatures in v2 & v3 that don’t exist in v1. The fix is to use PSR-3 version 3 but that is not compatible with PHP v7.
- You must be logged in to reply to this topic.