One of our main long-term goals is keeping Shopsys Framework technologies up to date. In the current release, we focused on upgrading PHP to the latest version – PHP 8.1. To be able to migrate our codebase to the latest PHP, we first had to deal with a few libraries that we depend on, and upgrade them as well. Let’s take a look at the most interesting upgrades included in this release.
PHP
7.4 -> 8.1 [#2430]
We are happy to continue the development of Shopsys Framework with the newest PHP version. We can now leverage the new features and enjoy the improved performance. It was a high time to upgrade as the active support for the previously used PHP (7.4) has been already dropped, and the security support will be dropped in a few months.
Doctrine libraries and dependencies
Just to mention a few:
- doctrine/common (2.8.1 -> 3.2.2)
- doctrine/migrations (1.8.1 -> 3.4.1)
- doctrine/persistence (1.3.7 -> 2.4)
- doctrine/dbal (2.1 -> 3.3.3)
As a part of the upgrade, we have also rewritten and improved our own migration tool – shopsys/migrations. In the new version, the migrations-lock.yaml file is simplified, and the migrations output is significantly enhanced to contain more useful information (e.g. total SQL queries count) and less useless information (e.g. “Migration executed but did not result in any SQL statements” messages are not there anymore).
PHPStan
0.12.76 -> 1.6.8 [#2452]
Code quality has always been always very important to us, and PHPStan is one of the awesome tools that helps us to keep the quality as high as possible. The new version of PHPStan brings even more powerful analysis and remove deprecations from the build output.
Easy Coding Standard
7.3.18 -> 10.2.2 [#2415] [#2435]
We use the parallel run that is available in the new version, and from now on, the coding standards checks and fixes are really lightning fast! Moreover, the configuration of coding standards was switched from yaml files to PHP classes which radically improves developer experience (IDE autocompletion and automatic fixes of the configuration files are just a beginning, for more information about advantages of this change, you can read the Tomáš Votruba’s article).
Symfony Flex
1.4. -> 1.17 [#2447]
The old Flex infrastructure has been shut down so this upgrade was necessary for our further usage of Symfony Flex tool.
PHPUnit
8.0 -> 9.5 [#2424]
The new version of PhpUnit requires strict typehints for all the properties injected into the testing classes. This is now ensured by a new automatic fixer.
Other interesting tweaks
Twig icon function
[#2274]
There is a new icon twig function that allows developers to easily change html icons throughout the application. The function brings ability to change icon representation in one place and possibility to add new icon types or even combine them.
Annotation fixer improvements
[#2434] We have incorporated the feedback we got from the project developers that use the annotation fixer on a daily basis. From now on, the tool properly generates the @method annotations including default values for the method properties, it is able to work with constants as default parameters, and also updating the existing @method and @property annotations is fixed.