From aa030f5076c7c340b966fcec783809c419832fdf Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 14:42:30 +0100 Subject: [PATCH 1/6] requirements.md: PHP 8.1 End of Life https://www.php.net/supported-versions.php --- docs/getting_started/requirements.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/getting_started/requirements.md b/docs/getting_started/requirements.md index 681b9b20501..d91ceb5937b 100644 --- a/docs/getting_started/requirements.md +++ b/docs/getting_started/requirements.md @@ -135,9 +135,9 @@ For production setups it's recommended that you use Varnish/Fastly, Redis/Valkey - 8.4 - 8.3 - 8.2 - - 8.1 - - 8.0 (PHP 8.0 has reached its End of Life. Unless you have extended support from vendors like Debian or Zend, you should use PHP 8.1) - - 7.4 (PHP 7.4 has reached its End of Life. Unless you have extended support from vendors like Debian or Zend, you should use PHP 8.1) + - 8.1 (PHP 8.1 has reached its End of Life. Unless you have extended support from vendors like Debian or Zend, you should use PHP 8.2) + - 8.0 (PHP 8.0 has reached its End of Life. Unless you have extended support from vendors like Debian or Zend, you should use PHP 8.2) + - 7.4 (PHP 7.4 has reached its End of Life. Unless you have extended support from vendors like Debian or Zend, you should use PHP 8.2) === "[[= product_name =]] v3.3" From e3c06d7bf81cb753aaa4319d4c2a074c258ff936 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 14:44:49 +0100 Subject: [PATCH 2/6] code-samples-validation workflow: Test on 8.3 and 8.4 --- .github/workflows/code_samples.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/code_samples.yaml b/.github/workflows/code_samples.yaml index 5ab0edcf371..62bf47aad08 100644 --- a/.github/workflows/code_samples.yaml +++ b/.github/workflows/code_samples.yaml @@ -10,6 +10,7 @@ jobs: strategy: matrix: php: + - "8.4" - "8.3" steps: - uses: actions/checkout@v4 From fbb2c303a33419adcf966e68972e865248346d77 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 14:52:39 +0100 Subject: [PATCH 3/6] code-samples-validation workflow: Test on 8.3 and 8.4 --- .github/workflows/code_samples.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code_samples.yaml b/.github/workflows/code_samples.yaml index 62bf47aad08..87d5e3bc2aa 100644 --- a/.github/workflows/code_samples.yaml +++ b/.github/workflows/code_samples.yaml @@ -10,8 +10,8 @@ jobs: strategy: matrix: php: - - "8.4" - - "8.3" + - "8.4" # Upper supported version + - "8.3" # Lower supported version steps: - uses: actions/checkout@v4 From fdb1bf75baa33a03ed0de10b2a2f5993f6580815 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 16:18:22 +0100 Subject: [PATCH 4/6] Add rector to composer.json --- .github/workflows/code_samples.yaml | 6 +++--- composer.json | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/code_samples.yaml b/.github/workflows/code_samples.yaml index 87d5e3bc2aa..d410a86455d 100644 --- a/.github/workflows/code_samples.yaml +++ b/.github/workflows/code_samples.yaml @@ -47,11 +47,11 @@ jobs: - name: Run PHPStan analysis run: composer phpstan - - name: Deptrac + - name: Run Deptrac analysis run: composer deptrac - - name: Run rector - run: vendor/bin/rector process --dry-run --ansi + - name: Run Rector check + run: composer check-rector code-samples-inclusion-check: name: Check code samples inclusion diff --git a/composer.json b/composer.json index a55f3ca6ce2..1f8cb44b1e2 100644 --- a/composer.json +++ b/composer.json @@ -88,13 +88,15 @@ "fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots", "check-cs": "@fix-cs --dry-run", "phpstan": "phpstan analyse", - "deptrac": "deptrac analyse" + "deptrac": "deptrac analyse", + "check-rector": "rector process --dry-run --ansi" }, "scripts-descriptions": { "fix-cs": "Automatically fixes code style in all files", "check-cs": "Run code style checker for all files", "phpstan": "Run static code analysis", - "deptrac": "Run Deptrac architecture testing" + "deptrac": "Run Deptrac architecture testing", + "check-rector": "Check for code refactoring opportunities" }, "config": { "allow-plugins": false From c2a7551cb145a21641949b78144aa13ef8a577f3 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 16:25:11 +0100 Subject: [PATCH 5/6] Fix some "implicitly nullable" --- .../Normalizer/Suggestion/ProductSuggestionNormalizer.php | 2 +- .../src/Migrations/Action/AssignSectionDenormalizer.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code_samples/back_office/search/src/Search/Serializer/Normalizer/Suggestion/ProductSuggestionNormalizer.php b/code_samples/back_office/search/src/Search/Serializer/Normalizer/Suggestion/ProductSuggestionNormalizer.php index 86d37860e96..8291280647c 100644 --- a/code_samples/back_office/search/src/Search/Serializer/Normalizer/Suggestion/ProductSuggestionNormalizer.php +++ b/code_samples/back_office/search/src/Search/Serializer/Normalizer/Suggestion/ProductSuggestionNormalizer.php @@ -16,7 +16,7 @@ class ProductSuggestionNormalizer implements /** * @return array */ - public function normalize($object, string $format = null, array $context = []): array + public function normalize($object, ?string $format = null, array $context = []): array { /** @var \App\Search\Model\Suggestion\ProductSuggestion $object */ return [ diff --git a/code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php b/code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php index a8b914701fc..96f067a99e8 100644 --- a/code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php +++ b/code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php @@ -9,7 +9,7 @@ final class AssignSectionDenormalizer extends AbstractActionDenormalizer { - protected function supportsActionName(string $actionName, string $format = null): bool + protected function supportsActionName(string $actionName, ?string $format = null): bool { return $actionName === AssignSection::TYPE; } @@ -22,7 +22,7 @@ protected function supportsActionName(string $actionName, string $format = null) * * @return \App\Migrations\Action\AssignSection */ - public function denormalize($data, string $type, string $format = null, array $context = []): AssignSection + public function denormalize($data, string $type, ?string $format = null, array $context = []): AssignSection { Assert::keyExists($data, 'value'); From 3862c13ea4b72e814fe682b7bdd7b537a6104cee Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 16:33:05 +0100 Subject: [PATCH 6/6] Fix some "implicitly nullable" --- .../src/Migrations/Step/ReplaceNameStepNormalizer.php | 2 +- .../2dpoint_ft/src/Serializer/Point2D/ValueDenormalizer.php | 2 +- .../2dpoint_ft/src/Serializer/Point2D/ValueNormalizer.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code_samples/data_migration/src/Migrations/Step/ReplaceNameStepNormalizer.php b/code_samples/data_migration/src/Migrations/Step/ReplaceNameStepNormalizer.php index 54249074267..55b5ace82d9 100644 --- a/code_samples/data_migration/src/Migrations/Step/ReplaceNameStepNormalizer.php +++ b/code_samples/data_migration/src/Migrations/Step/ReplaceNameStepNormalizer.php @@ -14,7 +14,7 @@ final class ReplaceNameStepNormalizer extends AbstractStepNormalizer { protected function normalizeStep( StepInterface $object, - string $format = null, + ?string $format = null, array $context = [] ): array { assert($object instanceof ReplaceNameStep); diff --git a/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueDenormalizer.php b/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueDenormalizer.php index 96b2b844970..f4037480158 100644 --- a/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueDenormalizer.php +++ b/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueDenormalizer.php @@ -8,7 +8,7 @@ final class ValueDenormalizer implements DenormalizerInterface { - public function denormalize($data, string $class, string $format = null, array $context = []): mixed + public function denormalize($data, string $class, ?string $format = null, array $context = []): mixed { if (isset($data['x']) && isset($data['y'])) { // Support for old format diff --git a/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueNormalizer.php b/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueNormalizer.php index c21c39b2118..bc7fea2b9c6 100644 --- a/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueNormalizer.php +++ b/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueNormalizer.php @@ -11,7 +11,7 @@ final class ValueNormalizer implements NormalizerInterface /** * @return array */ - public function normalize($object, string $format = null, array $context = []): array + public function normalize($object, ?string $format = null, array $context = []): array { return [ $object->getX(),