Skip to content

Commit

Permalink
[BUGFIX] Update symfony/property-info to v6.2.11
Browse files Browse the repository at this point in the history
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] symfony/symfony#49557

Resolves: #100927
Releases: main, 12.4
Change-Id: I1465206414cd7e596d0852ed4288c5013db23c2d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79152
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
  • Loading branch information
andreaskienast authored and sbuerk committed May 28, 2023
1 parent f9cea7c commit ef7839a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Expand Up @@ -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());
Expand Down
Expand Up @@ -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());
Expand Down
4 changes: 3 additions & 1 deletion Tests/Unit/Reflection/ClassSchema/PropertyTest.php
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -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": "12.4.*@dev"
},
"suggest": {
Expand Down

0 comments on commit ef7839a

Please sign in to comment.