From 4a7e15bbaae4a65df8d01ced8a01bbceb26856d4 Mon Sep 17 00:00:00 2001 From: Martin Parsiegla Date: Fri, 27 Mar 2026 10:15:16 +0100 Subject: [PATCH 1/3] Update to latest phpstan version --- composer.json | 6 +++--- src/Configuration/GeneratorConfiguration.php | 2 +- src/Configuration/GroupCombination.php | 2 +- src/Context.php | 6 +++--- src/DeserializerGenerator.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index f725ab3..9dc0e60 100644 --- a/composer.json +++ b/composer.json @@ -27,10 +27,10 @@ "doctrine/collections": "^1.6", "friendsofphp/php-cs-fixer": "^3.90.0", "jms/serializer": "^1.13 || ^2 || ^3", - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-phpunit": "^1.3", + "phpstan/phpstan": "^2.1.44", + "phpstan/phpstan-phpunit": "^2.0.16", "phpunit/phpunit": "^9.6", - "rector/rector": "^1.2.1" + "rector/rector": "^2.3.9" }, "autoload": { "psr-4": { diff --git a/src/Configuration/GeneratorConfiguration.php b/src/Configuration/GeneratorConfiguration.php index 7ef8987..2fd33f3 100644 --- a/src/Configuration/GeneratorConfiguration.php +++ b/src/Configuration/GeneratorConfiguration.php @@ -124,7 +124,7 @@ public function addClassToGenerate(ClassToGenerate $classToGenerate): void } /** - * @return string[] + * @return list */ public function getDefaultVersions(): array { diff --git a/src/Configuration/GroupCombination.php b/src/Configuration/GroupCombination.php index bd7d8fe..3ca7c85 100644 --- a/src/Configuration/GroupCombination.php +++ b/src/Configuration/GroupCombination.php @@ -37,7 +37,7 @@ public function __construct( } /** - * @return string[] + * @return list */ public function getGroups(): array { diff --git a/src/Context.php b/src/Context.php index f0be3df..808cfba 100644 --- a/src/Context.php +++ b/src/Context.php @@ -12,7 +12,7 @@ final class Context private ?string $version = null; /** - * @var string[] + * @var list */ private array $groups = []; @@ -21,7 +21,7 @@ public function __construct() } /** - * @return string[] + * @return list */ public function getGroups(): array { @@ -33,7 +33,7 @@ public function getGroups(): array */ public function setGroups(array $groups): self { - $this->groups = array_unique($groups); + $this->groups = array_values(array_unique($groups)); sort($this->groups); return $this; diff --git a/src/DeserializerGenerator.php b/src/DeserializerGenerator.php index ff8bd77..f01ced6 100644 --- a/src/DeserializerGenerator.php +++ b/src/DeserializerGenerator.php @@ -242,7 +242,7 @@ private function generateInnerCodeForFieldType( return $this->generateCodeForArray($type, $arrayPath, $modelPropertyPath, $stack); case $type instanceof PropertyTypeDateTime: - $formats = $type->getDeserializeFormats() ?: (\is_string($type->getFormat()) ? [$type->getFormat()] : $type->getFormat()); + $formats = $type->getDeserializeFormats() ?: (null !== $type->getFormat() ? [$type->getFormat()] : null); if (null !== $formats) { return $this->templating->renderAssignDateTimeFromFormat($type->isImmutable(), (string) $modelPropertyPath, (string) $arrayPath, $formats, $type->getZone()); } From 1c6b03f8d8181c9b32f0d65c86e1ed13e14f2363 Mon Sep 17 00:00:00 2001 From: Martin Parsiegla Date: Thu, 26 Mar 2026 16:53:57 +0100 Subject: [PATCH 2/3] Add enum support This adds proper enum support for (de-)serialization. The logic itself is kinda replicated from JMS, so if the value does not exist when deserializing, an error is thrown --- CHANGELOG.md | 4 ++ composer.json | 2 +- src/DeserializerGenerator.php | 20 ++++++++ src/Recursion.php | 2 +- src/SerializerGenerator.php | 10 ++++ src/Template/Deserialization.php | 35 ++++++++++++++ tests/Fixtures/BackedIntEnum.php | 11 +++++ tests/Fixtures/BackedStringEnum.php | 11 +++++ tests/Fixtures/EnumModel.php | 27 +++++++++++ tests/Fixtures/UnitEnum.php | 11 +++++ tests/Unit/DeserializerGeneratorTest.php | 61 ++++++++++++++++++++++++ tests/Unit/SerializerGeneratorTest.php | 31 ++++++++++++ 12 files changed, 223 insertions(+), 2 deletions(-) create mode 100644 tests/Fixtures/BackedIntEnum.php create mode 100644 tests/Fixtures/BackedStringEnum.php create mode 100644 tests/Fixtures/EnumModel.php create mode 100644 tests/Fixtures/UnitEnum.php diff --git a/CHANGELOG.md b/CHANGELOG.md index fd5e28c..c59339a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ # 3.x +# 3.1.0 (unreleased) + +* Add enum support + # 3.0.0 * Update to liip/metadata-parser 2.x. Most notable changes: diff --git a/composer.json b/composer.json index 9dc0e60..78ba58a 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "require": { "php": "^8.0", "ext-json": "*", - "liip/metadata-parser": "^2.0", + "liip/metadata-parser": "^2.1.0", "pnz/json-exception": "^1.0", "symfony/filesystem": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0", "symfony/finder": "^4.4 || ^5.0 || ^6.0 || ^7.0 || ^8.0", diff --git a/src/DeserializerGenerator.php b/src/DeserializerGenerator.php index f01ced6..e4a2302 100644 --- a/src/DeserializerGenerator.php +++ b/src/DeserializerGenerator.php @@ -10,6 +10,7 @@ use Liip\MetadataParser\Metadata\PropertyType; use Liip\MetadataParser\Metadata\PropertyTypeClass; use Liip\MetadataParser\Metadata\PropertyTypeDateTime; +use Liip\MetadataParser\Metadata\PropertyTypeEnum; use Liip\MetadataParser\Metadata\PropertyTypeIterable; use Liip\MetadataParser\Metadata\PropertyTypePrimitive; use Liip\MetadataParser\Metadata\PropertyTypeUnion; @@ -256,6 +257,9 @@ private function generateInnerCodeForFieldType( case $type instanceof PropertyTypeUnknown: return $this->templating->renderAssignJsonDataToField((string) $modelPropertyPath, (string) $arrayPath); + case $type instanceof PropertyTypeEnum: + return $this->generateCodeForEnumField($type, $modelPropertyPath, $arrayPath); + case $type instanceof PropertyTypeClass: return $this->generateCodeForClass($type->getClassMetadata(), $arrayPath, $modelPropertyPath, $stack); @@ -346,6 +350,10 @@ private function generateCodeForArray( $innerCode = $this->generateCodeForArray($subType, $arrayPropertyPath, $modelPropertyPath, $stack); break; + case $subType instanceof PropertyTypeEnum: + $innerCode = $this->generateCodeForEnumField($subType, $modelPropertyPath, $arrayPropertyPath); + break; + case $subType instanceof PropertyTypeClass: $innerCode = $this->generateCodeForClass($subType->getClassMetadata(), $arrayPropertyPath, $modelPropertyPath, $stack); break; @@ -387,6 +395,18 @@ private function generateCodeForArrayCollection( return $innerCode.$this->templating->renderArrayCollection((string) $modelPath, (string) $tmpVariable); } + private function generateCodeForEnumField( + PropertyTypeEnum $type, + ModelPath $modelPath, + ArrayPath $arrayPath, + ): string { + if ($type->shouldSerializeAsValue()) { + return $this->templating->renderAssignBackedEnum($type->getClassName(), (string) $modelPath, (string) $arrayPath); + } + + return $this->templating->renderAssignUnitEnum($type->getClassName(), (string) $modelPath, (string) $arrayPath); + } + /** * @param list $classesToGenerate */ diff --git a/src/Recursion.php b/src/Recursion.php index e6fab3e..1d35dc7 100644 --- a/src/Recursion.php +++ b/src/Recursion.php @@ -48,7 +48,7 @@ private static function getClassNameFromProperty(PropertyMetadata $propertyMetad $type = $type->getLeafType(); } - if (!($type instanceof PropertyTypeClass)) { + if (!$type instanceof PropertyTypeClass) { return null; } diff --git a/src/SerializerGenerator.php b/src/SerializerGenerator.php index 8adcfba..10d8912 100644 --- a/src/SerializerGenerator.php +++ b/src/SerializerGenerator.php @@ -10,6 +10,7 @@ use Liip\MetadataParser\Metadata\PropertyType; use Liip\MetadataParser\Metadata\PropertyTypeClass; use Liip\MetadataParser\Metadata\PropertyTypeDateTime; +use Liip\MetadataParser\Metadata\PropertyTypeEnum; use Liip\MetadataParser\Metadata\PropertyTypeIterable; use Liip\MetadataParser\Metadata\PropertyTypePrimitive; use Liip\MetadataParser\Metadata\PropertyTypeUnion; @@ -229,6 +230,11 @@ private function generateCodeForFieldType( // for arrays of scalars, copy the field even when its an empty array return $this->templating->renderAssign($fieldPath, $modelPropertyPath); + case $type instanceof PropertyTypeEnum: + $valueAccess = $type->shouldSerializeAsValue() ? '->value' : '->name'; + + return $this->templating->renderAssign($fieldPath, $modelPropertyPath.$valueAccess); + case $type instanceof PropertyTypeClass: return $this->generateCodeForClass($type->getClassMetadata(), $apiVersion, $serializerGroups, $fieldPath, $modelPropertyPath, $stack); @@ -268,6 +274,10 @@ private function generateCodeForArray( $innerCode = $this->generateCodeForArray($subType, $apiVersion, $serializerGroups, $arrayPath.'['.$index.']', $modelPath.'['.$index.']', $stack); break; + case $subType instanceof PropertyTypeEnum: + $innerCode = $this->generateCodeForFieldType($subType, $apiVersion, $serializerGroups, $arrayPath.'['.$index.']', $modelPath.'['.$index.']', $stack); + break; + case $subType instanceof PropertyTypeClass: $innerCode = $this->generateCodeForClass($subType->getClassMetadata(), $apiVersion, $serializerGroups, $arrayPath.'['.$index.']', $modelPath.'['.$index.']', $stack); break; diff --git a/src/Template/Deserialization.php b/src/Template/Deserialization.php index 2a4a7a5..f1fa702 100644 --- a/src/Template/Deserialization.php +++ b/src/Template/Deserialization.php @@ -156,6 +156,23 @@ function {{functionName}}(array {{jsonPath}}): {{className}} private const TMPL_UNSET = <<<'EOT' unset({{variableNames|join(', ')}}); +EOT; + + private const TMPL_ASSIGN_BACKED_ENUM = <<<'EOT' +{{modelPath}} = {{enumClass}}::from({{jsonPath}}); + +EOT; + + private const TMPL_ASSIGN_UNIT_ENUM = <<<'EOT' +{{modelPath}} = (static function (string $n): {{enumClass}} { + foreach ({{enumClass}}::cases() as $case) { + if ($case->name === $n) { + return $case; + } + } + throw new \ValueError("'$n' is not a valid name for enum {{enumClass}}"); +})({{jsonPath}}); + EOT; private const TMPL_EXTRACT = '{{jsonPath}} ?? {{default}}'; @@ -315,6 +332,24 @@ public function renderAssignDateTimeFromFormat(bool $immutable, string $modelPat ]); } + public function renderAssignBackedEnum(string $enumClass, string $modelPath, string $jsonPath): string + { + return $this->render(self::TMPL_ASSIGN_BACKED_ENUM, [ + 'enumClass' => $enumClass, + 'modelPath' => $modelPath, + 'jsonPath' => $jsonPath, + ]); + } + + public function renderAssignUnitEnum(string $enumClass, string $modelPath, string $jsonPath): string + { + return $this->render(self::TMPL_ASSIGN_UNIT_ENUM, [ + 'enumClass' => $enumClass, + 'modelPath' => $modelPath, + 'jsonPath' => $jsonPath, + ]); + } + public function renderExtract(string $jsonPath, string $default = 'null'): string { return $this->render(self::TMPL_EXTRACT, [ diff --git a/tests/Fixtures/BackedIntEnum.php b/tests/Fixtures/BackedIntEnum.php new file mode 100644 index 0000000..6291805 --- /dev/null +++ b/tests/Fixtures/BackedIntEnum.php @@ -0,0 +1,11 @@ +')] + public ?BackedStringEnum $backedString = null; + + public ?BackedStringEnum $backedStringWithoutAttribute = null; + + #[Serializer\Type('enum<'.BackedStringEnum::class.", 'name'>")] + public ?BackedStringEnum $backedStringAsName = null; + + #[Serializer\Type('enum<'.BackedIntEnum::class.'>')] + public ?BackedIntEnum $backedInt = null; + + #[Serializer\Type('enum<'.UnitEnum::class.'>')] + public ?UnitEnum $unit = null; + + #[Serializer\Type('array>')] + public ?array $backedStringArray = null; +} diff --git a/tests/Fixtures/UnitEnum.php b/tests/Fixtures/UnitEnum.php new file mode 100644 index 0000000..27863c5 --- /dev/null +++ b/tests/Fixtures/UnitEnum.php @@ -0,0 +1,11 @@ +postCalled); } + public function testEnum(): void + { + if (\PHP_VERSION_ID < 80100) { + self::markTestSkipped('Enum types are only supported in PHP 8.1 or newer'); + } + + $functionName = 'deserialize_Tests_Liip_Serializer_Fixtures_EnumModel'; + self::generateDeserializer(self::$metadataBuilder, EnumModel::class, $functionName); + + $input = [ + 'backed_string' => 'H', + 'backed_string_as_name' => 'Hearts', + 'backed_string_without_attribute' => 'D', + 'backed_int' => 1, + 'unit' => 'North', + 'backed_string_array' => ['H', 'D'], + ]; + + /** @var EnumModel $model */ + $model = $functionName($input); + + self::assertInstanceOf(EnumModel::class, $model); + self::assertSame(BackedStringEnum::Hearts, $model->backedString); + self::assertSame(BackedStringEnum::Hearts, $model->backedStringAsName); + self::assertSame(BackedStringEnum::Diamonds, $model->backedStringWithoutAttribute); + self::assertSame(BackedIntEnum::Low, $model->backedInt); + self::assertSame(UnitEnum::North, $model->unit); + self::assertSame([BackedStringEnum::Hearts, BackedStringEnum::Diamonds], $model->backedStringArray); + } + + public function testEnumNullValues(): void + { + if (\PHP_VERSION_ID < 80100) { + self::markTestSkipped('Enum types are only supported in PHP 8.1 or newer'); + } + + $functionName = 'deserialize_Tests_Liip_Serializer_Fixtures_EnumModel'; + self::generateDeserializer(self::$metadataBuilder, EnumModel::class, $functionName); + + $input = [ + 'backed_string' => null, + 'backed_string_as_name' => null, + 'backed_int' => null, + 'unit' => null, + 'backed_string_array' => null, + ]; + + /** @var EnumModel $model */ + $model = $functionName($input); + + self::assertInstanceOf(EnumModel::class, $model); + self::assertNull($model->backedString); + self::assertNull($model->backedInt); + self::assertNull($model->unit); + self::assertNull($model->backedStringArray); + } + public function testArraysWithUnknownSubType(): void { $functionName = 'deserialize_Tests_Liip_Serializer_Fixtures_UnknownArraySubType'; diff --git a/tests/Unit/SerializerGeneratorTest.php b/tests/Unit/SerializerGeneratorTest.php index 68ac976..03a243d 100644 --- a/tests/Unit/SerializerGeneratorTest.php +++ b/tests/Unit/SerializerGeneratorTest.php @@ -12,12 +12,15 @@ use Liip\MetadataParser\ModelParser\ReflectionParser; use Tests\Liip\Serializer\Fixtures\AccessorOrder; use Tests\Liip\Serializer\Fixtures\AccessorOrderInherit; +use Tests\Liip\Serializer\Fixtures\BackedIntEnum; +use Tests\Liip\Serializer\Fixtures\BackedStringEnum; use Tests\Liip\Serializer\Fixtures\ComplexUnionTyping; use Tests\Liip\Serializer\Fixtures\ContainsPrivateProperty; use Tests\Liip\Serializer\Fixtures\DiscriminatorAuthor; use Tests\Liip\Serializer\Fixtures\DiscriminatorComment; use Tests\Liip\Serializer\Fixtures\DiscriminatorDependency; use Tests\Liip\Serializer\Fixtures\DiscriminatorFirstChild; +use Tests\Liip\Serializer\Fixtures\EnumModel; use Tests\Liip\Serializer\Fixtures\InaccessiblePrivateProperty; use Tests\Liip\Serializer\Fixtures\Inheritance; use Tests\Liip\Serializer\Fixtures\ListModel; @@ -28,6 +31,7 @@ use Tests\Liip\Serializer\Fixtures\PrimitiveUnionTyping; use Tests\Liip\Serializer\Fixtures\PrivateProperty; use Tests\Liip\Serializer\Fixtures\RecursionModel; +use Tests\Liip\Serializer\Fixtures\UnitEnum; use Tests\Liip\Serializer\Fixtures\UnknownArraySubType; use Tests\Liip\Serializer\Fixtures\Versions; use Tests\Liip\Serializer\Fixtures\VirtualProperties; @@ -544,6 +548,33 @@ public function testVersioning(): void self::assertSame($expected, $data, 'no version'); } + public function testEnum(): void + { + if (\PHP_VERSION_ID < 80100) { + self::markTestSkipped('Enum types are only supported in PHP 8.1 or newer'); + } + + $functionName = 'serialize_Tests_Liip_Serializer_Fixtures_EnumModel'; + self::generateSerializers(self::$metadataBuilder, EnumModel::class, [$functionName], ['']); + + $model = new EnumModel(); + $model->backedString = BackedStringEnum::Hearts; + $model->backedStringAsName = BackedStringEnum::Hearts; + $model->backedStringWithoutAttribute = BackedStringEnum::Diamonds; + $model->backedInt = BackedIntEnum::Low; + $model->unit = UnitEnum::North; + $model->backedStringArray = [BackedStringEnum::Hearts, BackedStringEnum::Diamonds]; + + $data = $functionName($model); + + self::assertSame('H', $data['backed_string']); + self::assertSame('Hearts', $data['backed_string_as_name']); + self::assertSame('D', $data['backed_string_without_attribute']); + self::assertSame(1, $data['backed_int']); + self::assertSame('North', $data['unit']); + self::assertSame(['H', 'D'], $data['backed_string_array']); + } + public function testInaccessibleProperty(): void { $this->expectException(\Exception::class); From d680901ff18e116aec79d70e45da343fe3050482 Mon Sep 17 00:00:00 2001 From: Martin Parsiegla Date: Wed, 1 Apr 2026 16:06:37 +0200 Subject: [PATCH 3/3] Drop support for PHP 8.1 The new version of `metadata-parser` no longer supports PHP 8.0, so we also have to drop the support here. --- .github/workflows/ci.yml | 4 ++-- CHANGELOG.md | 1 + composer.json | 4 ++-- phpstan.tests.neon | 2 ++ tests/Unit/DeserializerGeneratorTest.php | 13 +++---------- tests/Unit/SerializerGeneratorTest.php | 9 +++------ 6 files changed, 13 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb66165..592c205 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,9 +14,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ['8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] + php-version: ['8.1', '8.2', '8.3', '8.4', '8.5'] include: - - php-version: '8.0' + - php-version: '8.1' composer-flags: '--prefer-stable --prefer-lowest' steps: - name: Check out code into the workspace diff --git a/CHANGELOG.md b/CHANGELOG.md index c59339a..166a3d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ # 3.1.0 (unreleased) * Add enum support +* Drop support for PHP 8.0 # 3.0.0 diff --git a/composer.json b/composer.json index 78ba58a..ef350c4 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "issues": "https://github.com/liip/serializer/issues" }, "require": { - "php": "^8.0", + "php": "^8.1", "ext-json": "*", "liip/metadata-parser": "^2.1.0", "pnz/json-exception": "^1.0", @@ -25,7 +25,7 @@ }, "require-dev": { "doctrine/collections": "^1.6", - "friendsofphp/php-cs-fixer": "^3.90.0", + "friendsofphp/php-cs-fixer": "^3.94.2", "jms/serializer": "^1.13 || ^2 || ^3", "phpstan/phpstan": "^2.1.44", "phpstan/phpstan-phpunit": "^2.0.16", diff --git a/phpstan.tests.neon b/phpstan.tests.neon index 22a343c..dcb6c26 100644 --- a/phpstan.tests.neon +++ b/phpstan.tests.neon @@ -1,3 +1,5 @@ parameters: excludePaths: - *serialize_Tests_Liip_Serializer_Fixtures_* + # Excluded until the minimum version required from jms/serializer is set to >= 3.31.0 + - tests/Fixtures/ComplexUnionTyping.php diff --git a/tests/Unit/DeserializerGeneratorTest.php b/tests/Unit/DeserializerGeneratorTest.php index e88dfa3..958f319 100644 --- a/tests/Unit/DeserializerGeneratorTest.php +++ b/tests/Unit/DeserializerGeneratorTest.php @@ -6,6 +6,7 @@ use Doctrine\Common\Annotations\AnnotationReader; use Doctrine\Common\Collections\ArrayCollection; +use JMS\Serializer\Annotation\UnionDiscriminator; use Liip\MetadataParser\Builder; use Liip\MetadataParser\ModelParser\JMSParser; use Liip\MetadataParser\ModelParser\PhpDocParser; @@ -312,8 +313,8 @@ public function testDiscriminator(): void public function testComplexUnionDiscriminator(): void { - if (\PHP_VERSION_ID < 80100) { - self::markTestSkipped('Intersection property types are only supported in PHP 8.1 or newer'); + if (!class_exists(UnionDiscriminator::class)) { + self::markTestSkipped('UnionDiscriminator attribute from JMS missing'); } $functionName = 'deserialize_Tests_Liip_Serializer_Fixtures_ComplexUnionTyping'; @@ -388,10 +389,6 @@ public function testPostDeserialize(): void public function testEnum(): void { - if (\PHP_VERSION_ID < 80100) { - self::markTestSkipped('Enum types are only supported in PHP 8.1 or newer'); - } - $functionName = 'deserialize_Tests_Liip_Serializer_Fixtures_EnumModel'; self::generateDeserializer(self::$metadataBuilder, EnumModel::class, $functionName); @@ -418,10 +415,6 @@ public function testEnum(): void public function testEnumNullValues(): void { - if (\PHP_VERSION_ID < 80100) { - self::markTestSkipped('Enum types are only supported in PHP 8.1 or newer'); - } - $functionName = 'deserialize_Tests_Liip_Serializer_Fixtures_EnumModel'; self::generateDeserializer(self::$metadataBuilder, EnumModel::class, $functionName); diff --git a/tests/Unit/SerializerGeneratorTest.php b/tests/Unit/SerializerGeneratorTest.php index 03a243d..9dbaaeb 100644 --- a/tests/Unit/SerializerGeneratorTest.php +++ b/tests/Unit/SerializerGeneratorTest.php @@ -6,6 +6,7 @@ use Doctrine\Common\Annotations\AnnotationReader; use Doctrine\Common\Collections\ArrayCollection; +use JMS\Serializer\Annotation\UnionDiscriminator; use Liip\MetadataParser\Builder; use Liip\MetadataParser\ModelParser\JMSParser; use Liip\MetadataParser\ModelParser\PhpDocParser; @@ -375,8 +376,8 @@ public function testDiscriminator(): void public function testComplexUnionDiscriminator(): void { - if (\PHP_VERSION_ID < 80100) { - self::markTestSkipped('Intersection property types are only supported in PHP 8.1 or newer'); + if (!class_exists(UnionDiscriminator::class)) { + self::markTestSkipped('UnionDiscriminator attribute from JMS missing'); } $functionName = 'serialize_Tests_Liip_Serializer_Fixtures_ComplexUnionTyping_2'; @@ -550,10 +551,6 @@ public function testVersioning(): void public function testEnum(): void { - if (\PHP_VERSION_ID < 80100) { - self::markTestSkipped('Enum types are only supported in PHP 8.1 or newer'); - } - $functionName = 'serialize_Tests_Liip_Serializer_Fixtures_EnumModel'; self::generateSerializers(self::$metadataBuilder, EnumModel::class, [$functionName], ['']);