Skip to content

5.0 tested PHP versions#3096

Open
adriendupuis wants to merge 7 commits into5.0from
update-php-5.0
Open

5.0 tested PHP versions#3096
adriendupuis wants to merge 7 commits into5.0from
update-php-5.0

Conversation

@adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Mar 18, 2026

Question Answer
JIRA Ticket N/A
Versions 5.0
Edition N/A

Test with upper and lower versions of PHP

  • Add PHP 8.4 to code-samples-validation CI test suite
  • Fixes to satisfy both PHP 8.3 and 8.4 tests
  • Add Rector check to Composer scripts

Related PR: #3097

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

@github-actions
Copy link

github-actions bot commented Mar 18, 2026

Preview of modified files: no change to preview.

@adriendupuis adriendupuis marked this pull request as ready for review March 18, 2026 15:45
Copy link
Contributor

@mnocon mnocon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@github-actions
Copy link

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/back_office/search/src/Search/Serializer/Normalizer/Suggestion/ProductSuggestionNormalizer.php

docs/administration/back_office/customize_search_suggestion.md@72:``` php
docs/administration/back_office/customize_search_suggestion.md@73:[[= include_file('code_samples/back_office/search/src/Search/Serializer/Normalizer/Suggestion/ProductSuggestionNormalizer.php') =]]
docs/administration/back_office/customize_search_suggestion.md@74:```

001⫶<?php declare(strict_types=1);
002⫶
003⫶namespace App\Search\Serializer\Normalizer\Suggestion;
004⫶
005⫶use App\Search\Model\Suggestion\ProductSuggestion;
006⫶use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
007⫶use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
008⫶use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
009⫶
010⫶class ProductSuggestionNormalizer implements
011⫶ NormalizerInterface,
012⫶ NormalizerAwareInterface
013⫶{
014⫶ use NormalizerAwareTrait;
015⫶
016⫶ /**
017⫶ * @return array<string, string|null>
018⫶ */

code_samples/back_office/search/src/Search/Serializer/Normalizer/Suggestion/ProductSuggestionNormalizer.php

docs/administration/back_office/customize_search_suggestion.md@72:``` php
docs/administration/back_office/customize_search_suggestion.md@73:[[= include_file('code_samples/back_office/search/src/Search/Serializer/Normalizer/Suggestion/ProductSuggestionNormalizer.php') =]]
docs/administration/back_office/customize_search_suggestion.md@74:```

001⫶<?php declare(strict_types=1);
002⫶
003⫶namespace App\Search\Serializer\Normalizer\Suggestion;
004⫶
005⫶use App\Search\Model\Suggestion\ProductSuggestion;
006⫶use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
007⫶use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
008⫶use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
009⫶
010⫶class ProductSuggestionNormalizer implements
011⫶ NormalizerInterface,
012⫶ NormalizerAwareInterface
013⫶{
014⫶ use NormalizerAwareTrait;
015⫶
016⫶ /**
017⫶ * @return array<string, string|null>
018⫶ */
019⫶    public function normalize($object, string $format = null, array $context = []): array
019⫶    public function normalize($object, ?string $format = null, array $context = []): array
020⫶    {
021⫶ /** @var \App\Search\Model\Suggestion\ProductSuggestion $object */
022⫶ return [
023⫶ 'type' => 'product',
024⫶ 'name' => $object->getName(),
025⫶ 'productCode' => $object->getProduct()->getCode(),
026⫶ 'productTypeIdentifier' => $object->getProduct()->getProductType()->getIdentifier(),
027⫶ 'productTypeName' => $object->getProduct()->getProductType()->getName(),
028⫶ ];
029⫶ }
030⫶
031⫶ public function supportsNormalization($data, ?string $format = null, array $context = []): bool
032⫶ {
033⫶ return $data instanceof ProductSuggestion;
034⫶ }
035⫶
036⫶ public function getSupportedTypes(?string $format): array
037⫶ {
038⫶ return [
039⫶ ProductSuggestion::class => true,
040⫶ ];
041⫶ }
042⫶}


code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php

docs/content_management/data_migration/create_data_migration_action.md@24:``` php
docs/content_management/data_migration/create_data_migration_action.md@25:[[= include_file('code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php') =]]
docs/content_management/data_migration/create_data_migration_action.md@26:```

001⫶<?php
002⫶
003⫶declare(strict_types=1);
004⫶
005⫶namespace App\Migrations\Action;
006⫶
007⫶use Ibexa\Contracts\Migration\Serializer\Denormalizer\AbstractActionDenormalizer;
008⫶use Webmozart\Assert\Assert;
009⫶
010⫶final class AssignSectionDenormalizer extends AbstractActionDenormalizer
011⫶{
020⫶    {
021⫶ /** @var \App\Search\Model\Suggestion\ProductSuggestion $object */
022⫶ return [
023⫶ 'type' => 'product',
024⫶ 'name' => $object->getName(),
025⫶ 'productCode' => $object->getProduct()->getCode(),
026⫶ 'productTypeIdentifier' => $object->getProduct()->getProductType()->getIdentifier(),
027⫶ 'productTypeName' => $object->getProduct()->getProductType()->getName(),
028⫶ ];
029⫶ }
030⫶
031⫶ public function supportsNormalization($data, ?string $format = null, array $context = []): bool
032⫶ {
033⫶ return $data instanceof ProductSuggestion;
034⫶ }
035⫶
036⫶ public function getSupportedTypes(?string $format): array
037⫶ {
038⫶ return [
039⫶ ProductSuggestion::class => true,
040⫶ ];
041⫶ }
042⫶}


code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php

docs/content_management/data_migration/create_data_migration_action.md@24:``` php
docs/content_management/data_migration/create_data_migration_action.md@25:[[= include_file('code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php') =]]
docs/content_management/data_migration/create_data_migration_action.md@26:```

001⫶<?php
002⫶
003⫶declare(strict_types=1);
004⫶
005⫶namespace App\Migrations\Action;
006⫶
007⫶use Ibexa\Contracts\Migration\Serializer\Denormalizer\AbstractActionDenormalizer;
008⫶use Webmozart\Assert\Assert;
009⫶
010⫶final class AssignSectionDenormalizer extends AbstractActionDenormalizer
011⫶{
012⫶    protected function supportsActionName(string $actionName, string $format = null): bool
012⫶    protected function supportsActionName(string $actionName, ?string $format = null): bool
013⫶    {
014⫶ return $actionName === AssignSection::TYPE;
015⫶ }
016⫶
017⫶ /**
018⫶ * @param array<mixed> $data
019⫶ * @param string $type
020⫶ * @param string|null $format
021⫶ * @param array<mixed> $context
022⫶ *
023⫶ * @return \App\Migrations\Action\AssignSection
024⫶ */
013⫶    {
014⫶ return $actionName === AssignSection::TYPE;
015⫶ }
016⫶
017⫶ /**
018⫶ * @param array<mixed> $data
019⫶ * @param string $type
020⫶ * @param string|null $format
021⫶ * @param array<mixed> $context
022⫶ *
023⫶ * @return \App\Migrations\Action\AssignSection
024⫶ */
025⫶    public function denormalize($data, string $type, string $format = null, array $context = []): AssignSection
025⫶    public function denormalize($data, string $type, ?string $format = null, array $context = []): AssignSection
026⫶    {
027⫶ Assert::keyExists($data, 'value');
028⫶
029⫶ return new AssignSection($data['value']);
030⫶ }
031⫶}

026⫶    {
027⫶ Assert::keyExists($data, 'value');
028⫶
029⫶ return new AssignSection($data['value']);
030⫶ }
031⫶}

Download colorized diff

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants