Open ronnyadsetts opened 2 years ago
@ronnyadsetts might you have done a composer install that ignores dependencies? The return types were only introduced in psr/log 3.0.0 and most Magento modules (we're on v2.4.3-p2) explicitly require psr/log v1 or v2 - so our composer install selected monolog v1.27.0 which has no return types defined.
@johnorourke I don't think I've ignored dependencies. I'm not a Magento guro by any means though so...
Anyway, this is Magento 2.4.4. Composer shows this for monolog:
$ composer why monolog/monolog magento/framework 103.0.4 requires monolog/monolog (^2.3) magento/magento2-base 2.4.4 requires monolog/monolog (^2.3) magento/magento2-functional-testing-framework 3.9.0 requires monolog/monolog (^2.3) magento/product-community-edition 2.4.4 requires monolog/monolog (^2.3) swissup/module-marketplace 1.9.7 requires monolog/monolog (*)
$ composer show monolog/monolog | grep ^version versions : * 2.7.0
git blame shows that the explicit return types were added for version 2.0.0:
https://github.com/Seldaek/monolog/commit/a5876bed1d0f49770acd35feceae3388480b6c55
@ronnyadsetts ahh, that explains it - we haven't tackled 2.4.4 yet! Hopefully the @PaymentsenseDevs will get on it then.
@johnorourke OK, thanks. Hopefully there are no functionality issues with using Magento 2.4.4 and Paymentsense. This is a new install (replacing an old 1.9.* site) and 2.4.4 was the only Magento version that made sense from a support lifecycle point of view.
We're seeing the following errors with a magento setup:di:compile:
PHP Fatal error: Declaration of Paymentsense\Payments\Helper\PaymentsenseLogger::debug($message, array $context = []) must be compatible with Monolog\Logger::debug($message, array $context = []): void in /home/ronny/public_html/atroposbooks.co.uk/htdocs/vendor/paymentsense/magento2-module/Helper/PaymentsenseLogger.php on line 118
MiBPHP Fatal error: Declaration of Paymentsense\Payments\Helper\PaymentsenseLogger::info($message, array $context = []) must be compatible with Monolog\Logger::info($message, array $context = []): void in /home/ronny/public_html/atroposbooks.co.uk/htdocs/vendor/paymentsense/magento2-module/Helper/PaymentsenseLogger.php on line 99
This diff fixes the issues: