From b1199f2aa9057b3cbf764fde9a7b51e8f1c623d1 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 01/18] 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 681b9b2050..d91ceb5937 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 1d8aacba276500d399a44b4e03df12173cce94cf Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 14:43:17 +0100 Subject: [PATCH 02/18] code-samples-validation workflow: Test on PHP 7.4, 8.2, and 8.4 --- .github/workflows/code_samples.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code_samples.yaml b/.github/workflows/code_samples.yaml index b61a4117e2..e63e3545f4 100644 --- a/.github/workflows/code_samples.yaml +++ b/.github/workflows/code_samples.yaml @@ -10,7 +10,9 @@ jobs: strategy: matrix: php: - - "8.3" + - "8.4" # Upper supported version + - "8.2" # Lower supported that haven't reached end of live + - "7.4" # Lower supported version but reached end of life, 8.2 is recommended instead steps: - uses: actions/checkout@v4 From 9c373f47fedaf8e6785f2b823f44e65d79936202 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:11:56 +0100 Subject: [PATCH 03/18] Fix some "implicitly nullable" --- .../src/Security/Limitation/CustomLimitationType.php | 2 +- .../Normalizer/Suggestion/ProductSuggestionNormalizer.php | 4 ++-- .../src/Migrations/Action/AssignSectionDenormalizer.php | 4 ++-- .../src/Migrations/Matcher/SectionIdentifierNormalizer.php | 2 +- .../src/Migrations/Step/ReplaceNameStepNormalizer.php | 2 +- .../2dpoint_ft/src/Serializer/Point2D/ValueDenormalizer.php | 4 ++-- .../2dpoint_ft/src/Serializer/Point2D/ValueNormalizer.php | 4 ++-- .../src/Query/Criterion/Solr/CameraManufacturerVisitor.php | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code_samples/back_office/limitation/src/Security/Limitation/CustomLimitationType.php b/code_samples/back_office/limitation/src/Security/Limitation/CustomLimitationType.php index acb7c5f9df..d5c87c6636 100644 --- a/code_samples/back_office/limitation/src/Security/Limitation/CustomLimitationType.php +++ b/code_samples/back_office/limitation/src/Security/Limitation/CustomLimitationType.php @@ -57,7 +57,7 @@ public function buildValue(array $limitationValues): CustomLimitationValue * * @return bool|null */ - public function evaluate(Limitation $value, UserReference $currentUser, ValueObject $object, array $targets = null): ?bool + public function evaluate(Limitation $value, UserReference $currentUser, ValueObject $object, ?array $targets = null): ?bool { if (!$value instanceof CustomLimitationValue) { throw new InvalidArgumentException('$value', 'Must be of type: CustomLimitationValue'); 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 af57c761f2..53ddec60b7 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 @@ -15,7 +15,7 @@ class ProductSuggestionNormalizer implements { use NormalizerAwareTrait; - public function normalize($object, string $format = null, array $context = []) + public function normalize($object, ?string $format = null, array $context = []) { /** @var \App\Search\Model\Suggestion\ProductSuggestion $object */ return [ @@ -27,7 +27,7 @@ public function normalize($object, string $format = null, array $context = []) ]; } - public function supportsNormalization($data, string $format = null) + public function supportsNormalization($data, ?string $format = null) { return $data instanceof ProductSuggestion; } diff --git a/code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php b/code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php index a8b914701f..96f067a99e 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'); diff --git a/code_samples/data_migration/src/Migrations/Matcher/SectionIdentifierNormalizer.php b/code_samples/data_migration/src/Migrations/Matcher/SectionIdentifierNormalizer.php index da68931e11..df177a4b94 100644 --- a/code_samples/data_migration/src/Migrations/Matcher/SectionIdentifierNormalizer.php +++ b/code_samples/data_migration/src/Migrations/Matcher/SectionIdentifierNormalizer.php @@ -25,7 +25,7 @@ protected function createCriterion(array $data, string $type, ?string $format, a return new Criterion\SectionIdentifier($data['value']); } - public function supportsNormalization($data, string $format = null): bool + public function supportsNormalization($data, ?string $format = null): bool { return $data instanceof Criterion\SectionIdentifier; } diff --git a/code_samples/data_migration/src/Migrations/Step/ReplaceNameStepNormalizer.php b/code_samples/data_migration/src/Migrations/Step/ReplaceNameStepNormalizer.php index 5424907426..55b5ace82d 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 38b6526fde..69a50c26c2 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 = []) + public function denormalize($data, string $class, ?string $format = null, array $context = []) { if (isset($data['x']) && isset($data['y'])) { // Support for old format @@ -18,7 +18,7 @@ public function denormalize($data, string $class, string $format = null, array $ return new $class($data); } - public function supportsDenormalization($data, string $type, string $format = null) + public function supportsDenormalization($data, string $type, ?string $format = null) { return $type === Value::class; } 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 4cf70fa9d3..4709279115 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 @@ -8,7 +8,7 @@ final class ValueNormalizer implements NormalizerInterface { - public function normalize($object, string $format = null, array $context = []) + public function normalize($object, ?string $format = null, array $context = []) { return [ $object->getX(), @@ -16,7 +16,7 @@ public function normalize($object, string $format = null, array $context = []) ]; } - public function supportsNormalization($data, string $format = null) + public function supportsNormalization($data, ?string $format = null) { return $data instanceof Value; } diff --git a/code_samples/search/custom/src/Query/Criterion/Solr/CameraManufacturerVisitor.php b/code_samples/search/custom/src/Query/Criterion/Solr/CameraManufacturerVisitor.php index 6d4b7fb89d..baa9277009 100644 --- a/code_samples/search/custom/src/Query/Criterion/Solr/CameraManufacturerVisitor.php +++ b/code_samples/search/custom/src/Query/Criterion/Solr/CameraManufacturerVisitor.php @@ -18,7 +18,7 @@ public function canVisit(Criterion $criterion) /** * @param \App\Query\Criterion\CameraManufacturerCriterion $criterion */ - public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null) + public function visit(Criterion $criterion, ?CriterionVisitor $subVisitor = null) { $expressions = array_map( function ($value): string { From 281a2666c3c5271392dfca15f0fa38676b998cec Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:23:09 +0100 Subject: [PATCH 04/18] WhisperAudioToTextActionHandler: PHP 7.4 compatible --- .../src/AI/Handler/WhisperAudioToTextActionHandler.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code_samples/ai_actions/src/AI/Handler/WhisperAudioToTextActionHandler.php b/code_samples/ai_actions/src/AI/Handler/WhisperAudioToTextActionHandler.php index 1c253249ce..d8d4b66132 100644 --- a/code_samples/ai_actions/src/AI/Handler/WhisperAudioToTextActionHandler.php +++ b/code_samples/ai_actions/src/AI/Handler/WhisperAudioToTextActionHandler.php @@ -31,7 +31,7 @@ public function handle(ActionInterface $action, array $context = []): ActionResp $arguments = ['whisper']; - $language = $action->getRuntimeContext()?->get('languageCode'); + $language = $action->hasRuntimeContext() ? $action->getRuntimeContext()->get('languageCode') : null; if ($language !== null) { $arguments[] = sprintf('--language=%s', substr($language, 0, 2)); } @@ -49,10 +49,10 @@ public function handle(ActionInterface $action, array $context = []): ActionResp $output = $process->getOutput(); - $includeTimestamps = $action->getActionContext() - ?->getActionTypeOptions() + $includeTimestamps = $action->hasActionContext() ? $action->getActionContext() + ->getActionTypeOptions() ->get('include_timestamps', false) - ?? false; + : false; if (!$includeTimestamps) { $output = $this->removeTimestamps($output); From 2fda5914c59a7c483ce18c569202dd4dea09f7f0 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:33:49 +0100 Subject: [PATCH 05/18] HelpMenuSubscriber: PHP 7.4 compatible --- .../menu_item/src/EventSubscriber/HelpMenuSubscriber.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code_samples/back_office/menu/menu_item/src/EventSubscriber/HelpMenuSubscriber.php b/code_samples/back_office/menu/menu_item/src/EventSubscriber/HelpMenuSubscriber.php index c669645d0b..54c81eae6a 100644 --- a/code_samples/back_office/menu/menu_item/src/EventSubscriber/HelpMenuSubscriber.php +++ b/code_samples/back_office/menu/menu_item/src/EventSubscriber/HelpMenuSubscriber.php @@ -9,9 +9,12 @@ final class HelpMenuSubscriber implements EventSubscriberInterface { + private bool $kernelDebug; + public function __construct( - private readonly bool $kernelDebug + bool $kernelDebug ) { + $this->kernelDebug = $kernelDebug; } public static function getSubscribedEvents(): array From f350a478614351b472cf9d085e0d2a9628c7eca3 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:34:09 +0100 Subject: [PATCH 06/18] AnniversaryConditionStepEventSubscriber: PHP 7.4 compatible --- .../AnniversaryConditionStepEventSubscriber.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/code_samples/discounts/src/Discounts/Step/Step2/AnniversaryConditionStepEventSubscriber.php b/code_samples/discounts/src/Discounts/Step/Step2/AnniversaryConditionStepEventSubscriber.php index 8f60118ad1..f69b9f22fa 100644 --- a/code_samples/discounts/src/Discounts/Step/Step2/AnniversaryConditionStepEventSubscriber.php +++ b/code_samples/discounts/src/Discounts/Step/Step2/AnniversaryConditionStepEventSubscriber.php @@ -56,12 +56,17 @@ public function addAnniversaryConditionStep(Event $event): void public function addStepDataToStruct(DiscountStructEventInterface $event): void { + $step = $event->getData() + ->getStepByIdentifier(AnniversaryConditionStep::IDENTIFIER); + + if ($step === null) { + return; + } + /** @var AnniversaryConditionStep $stepData */ - $stepData = $event - ->getData() - ->getStepByIdentifier(AnniversaryConditionStep::IDENTIFIER)?->getStepData(); + $stepData = $step->getStepData(); - if ($stepData === null || !$stepData->enabled) { + if (!$stepData->enabled) { return; } From f39ba5970069fc3b2dd9d4727c5d88cb007112be Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:21:06 +0100 Subject: [PATCH 07/18] phpstan-baseline.neon: rm unmatched --- phpstan-baseline.neon | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 9b34e1425f..158a907ab0 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -120,12 +120,6 @@ parameters: count: 1 path: code_samples/api/public_php_api/src/Controller/CustomFilterController.php - - - message: '#^Parameter \#1 \$string of function base64_encode expects string, string\|false given\.$#' - identifier: argument.type - count: 1 - path: code_samples/api/rest_api/create_image.json.php - - message: '#^Cannot access property \$nodeName on DOMNode\|null\.$#' identifier: property.nonObject @@ -150,12 +144,6 @@ parameters: count: 1 path: code_samples/api/rest_api/create_image.xml.php - - - message: '#^Parameter \#1 \$string of function base64_encode expects string, string\|false given\.$#' - identifier: argument.type - count: 1 - path: code_samples/api/rest_api/create_image.xml.php - - message: '#^Result of && is always false\.$#' identifier: booleanAnd.alwaysFalse From 74bd5e042b0f1f813fdb65a301f61c2eaab4be7e Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:22:10 +0100 Subject: [PATCH 08/18] ViewContentMetaDataCommand: Fix iterator_to_array PHP<8.2 https://www.php.net/manual/en/function.iterator-to-array.php#refsect1-function.iterator-to-array-changelog --- .../public_php_api/src/Command/ViewContentMetaDataCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php b/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php index 6037ae2515..1c1adc2d34 100644 --- a/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php +++ b/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php @@ -86,7 +86,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln(' in ' . $versionInfo->getInitialLanguage()->name); } - $versionInfoArray = iterator_to_array($this->contentService->loadVersions($contentInfo, VersionInfo::STATUS_ARCHIVED)); + $versionInfoArray = $this->contentService->loadVersions($contentInfo, VersionInfo::STATUS_ARCHIVED); + if ($versionInfoArray instanceof \Traversable) { $versionInfoArray = iterator_to_array($versionInfoArray); } if (count($versionInfoArray)) { $output->writeln('Archived versions:'); foreach ($versionInfoArray as $versionInfo) { From 96167e8c38b684b04a8e9ba58ba16a5b326266ea Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:27:19 +0100 Subject: [PATCH 09/18] Revert "phpstan-baseline.neon: rm unmatched" This reverts commit f39ba5970069fc3b2dd9d4727c5d88cb007112be. --- phpstan-baseline.neon | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 158a907ab0..9b34e1425f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -120,6 +120,12 @@ parameters: count: 1 path: code_samples/api/public_php_api/src/Controller/CustomFilterController.php + - + message: '#^Parameter \#1 \$string of function base64_encode expects string, string\|false given\.$#' + identifier: argument.type + count: 1 + path: code_samples/api/rest_api/create_image.json.php + - message: '#^Cannot access property \$nodeName on DOMNode\|null\.$#' identifier: property.nonObject @@ -144,6 +150,12 @@ parameters: count: 1 path: code_samples/api/rest_api/create_image.xml.php + - + message: '#^Parameter \#1 \$string of function base64_encode expects string, string\|false given\.$#' + identifier: argument.type + count: 1 + path: code_samples/api/rest_api/create_image.xml.php + - message: '#^Result of && is always false\.$#' identifier: booleanAnd.alwaysFalse From ca25dea45858650708c205a7fa23e761e5808026 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:30:23 +0100 Subject: [PATCH 10/18] phpstan-baseline.neon: regex --- phpstan-baseline.neon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 9b34e1425f..71bf0051e7 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -121,7 +121,7 @@ parameters: path: code_samples/api/public_php_api/src/Controller/CustomFilterController.php - - message: '#^Parameter \#1 \$string of function base64_encode expects string, string\|false given\.$#' + message: '#^Parameter \#1 \$str(ing)? of function base64_encode expects string, string\|false given\.$#' identifier: argument.type count: 1 path: code_samples/api/rest_api/create_image.json.php @@ -151,7 +151,7 @@ parameters: path: code_samples/api/rest_api/create_image.xml.php - - message: '#^Parameter \#1 \$string of function base64_encode expects string, string\|false given\.$#' + message: '#^Parameter \#1 \$str(ing)? of function base64_encode expects string, string\|false given\.$#' identifier: argument.type count: 1 path: code_samples/api/rest_api/create_image.xml.php From 54e52b66e154b15f1f98f48043e1b50964ae7563 Mon Sep 17 00:00:00 2001 From: adriendupuis Date: Wed, 18 Mar 2026 17:38:38 +0000 Subject: [PATCH 11/18] PHP & JS CS Fixes --- .../public_php_api/src/Command/ViewContentMetaDataCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php b/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php index 1c1adc2d34..3f5a8ad826 100644 --- a/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php +++ b/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php @@ -87,7 +87,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $versionInfoArray = $this->contentService->loadVersions($contentInfo, VersionInfo::STATUS_ARCHIVED); - if ($versionInfoArray instanceof \Traversable) { $versionInfoArray = iterator_to_array($versionInfoArray); } + if ($versionInfoArray instanceof \Traversable) { + $versionInfoArray = iterator_to_array($versionInfoArray); + } if (count($versionInfoArray)) { $output->writeln('Archived versions:'); foreach ($versionInfoArray as $versionInfo) { From 4856b25d6ef243ef13c93ef7f460610ee0c61b6e Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:38:13 +0100 Subject: [PATCH 12/18] phpstan-baseline.neon: regex "$string" VS "$str" --- phpstan-baseline.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 71bf0051e7..f9004567bf 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -283,7 +283,7 @@ parameters: path: code_samples/back_office/search/src/EventSubscriber/MySuggestionEventSubscriber.php - - message: '#^Parameter \#2 \$string of function explode expects string, string\|null given\.$#' + message: '#^Parameter \#2 \$str(ing)? of function explode expects string, string\|null given\.$#' identifier: argument.type count: 1 path: code_samples/back_office/search/src/EventSubscriber/MySuggestionEventSubscriber.php From 477c5d190123c652c5e44c7364ed4cd2da0cd6fb Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:40:57 +0100 Subject: [PATCH 13/18] phpstan-baseline.neon: regex for array_merge --- phpstan-baseline.neon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f9004567bf..990988006f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -193,13 +193,13 @@ parameters: path: code_samples/api/rest_api/src/Rest/ValueObjectVisitor/RestLocation.php - - message: '#^Parameter \#1 \.\.\.\$arrays of function array_merge expects array, iterable\ given\.$#' + message: '#^Parameter \#1 (\.\.\.\$arrays|$arr1) of function array_merge expects array, iterable\ given\.$#' identifier: argument.type count: 1 path: code_samples/api/rest_api/src/Rest/ValueObjectVisitor/RestLocation.php - - message: '#^Parameter \#2 \.\.\.\$arrays of function array_merge expects array, iterable\ given\.$#' + message: '#^Parameter \#2 (\.\.\.\$arrays|$args) of function array_merge expects array, iterable\ given\.$#' identifier: argument.type count: 1 path: code_samples/api/rest_api/src/Rest/ValueObjectVisitor/RestLocation.php From b913324d6b5d3113a9a0013bb44d0d6f044ce342 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:42:29 +0100 Subject: [PATCH 14/18] (minor) Format ViewContentMetaDataCommand.php --- .../public_php_api/src/Command/ViewContentMetaDataCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php b/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php index 3f5a8ad826..eef820bc3e 100644 --- a/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php +++ b/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php @@ -88,7 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $versionInfoArray = $this->contentService->loadVersions($contentInfo, VersionInfo::STATUS_ARCHIVED); if ($versionInfoArray instanceof \Traversable) { - $versionInfoArray = iterator_to_array($versionInfoArray); + $versionInfoArray = iterator_to_array($versionInfoArray); } if (count($versionInfoArray)) { $output->writeln('Archived versions:'); From a8b2260bdc2b020653d32d07116191046b84d2bd Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:48:22 +0100 Subject: [PATCH 15/18] phpstan-baseline.neon: regex for array_merge --- phpstan-baseline.neon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 990988006f..d31c89f902 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -193,13 +193,13 @@ parameters: path: code_samples/api/rest_api/src/Rest/ValueObjectVisitor/RestLocation.php - - message: '#^Parameter \#1 (\.\.\.\$arrays|$arr1) of function array_merge expects array, iterable\ given\.$#' + message: '#^Parameter \#1 (\.\.\.\$arrays|\$arr1) of function array_merge expects array, iterable\ given\.$#' identifier: argument.type count: 1 path: code_samples/api/rest_api/src/Rest/ValueObjectVisitor/RestLocation.php - - message: '#^Parameter \#2 (\.\.\.\$arrays|$args) of function array_merge expects array, iterable\ given\.$#' + message: '#^Parameter \#2 (\.\.\.\$arrays|\$args) of function array_merge expects array, iterable\ given\.$#' identifier: argument.type count: 1 path: code_samples/api/rest_api/src/Rest/ValueObjectVisitor/RestLocation.php From 0b8f5565be4e2e66ec4ff4443ca9af73631cacc4 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:57:14 +0100 Subject: [PATCH 16/18] phpstan-baseline.neon: regex for array_merge --- phpstan-baseline.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index d31c89f902..d0451a09dd 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -199,7 +199,7 @@ parameters: path: code_samples/api/rest_api/src/Rest/ValueObjectVisitor/RestLocation.php - - message: '#^Parameter \#2 (\.\.\.\$arrays|\$args) of function array_merge expects array, iterable\ given\.$#' + message: '#^Parameter \#2 \.\.\.(\$arrays|\$args) of function array_merge expects array, iterable\ given\.$#' identifier: argument.type count: 1 path: code_samples/api/rest_api/src/Rest/ValueObjectVisitor/RestLocation.php From d6fc0ac258ddcbc15d119c529dcc7b097029189e Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:14:31 +0100 Subject: [PATCH 17/18] browsing_content.md: Update include_file slices --- docs/content_management/content_api/browsing_content.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/content_management/content_api/browsing_content.md b/docs/content_management/content_api/browsing_content.md index 2e1a942419..570fd07e0e 100644 --- a/docs/content_management/content_api/browsing_content.md +++ b/docs/content_management/content_api/browsing_content.md @@ -98,7 +98,7 @@ This method loads only the specified subset of relations to improve performance You can get the current version's `VersionInfo` using [`ContentService::loadVersionInfo`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ContentService.html#method_loadVersionInfo). ``` php -[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 100, 107) =]] +[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 103, 110) =]] ``` You can also specify the version number as the second argument to get Relations for a specific version: @@ -117,7 +117,7 @@ It also holds the [relation type](content_relations.md), and the optional field You can use the `getOwner` method of the `ContentInfo` object to load the content item's owner as a `User` value object. ``` php -[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 109, 110) =]] +[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 112, 113) =]] ``` To get the creator of the current version and not the content item's owner, you need to use the `creatorId` property from the current version's `VersionInfo` object. @@ -127,7 +127,7 @@ To get the creator of the current version and not the content item's owner, you You can find the section to which a content item belongs through the [`getSection`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-ContentInfo.html#method_getSection) method of the ContentInfo object: ``` php -[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 112, 113) =]] +[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 115, 116) =]] ``` !!! note @@ -142,7 +142,7 @@ You need to provide it with the object state group. All object state groups can be retrieved through [`loadObjectStateGroups`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-ObjectStateService.html#method_loadObjectStateGroups). ``` php -[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 115, 120) =]] +[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php', 118, 123) =]] ``` ## Viewing content with fields From a211732894f937469f65fc0433e860f7220df5d3 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:16:41 +0100 Subject: [PATCH 18/18] extend_discounts_wizard.md: update hl_lines --- docs/discounts/extend_discounts_wizard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/discounts/extend_discounts_wizard.md b/docs/discounts/extend_discounts_wizard.md index 931079f835..fc6ea21f66 100644 --- a/docs/discounts/extend_discounts_wizard.md +++ b/docs/discounts/extend_discounts_wizard.md @@ -106,7 +106,7 @@ Expand the previously created `AnniversaryConditionStepEventSubscriber` to liste and add the `addStepDataToStruct()` method: -``` php hl_lines="23-24 57-70" +``` php hl_lines="23-24 57-75" [[= include_file('code_samples/discounts/src/Discounts/Step/Step2/AnniversaryConditionStepEventSubscriber.php') =]] ```