diff --git a/api/src/Metadata/Resource/Factory/UriTemplateFactory.php b/api/src/Metadata/Resource/Factory/UriTemplateFactory.php index e9b9fa763c..442bd86cb7 100644 --- a/api/src/Metadata/Resource/Factory/UriTemplateFactory.php +++ b/api/src/Metadata/Resource/Factory/UriTemplateFactory.php @@ -164,7 +164,7 @@ protected function allowsActionParameter(string $uriTemplateBase, ResourceMetada * - any uriTemplate, which doesn't start with the same $uriTemplateBase */ if ($operation instanceof HttpOperation) { - if (preg_match('/^\/?'.preg_quote($uriTemplateBase, '/').'.*\\/?{.*}\\/.+$/', $operation->getUriTemplate() ?? '')) { + if (preg_match('/^\/?'.preg_quote($uriTemplateBase, '/').'.*\/?{.*}\/.+$/', $operation->getUriTemplate() ?? '')) { return true; } } diff --git a/api/src/Util/ClassInfoTrait.php b/api/src/Util/ClassInfoTrait.php index 2ed9318530..af5f150d49 100644 --- a/api/src/Util/ClassInfoTrait.php +++ b/api/src/Util/ClassInfoTrait.php @@ -29,7 +29,7 @@ private function getObjectClass(object $object): string { */ private function getRealClassName(string $className): string { // __CG__: Doctrine Common Marker for Proxy (ODM < 2.0 and ORM < 3.0) - $positionCg = strrpos($className, '\\__CG__\\'); + $positionCg = strrpos($className, '\__CG__\\'); if (false === $positionCg) { return $className; diff --git a/api/tests/Api/ContentNodes/RootColumnLayout/UpdateRootColumnLayoutTest.php b/api/tests/Api/ContentNodes/RootColumnLayout/UpdateRootColumnLayoutTest.php index e9737718f3..80f18a63bd 100644 --- a/api/tests/Api/ContentNodes/RootColumnLayout/UpdateRootColumnLayoutTest.php +++ b/api/tests/Api/ContentNodes/RootColumnLayout/UpdateRootColumnLayoutTest.php @@ -62,7 +62,7 @@ public function testPatchColumnLayoutValidatesMissingParent() { 'violations' => [ [ 'propertyPath' => 'parent', - 'message' => 'This value should be of type App\\Entity\\ContentNode.', + 'message' => 'This value should be of type App\Entity\ContentNode.', ], ], ]); diff --git a/api/tests/Api/FirewallTest.php b/api/tests/Api/FirewallTest.php index f0c456d2cc..12442d5254 100644 --- a/api/tests/Api/FirewallTest.php +++ b/api/tests/Api/FirewallTest.php @@ -102,7 +102,7 @@ private static function getEndPoints() { $responseArray = $response->toArray(); $onlyUrls = array_map(fn (array $item) => $item['href'], $responseArray['_links']); - return array_map(fn (string $uriTemplate) => preg_replace('/\\{[^}]*}/', '', $uriTemplate), $onlyUrls); + return array_map(fn (string $uriTemplate) => preg_replace('/\{[^}]*}/', '', $uriTemplate), $onlyUrls); } private static function isProtectedByFirewall(mixed $endpoint): bool { diff --git a/api/tests/Api/SnapshotTests/EndpointPerformanceTest.php b/api/tests/Api/SnapshotTests/EndpointPerformanceTest.php index 9f1ade92c5..bf6c72231d 100644 --- a/api/tests/Api/SnapshotTests/EndpointPerformanceTest.php +++ b/api/tests/Api/SnapshotTests/EndpointPerformanceTest.php @@ -216,7 +216,7 @@ private static function getCollectionEndpoints() { $responseArray = $response->toArray(); $onlyUrls = array_map(fn (array $item) => $item['href'], $responseArray['_links']); - $withoutParameters = array_map(fn (string $uriTemplate) => preg_replace('/\\{[^}]*}/', '', $uriTemplate), $onlyUrls); + $withoutParameters = array_map(fn (string $uriTemplate) => preg_replace('/\{[^}]*}/', '', $uriTemplate), $onlyUrls); $normalEndpoints = array_filter($withoutParameters, function (string $endpoint) { // @noinspection PhpDuplicateMatchArmBodyInspection return match ($endpoint) { diff --git a/api/tests/Api/SnapshotTests/ResponseSnapshotTest.php b/api/tests/Api/SnapshotTests/ResponseSnapshotTest.php index 84d0636807..a329fe240b 100644 --- a/api/tests/Api/SnapshotTests/ResponseSnapshotTest.php +++ b/api/tests/Api/SnapshotTests/ResponseSnapshotTest.php @@ -102,7 +102,7 @@ public static function getCollectionEndpoints() { $responseArray = $response->toArray(); $onlyUrls = array_map(fn (array $item) => $item['href'], $responseArray['_links']); - $withoutParameters = array_map(fn (string $uriTemplate) => preg_replace('/\\{[^}]*}/', '', $uriTemplate), $onlyUrls); + $withoutParameters = array_map(fn (string $uriTemplate) => preg_replace('/\{[^}]*}/', '', $uriTemplate), $onlyUrls); $normalEndpoints = array_filter($withoutParameters, function (string $endpoint) { // @noinspection PhpDuplicateMatchArmBodyInspection return match ($endpoint) { diff --git a/api/tests/HttpCache/PurgeHttpCacheListenerTest.php b/api/tests/HttpCache/PurgeHttpCacheListenerTest.php index e34cc6330c..eaa4b29c3d 100644 --- a/api/tests/HttpCache/PurgeHttpCacheListenerTest.php +++ b/api/tests/HttpCache/PurgeHttpCacheListenerTest.php @@ -75,13 +75,13 @@ protected function setUp(): void { $classMetadataProphecy = $this->prophesize(ClassMetadata::class); $classMetadataProphecy->getAssociationMappings()->willReturn([ 'relatedDummy' => [ - 'targetEntity' => 'App\\Tests\\HttpCache\\Entity\\RelatedDummy', + 'targetEntity' => 'App\Tests\HttpCache\Entity\RelatedDummy', 'isOwningSide' => true, 'inversedBy' => 'dummies', 'mappedBy' => null, ], 'relatedOwningDummy' => [ - 'targetEntity' => 'App\\Tests\\HttpCache\\Entity\\RelatedOwningDummy', + 'targetEntity' => 'App\Tests\HttpCache\Entity\RelatedOwningDummy', 'isOwningSide' => true, 'inversedBy' => 'ownedDummy', 'mappedBy' => null, diff --git a/api/tests/Serializer/Normalizer/RelatedCollectionLinkNormalizerTest.php b/api/tests/Serializer/Normalizer/RelatedCollectionLinkNormalizerTest.php index 82219f5ef3..164c4987ab 100644 --- a/api/tests/Serializer/Normalizer/RelatedCollectionLinkNormalizerTest.php +++ b/api/tests/Serializer/Normalizer/RelatedCollectionLinkNormalizerTest.php @@ -189,7 +189,7 @@ public function testNormalizeReplacesLinkArrayWithSingleFilteredCollectionLinkBa $this->uriTemplateFactory ->expects($this->once()) ->method('createFromResourceClass') - ->with('App\\Entity\\DummyEntity') + ->with('App\Entity\DummyEntity') ->willReturn(['/relatedEntities{/id}{?test_param}', true]) ; $this->uriTemplate @@ -498,7 +498,7 @@ public function getFilterValue(): string { return ''; } - #[RelatedCollectionLink('App\\Entity\\DummyEntity', ['test_param' => 'filterValue'])] + #[RelatedCollectionLink('App\Entity\DummyEntity', ['test_param' => 'filterValue'])] public function getRelatedEntities(): array { return []; }