cancel
Showing results for 
Search instead for 
Did you mean: 

PHP 8 Compatibility Community Project Update

sivashchenko
Adobe Team

We have completed upgrading Magento external dependencies in the scope of the PHP 8 Compatibility project. These changes will be available in the 2.4.3 release. We are still working to update internal dependencies to provide full PHP 8.0 compatibility. Also, based on our experience we have decided to eliminate some of the least active dependencies so that we can accelerate efforts to make Magento compatible with new PHP versions in the future; particularly for PHP 8.1. 

 

While full PHP 8.0 compatibility is not yet available in a stable release, we are planning to provide it to the participants of our our beta program to help them prepare their extensions and customizations. Meanwhile, we are already looking into PHP 8.1 compatibility. In order for us to plan releases, including support/compatibility for new PHP versions,  we are looking for your input. Please take this quick survey. Your input will help us make the right decision. 

 

Changed dependencies 

 

The following external dependencies have been updated in the scope of the project: 

 

  • elasticsearch/elasticsearch 
  • laminas/laminas-captcha 
  • laminas/laminas-code 
  • laminas/laminas-crypt 
  • laminas/laminas-db
  • laminas/laminas-dependency-plugin
  • laminas/laminas-di
  • laminas/laminas-feed
  • laminas/laminas-json
  • laminas/laminas-mime
  • laminas/laminas-mvc
  • laminas/laminas-servicemanager
  • laminas/laminas-session
  • laminas/laminas-soap
  • laminas/laminas-view
  • league/flysystem
  • league/flysystem-aws-s3-v3
  • pelago/emogrifier
  • ramsey/uuid
  • tedivm/jshrink
  • wikimedia/less.php
  • allure-framework/allure-phpunit (require-dev)
  • friendsofphp/php-cs-fixer (require-dev)
  • phpstan/phpstan (require-dev)
  • sebastian/phpcpd (require-dev)
  • squizlabs/php_codesniffer (require-dev) 

 

The following external dependencies have been removed in the scope of the project: 

 

  • laminas/laminas-config (removed as a direct dependency)
  • laminas/laminas-console
  • laminas/laminas-form
  • laminas/laminas-log
  • laminas/laminas-serializer
  • league/flysystem-cached-adapter 

 

The following external dependencies have been added in the scope of the project: 

 

  • laminas/laminas-filter (instead of parent laminas/laminas-form) 
  • symfony/finder (require-dev, was a dependency of sebastian/phpcpd before) 

 

Backward incompatible changes 

 

Upgrading some of the dependencies required introducing backward incompatible changes to our API. Here is the list of such changes: 

 

  • Magento\Email\Model\Template\Filter constructor parameters changed 
  • Magento\Widget\Model\Template\Filter constructor parameters changed 
  • Magento\Email\Model\Template\Filter::getCssFilesContent function throws exception instead of returning exception message in the content 
  • Magento\Email\Model\Template\Filter::$emogrifier protected property has been removed 

 

To address these backward incompatible changes for your customization or extensions, the classes extending the Magento\Email\Model\Template\Filter class and calling the Magento\Email\Model\Template\Filter constructor or using the $emogrifier protected property should be updated: 

 

  • Arguments list passed to the Magento\Email\Model\Template\Filter constructor call should be updated to match the new Magento\Email\Model\Template\Filter constructor parameters 
  • $emogrifier protected property reference should be removed, interface methods should be used instead 

 

Additionally, it is always a good idea to use the Upgrade Compatibility Tool  to analyse customization/extension code and identify  possible compatibility issues with a newer Magento version. 

 

Thanks to contributors! 

 

The PHP 8 Compatibility project has been fully completed by our awesome Magento community. We would like to say a huge thank you to everyone involved! And special thanks to the most invested contributors: 

 

1 Comment