postnl / postnl-magento2

This is the official Magento 2 extension for the logistics company PostNL. Add shipping options and parcelshops to your checkout. Create labels with track and trace functionality from the backend.
59 stars 60 forks source link

[QUESTION] PHP 8.1 support #298

Closed DuckThom closed 2 years ago

DuckThom commented 2 years ago

Question Considering the scheduled release of Magento 2.4.4 tomorrow (April 12th), is there an estimation of when PHP 8.1 support will be added? I just noticed the 1.12.0 release but found that php 8.1 support was not added yet. While Magento 2.4.4 should still work with PHP 7.4, there is no official guarantee that it will work properly, only with PHP 8.1.

I checked very briefly and the only thing I found so far was that I had to add |~8.1 to the php version constraint. I didn't do any in-depth testing so I cannot say for certain that that's the only required change.

Edit:

I also had to change this:

diff --git a/Logging/Log.php b/Logging/Log.php
index 8579b959..7d37dd66 100644
--- a/Logging/Log.php
+++ b/Logging/Log.php
@@ -48,7 +48,7 @@ class Log extends Logger
      * @param LoggingConfiguration $loggingConfiguration
      */
     public function __construct(
-        $name,
+        string $name,
         LoggingConfiguration $loggingConfiguration,
         array $handlers = [],
         array $processors = []
@@ -64,7 +64,7 @@ class Log extends Logger
      *
      * @return bool
      */
-    public function addRecord($level, $message, array $context = [])
+    public function addRecord(int $level, string $message, array $context = []): bool
     {
         if (!$this->logConfig->canLog($level)) {
             return false;
tig-jeffreybranderhorst commented 2 years ago

Hi @DuckThom,

Thank you for contacting us. We did not add the support yet because when 2.4.4 releases, we first want to test 2.4.4. So we can be sure the PostNL extension is working on the new version. We will release it as soon as possible. Thank you for thinking along with the compatibility for php 8.1!

Have a great day, Jeffrey

tig-vincentthart commented 2 years ago

Hi @DuckThom

Thank you for your input. We just released v1.12.2 with support for Magento 2.4.4 and PHP 8.1

Have a nice day! Vincent