diff --git a/src/Bridge/Doctrine/MongoDbOdm/PropertyHelperTrait.php b/src/Bridge/Doctrine/MongoDbOdm/PropertyHelperTrait.php index 70060d6faa4..c71b35255ea 100644 --- a/src/Bridge/Doctrine/MongoDbOdm/PropertyHelperTrait.php +++ b/src/Bridge/Doctrine/MongoDbOdm/PropertyHelperTrait.php @@ -61,7 +61,7 @@ protected function addLookupsForNestedProperty(string $property, Builder $aggreg } if ($classMetadata->hasReference($association)) { - $propertyAlias = "${association}_lkup"; + $propertyAlias = "{$association}_lkup"; // previous_association_lkup.association $localField = "$alias$association"; // previous_association_lkup.association_lkup diff --git a/src/Bridge/Elasticsearch/DataProvider/Filter/AbstractSearchFilter.php b/src/Bridge/Elasticsearch/DataProvider/Filter/AbstractSearchFilter.php index 6596dd6eeba..6ea7d89546b 100644 --- a/src/Bridge/Elasticsearch/DataProvider/Filter/AbstractSearchFilter.php +++ b/src/Bridge/Elasticsearch/DataProvider/Filter/AbstractSearchFilter.php @@ -104,7 +104,7 @@ public function getDescription(string $resourceClass): array continue; } - foreach ([$property, "${property}[]"] as $filterParameterName) { + foreach ([$property, "{$property}[]"] as $filterParameterName) { $description[$filterParameterName] = [ 'property' => $property, 'type' => $hasAssociation ? 'string' : $this->getPhpType($type), @@ -138,7 +138,7 @@ protected function getPhpType(Type $type): string return \DateTimeInterface::class; } - // no break + // no break default: return 'string'; } diff --git a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php index 69e468b8248..efcc7e099ae 100644 --- a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php +++ b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php @@ -32,7 +32,7 @@ * * @author Amrouche Hamza */ -#[AsCommand(name: 'swagger:export', description: 'Dump the Swagger v2 documentation')] +#[AsCommand(name: 'api:swagger:export', description: 'Dump the Swagger v2 documentation')] final class SwaggerCommand extends Command { /** diff --git a/src/Bridge/Symfony/Messenger/DataTransformer.php b/src/Bridge/Symfony/Messenger/DataTransformer.php index 181589f4a82..9b0e75c5504 100644 --- a/src/Bridge/Symfony/Messenger/DataTransformer.php +++ b/src/Bridge/Symfony/Messenger/DataTransformer.php @@ -65,11 +65,11 @@ public function supportsTransformation($data, string $to, array $context = []): } return 'input' === $metadata->getTypedOperationAttribute( - $context['operation_type'], - $context[$context['operation_type'].'_operation_name'] ?? '', - 'messenger', - null, - true - ); + $context['operation_type'], + $context[$context['operation_type'].'_operation_name'] ?? '', + 'messenger', + null, + true + ); } } diff --git a/src/Bridge/Symfony/Validator/EventListener/ValidationExceptionListener.php b/src/Bridge/Symfony/Validator/EventListener/ValidationExceptionListener.php index 365efda6efd..d740fe2647a 100644 --- a/src/Bridge/Symfony/Validator/EventListener/ValidationExceptionListener.php +++ b/src/Bridge/Symfony/Validator/EventListener/ValidationExceptionListener.php @@ -61,13 +61,13 @@ public function onKernelException(ExceptionEvent $event): void $format = ErrorFormatGuesser::guessErrorFormat($event->getRequest(), $this->errorFormats); $event->setResponse(new Response( - $this->serializer->serialize($exception instanceof ValidationException ? $exception->getConstraintViolationList() : $exception, $format['key']), - $statusCode, - [ - 'Content-Type' => sprintf('%s; charset=utf-8', $format['value'][0]), - 'X-Content-Type-Options' => 'nosniff', - 'X-Frame-Options' => 'deny', - ] + $this->serializer->serialize($exception instanceof ValidationException ? $exception->getConstraintViolationList() : $exception, $format['key']), + $statusCode, + [ + 'Content-Type' => sprintf('%s; charset=utf-8', $format['value'][0]), + 'X-Content-Type-Options' => 'nosniff', + 'X-Frame-Options' => 'deny', + ] )); } } diff --git a/src/EventListener/AddFormatListener.php b/src/EventListener/AddFormatListener.php index 840b0f663d6..f30459fb770 100644 --- a/src/EventListener/AddFormatListener.php +++ b/src/EventListener/AddFormatListener.php @@ -66,9 +66,9 @@ public function onKernelRequest(RequestEvent $event): void { $request = $event->getRequest(); if ( - !($request->attributes->has('_api_resource_class') - || $request->attributes->getBoolean('_api_respond', false) - || $request->attributes->getBoolean('_graphql', false)) + !($request->attributes->has('_api_resource_class') + || $request->attributes->getBoolean('_api_respond', false) + || $request->attributes->getBoolean('_graphql', false)) ) { return; } diff --git a/src/OpenApi/Factory/OpenApiFactory.php b/src/OpenApi/Factory/OpenApiFactory.php index 69dfdf68382..51a3d84ae80 100644 --- a/src/OpenApi/Factory/OpenApiFactory.php +++ b/src/OpenApi/Factory/OpenApiFactory.php @@ -421,12 +421,12 @@ private function getFiltersParameters(ResourceMetadata $resourceMetadata, string $data['openapi']['allowEmptyValue'] ?? true, $schema, 'array' === $schema['type'] && \in_array($data['type'], - [Type::BUILTIN_TYPE_ARRAY, Type::BUILTIN_TYPE_OBJECT], true) ? 'deepObject' : 'form', + [Type::BUILTIN_TYPE_ARRAY, Type::BUILTIN_TYPE_OBJECT], true) ? 'deepObject' : 'form', $data['openapi']['explode'] ?? ('array' === $schema['type']), $data['openapi']['allowReserved'] ?? false, $data['openapi']['example'] ?? null, isset($data['openapi']['examples'] - ) ? new \ArrayObject($data['openapi']['examples']) : null); + ) ? new \ArrayObject($data['openapi']['examples']) : null); } } diff --git a/src/Swagger/Serializer/DocumentationNormalizer.php b/src/Swagger/Serializer/DocumentationNormalizer.php index 2357f7bf888..f6b0ebe1d88 100644 --- a/src/Swagger/Serializer/DocumentationNormalizer.php +++ b/src/Swagger/Serializer/DocumentationNormalizer.php @@ -301,7 +301,7 @@ private function getPathOperation(bool $v3, string $operationName, array $operat return $this->updatePostOperation($v3, $pathOperation, $requestMimeTypes, $responseMimeTypes, $operationType, $resourceMetadata, $resourceClass, $resourceShortName, $operationName, $definitions, $links); case 'PATCH': $pathOperation['summary'] ?? $pathOperation['summary'] = sprintf('Updates the %s resource.', $resourceShortName); - // no break + // no break case 'PUT': return $this->updatePutOperation($v3, $pathOperation, $requestMimeTypes, $responseMimeTypes, $operationType, $resourceMetadata, $resourceClass, $resourceShortName, $operationName, $definitions); case 'DELETE': diff --git a/tests/Annotation/ApiFilterTest.php b/tests/Annotation/ApiFilterTest.php index 0b57224fce5..f58e3f5254c 100644 --- a/tests/Annotation/ApiFilterTest.php +++ b/tests/Annotation/ApiFilterTest.php @@ -65,7 +65,7 @@ public function testAssignationAttribute() $filter = eval(<<<'PHP' return new \ApiPlatform\Core\Annotation\ApiFilter(\ApiPlatform\Core\Tests\Fixtures\DummyFilter::class, strategy: 'test', properties: ['one', 'two'], arguments: ['args']); PHP -); + ); $this->assertEquals($filter->filterClass, DummyFilter::class); $this->assertEquals($filter->strategy, 'test'); diff --git a/tests/Bridge/Symfony/Validator/Exception/ValidationExceptionTest.php b/tests/Bridge/Symfony/Validator/Exception/ValidationExceptionTest.php index 5a7e3261604..aeae0bd8769 100644 --- a/tests/Bridge/Symfony/Validator/Exception/ValidationExceptionTest.php +++ b/tests/Bridge/Symfony/Validator/Exception/ValidationExceptionTest.php @@ -39,6 +39,6 @@ public function testToString() message 1 foo: message 2 TXT -), $e->__toString()); + ), $e->__toString()); } } diff --git a/tests/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php b/tests/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php index a828f8bccf0..385cf6735af 100644 --- a/tests/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php +++ b/tests/Bridge/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php @@ -257,8 +257,8 @@ public function testCreateWithPropertyLengthRestriction(): void $decoratedPropertyMetadataFactory = $this->prophesize(PropertyMetadataFactoryInterface::class); $property = 'dummy'; $decoratedPropertyMetadataFactory->create(DummyValidatedEntity::class, $property, [])->willReturn( - new PropertyMetadata(new Type(Type::BUILTIN_TYPE_STRING)) - )->shouldBeCalled(); + new PropertyMetadata(new Type(Type::BUILTIN_TYPE_STRING)) + )->shouldBeCalled(); $lengthRestrictions = new PropertySchemaLengthRestriction(); $validatorPropertyMetadataFactory = new ValidatorPropertyMetadataFactory( @@ -283,8 +283,8 @@ public function testCreateWithPropertyRegexRestriction(): void $decoratedPropertyMetadataFactory = $this->prophesize(PropertyMetadataFactoryInterface::class); $decoratedPropertyMetadataFactory->create(DummyValidatedEntity::class, 'dummy', [])->willReturn( - new PropertyMetadata() - )->shouldBeCalled(); + new PropertyMetadata() + )->shouldBeCalled(); $validationPropertyMetadataFactory = new ValidatorPropertyMetadataFactory( $validatorMetadataFactory->reveal(), $decoratedPropertyMetadataFactory->reveal(), diff --git a/tests/EventListener/RespondListenerTest.php b/tests/EventListener/RespondListenerTest.php index b02caec2ab9..7a40e9e2c20 100644 --- a/tests/EventListener/RespondListenerTest.php +++ b/tests/EventListener/RespondListenerTest.php @@ -219,7 +219,7 @@ public function testHandleResponse() $response = new Response(); $event = new ViewEvent( - $this->prophesize(HttpKernelInterface::class)->reveal(), + $this->prophesize(HttpKernelInterface::class)->reveal(), new Request([], [], ['_api_resource_class' => Dummy::class, '_api_item_operation_name' => 'get', '_api_respond' => true]), \defined(HttpKernelInterface::class.'::MAIN_REQUEST') ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST, $response diff --git a/tests/Metadata/Property/Factory/ExtractorPropertyMetadataFactoryTest.php b/tests/Metadata/Property/Factory/ExtractorPropertyMetadataFactoryTest.php index 3e396117b47..c58e282aaf1 100644 --- a/tests/Metadata/Property/Factory/ExtractorPropertyMetadataFactoryTest.php +++ b/tests/Metadata/Property/Factory/ExtractorPropertyMetadataFactoryTest.php @@ -137,12 +137,12 @@ public function testCreateWithCollectionTypedParentPropertyMetadataFactoryYaml(P $configPath = __DIR__.'/../../../Fixtures/FileConfigurations/resources.yml'; $collectionType = new Type(Type::BUILTIN_TYPE_OBJECT, - false, - ArrayCollection::class, - true, - new Type(Type::BUILTIN_TYPE_INT), - new Type(Type::BUILTIN_TYPE_OBJECT, false, RelatedDummy::class) - ); + false, + ArrayCollection::class, + true, + new Type(Type::BUILTIN_TYPE_INT), + new Type(Type::BUILTIN_TYPE_OBJECT, false, RelatedDummy::class) + ); $expectedPropertyMetadata = $expectedPropertyMetadata->withType($collectionType); $expectedPropertyMetadata = $expectedPropertyMetadata->withSubresource(new SubresourceMetadata(RelatedDummy::class, true, 1)); diff --git a/tests/Operation/Factory/SubresourceOperationFactoryTest.php b/tests/Operation/Factory/SubresourceOperationFactoryTest.php index c9ea4b2dc84..bfe0f4c0f25 100644 --- a/tests/Operation/Factory/SubresourceOperationFactoryTest.php +++ b/tests/Operation/Factory/SubresourceOperationFactoryTest.php @@ -298,11 +298,11 @@ public function testCreateWithMaxDepth() $identifiersExtractorProphecy->getIdentifiersFromResourceClass(Argument::type('string'))->willReturn(['id']); $subresourceOperationFactory = new SubresourceOperationFactory( - $resourceMetadataFactoryProphecy->reveal(), - $propertyNameCollectionFactoryProphecy->reveal(), - $propertyMetadataFactoryProphecy->reveal(), - $pathSegmentNameGeneratorProphecy->reveal(), - $identifiersExtractorProphecy->reveal() + $resourceMetadataFactoryProphecy->reveal(), + $propertyNameCollectionFactoryProphecy->reveal(), + $propertyMetadataFactoryProphecy->reveal(), + $pathSegmentNameGeneratorProphecy->reveal(), + $identifiersExtractorProphecy->reveal() ); $this->assertEquals([ @@ -638,11 +638,11 @@ public function testCreateWithEnd() $identifiersExtractorProphecy->getIdentifiersFromResourceClass(Argument::type('string'))->willReturn(['id']); $subresourceOperationFactory = new SubresourceOperationFactory( - $resourceMetadataFactoryProphecy->reveal(), - $propertyNameCollectionFactoryProphecy->reveal(), - $propertyMetadataFactoryProphecy->reveal(), - $pathSegmentNameGeneratorProphecy->reveal(), - $identifiersExtractorProphecy->reveal() + $resourceMetadataFactoryProphecy->reveal(), + $propertyNameCollectionFactoryProphecy->reveal(), + $propertyMetadataFactoryProphecy->reveal(), + $pathSegmentNameGeneratorProphecy->reveal(), + $identifiersExtractorProphecy->reveal() ); $result = $subresourceOperationFactory->create(DummyEntity::class); @@ -700,11 +700,11 @@ public function testCreateWithEndButNoCollection() $identifiersExtractorProphecy->getIdentifiersFromResourceClass(Argument::type('string'))->willReturn(['id']); $subresourceOperationFactory = new SubresourceOperationFactory( - $resourceMetadataFactoryProphecy->reveal(), - $propertyNameCollectionFactoryProphecy->reveal(), - $propertyMetadataFactoryProphecy->reveal(), - $pathSegmentNameGeneratorProphecy->reveal(), - $identifiersExtractorProphecy->reveal() + $resourceMetadataFactoryProphecy->reveal(), + $propertyNameCollectionFactoryProphecy->reveal(), + $propertyMetadataFactoryProphecy->reveal(), + $pathSegmentNameGeneratorProphecy->reveal(), + $identifiersExtractorProphecy->reveal() ); $result = $subresourceOperationFactory->create(DummyEntity::class);