From 41d98b8953b20d0080a751de97e915a23c76fba2 Mon Sep 17 00:00:00 2001 From: Andreas Fernandez Date: Sun, 28 May 2023 13:10:06 +0200 Subject: [PATCH] [BUGFIX] Update `symfony/property-info` to v6.2.11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handling of collections without a dedicated type has changed in `symfony/property-info` with v6.2.11, [1] seems to be the offensive commit. This should be backward compatible, as only string|int make sense for array keys and therefore is the same for array-like object annotation syntax. We raise the version constraint for `symfony/property-info` package to a slightly higher patchlevel version to ensure consistent behaviour. This is done for shipped version and the core development, therefore the raises are also added to the corresponding extension composer.json files. Used command(s): > composer require --no-update \ -d typo3/sysext/extbase \ "symfony/property-info":"^6.2.11" > composer require \ "symfony/property-info":"^6.2.11" [1] https://github.com/symfony/symfony/pull/49557 Resolves: #100927 Releases: main, 12.4 Change-Id: I1465206414cd7e596d0852ed4288c5013db23c2d Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79151 Tested-by: core-ci Reviewed-by: Stefan Bürk Tested-by: Stefan Bürk Reviewed-by: Oliver Klee Tested-by: Oliver Klee --- .../Property/PropertyWithTypeDeclarationsTest.php | 4 +++- .../Property/PropertyWithoutTypeDeclarationsTest.php | 5 +++-- Tests/Unit/Reflection/ClassSchema/PropertyTest.php | 4 +++- composer.json | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Tests/Unit/Reflection/ClassSchema/Property/PropertyWithTypeDeclarationsTest.php b/Tests/Unit/Reflection/ClassSchema/Property/PropertyWithTypeDeclarationsTest.php index 006ffe55..c6d021c1 100644 --- a/Tests/Unit/Reflection/ClassSchema/Property/PropertyWithTypeDeclarationsTest.php +++ b/Tests/Unit/Reflection/ClassSchema/Property/PropertyWithTypeDeclarationsTest.php @@ -181,7 +181,9 @@ public function objectStorageWithArraySyntaxWithoutKeyValueTypeProperty(): void self::assertSame('object', $propertyTypes[0]->getBuiltinType()); self::assertSame(ObjectStorage::class, $propertyTypes[0]->getClassName()); - self::assertCount(0, $propertyTypes[0]->getCollectionKeyTypes()); + self::assertCount(2, $propertyTypes[0]->getCollectionKeyTypes()); + self::assertSame('string', $propertyTypes[0]->getCollectionKeyTypes()[0]->getBuiltinType()); + self::assertSame('int', $propertyTypes[0]->getCollectionKeyTypes()[1]->getBuiltinType()); self::assertCount(1, $propertyTypes[0]->getCollectionValueTypes()); self::assertSame('object', $propertyTypes[0]->getCollectionValueTypes()[0]->getBuiltinType()); diff --git a/Tests/Unit/Reflection/ClassSchema/Property/PropertyWithoutTypeDeclarationsTest.php b/Tests/Unit/Reflection/ClassSchema/Property/PropertyWithoutTypeDeclarationsTest.php index e9363f9b..4f92e9a1 100644 --- a/Tests/Unit/Reflection/ClassSchema/Property/PropertyWithoutTypeDeclarationsTest.php +++ b/Tests/Unit/Reflection/ClassSchema/Property/PropertyWithoutTypeDeclarationsTest.php @@ -193,8 +193,9 @@ public function objectStorageWithArraySyntaxWithoutKeyValueTypeProperty(): void self::assertTrue($propertyTypes[0]->isCollection()); self::assertSame('object', $propertyTypes[0]->getBuiltinType()); self::assertSame(ObjectStorage::class, $propertyTypes[0]->getClassName()); - - self::assertSame([], $propertyTypes[0]->getCollectionKeyTypes()); + self::assertCount(2, $propertyTypes[0]->getCollectionKeyTypes()); + self::assertSame('string', $propertyTypes[0]->getCollectionKeyTypes()[0]->getBuiltinType()); + self::assertSame('int', $propertyTypes[0]->getCollectionKeyTypes()[1]->getBuiltinType()); self::assertCount(1, $propertyTypes[0]->getCollectionValueTypes()); self::assertSame('object', $propertyTypes[0]->getCollectionValueTypes()[0]->getBuiltinType()); diff --git a/Tests/Unit/Reflection/ClassSchema/PropertyTest.php b/Tests/Unit/Reflection/ClassSchema/PropertyTest.php index a8e46e92..af0b4424 100644 --- a/Tests/Unit/Reflection/ClassSchema/PropertyTest.php +++ b/Tests/Unit/Reflection/ClassSchema/PropertyTest.php @@ -144,7 +144,9 @@ public function classSchemaDetectsTypeAndElementType(): void self::assertSame(ObjectStorage::class, $propertyType->getClassName()); - self::assertCount(0, $propertyType->getCollectionKeyTypes()); + self::assertCount(2, $propertyType->getCollectionKeyTypes()); + self::assertSame('string', $propertyType->getCollectionKeyTypes()[0]->getBuiltinType()); + self::assertSame('int', $propertyType->getCollectionKeyTypes()[1]->getBuiltinType()); self::assertCount(1, $propertyType->getCollectionValueTypes()); self::assertSame(DummyClassWithAllTypesOfProperties::class, $propertyType->getCollectionValueTypes()[0]->getClassName()); diff --git a/composer.json b/composer.json index e0f47cef..1bb5bf76 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "phpdocumentor/type-resolver": "^1.7.1", "symfony/dependency-injection": "^6.2", "symfony/property-access": "^6.2", - "symfony/property-info": "^6.2", + "symfony/property-info": "^6.2.11", "typo3/cms-core": "13.0.*@dev" }, "suggest": {