diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 6f2414a32..b8e14f420 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -20,6 +20,5 @@ file that was distributed with this source code. HEADER ], - 'trailing_comma_in_multiline' => false, ]) ->setFinder($finder); diff --git a/src/Attribute/Model.php b/src/Attribute/Model.php index 4a49bd74f..677797e8f 100644 --- a/src/Attribute/Model.php +++ b/src/Attribute/Model.php @@ -58,7 +58,7 @@ public function __construct( string $type = Generator::UNDEFINED, ?array $groups = null, array $options = [], - array $serializationContext = [] + array $serializationContext = [], ) { parent::__construct($properties + [ 'type' => $type, diff --git a/src/Attribute/Security.php b/src/Attribute/Security.php index 839fd7e7e..fe3c92d19 100644 --- a/src/Attribute/Security.php +++ b/src/Attribute/Security.php @@ -37,7 +37,7 @@ class Security extends AbstractAnnotation public function __construct( array $properties = [], ?string $name = null, - array $scopes = [] + array $scopes = [], ) { parent::__construct($properties + [ 'name' => $name, diff --git a/src/ModelDescriber/Annotations/AnnotationsReader.php b/src/ModelDescriber/Annotations/AnnotationsReader.php index 4128c7708..5f3cc5014 100644 --- a/src/ModelDescriber/Annotations/AnnotationsReader.php +++ b/src/ModelDescriber/Annotations/AnnotationsReader.php @@ -31,7 +31,7 @@ class AnnotationsReader public function __construct( ModelRegistry $modelRegistry, array $mediaTypes, - bool $useValidationGroups = false + bool $useValidationGroups = false, ) { $this->phpDocReader = new PropertyPhpDocReader(); $this->openApiAnnotationsReader = new OpenApiAnnotationsReader($modelRegistry, $mediaTypes); diff --git a/src/ModelDescriber/Annotations/ReflectionReader.php b/src/ModelDescriber/Annotations/ReflectionReader.php index 4ea3f26f9..c83890509 100644 --- a/src/ModelDescriber/Annotations/ReflectionReader.php +++ b/src/ModelDescriber/Annotations/ReflectionReader.php @@ -36,7 +36,7 @@ final class ReflectionReader */ public function updateProperty( $reflection, - OA\Property $property + OA\Property $property, ): void { // The default has been set by an Annotation or Attribute // We leave that as it is! diff --git a/src/ModelDescriber/ApplyOpenApiDiscriminatorTrait.php b/src/ModelDescriber/ApplyOpenApiDiscriminatorTrait.php index 0a83b85e9..b2a45edd1 100644 --- a/src/ModelDescriber/ApplyOpenApiDiscriminatorTrait.php +++ b/src/ModelDescriber/ApplyOpenApiDiscriminatorTrait.php @@ -41,7 +41,7 @@ protected function applyOpenApiDiscriminator( OA\Schema $schema, ModelRegistry $modelRegistry, string $discriminatorProperty, - array $typeMap + array $typeMap, ): void { $weakContext = Util::createWeakContext($schema->_context); diff --git a/src/ModelDescriber/FormModelDescriber.php b/src/ModelDescriber/FormModelDescriber.php index b51151ce9..6424372a3 100644 --- a/src/ModelDescriber/FormModelDescriber.php +++ b/src/ModelDescriber/FormModelDescriber.php @@ -53,7 +53,7 @@ public function __construct( FormFactoryInterface $formFactory, array $mediaTypes, bool $useValidationGroups, - bool $isFormCsrfExtensionEnabled + bool $isFormCsrfExtensionEnabled, ) { $this->formFactory = $formFactory; $this->mediaTypes = $mediaTypes; diff --git a/src/ModelDescriber/JMSModelDescriber.php b/src/ModelDescriber/JMSModelDescriber.php index 26363450f..4f3e3ef54 100644 --- a/src/ModelDescriber/JMSModelDescriber.php +++ b/src/ModelDescriber/JMSModelDescriber.php @@ -71,7 +71,7 @@ public function __construct( array $mediaTypes, ?PropertyNamingStrategyInterface $namingStrategy = null, bool $useValidationGroups = false, - ?SerializationContextFactoryInterface $contextFactory = null + ?SerializationContextFactoryInterface $contextFactory = null, ) { $this->factory = $factory; $this->namingStrategy = $namingStrategy; diff --git a/src/ModelDescriber/ObjectModelDescriber.php b/src/ModelDescriber/ObjectModelDescriber.php index a29fdffbb..3e950204c 100644 --- a/src/ModelDescriber/ObjectModelDescriber.php +++ b/src/ModelDescriber/ObjectModelDescriber.php @@ -49,7 +49,7 @@ public function __construct( array $mediaTypes, ?NameConverterInterface $nameConverter = null, bool $useValidationGroups = false, - ?ClassMetadataFactoryInterface $classMetadataFactory = null + ?ClassMetadataFactoryInterface $classMetadataFactory = null, ) { $this->propertyInfo = $propertyInfo; $this->propertyDescriber = $propertyDescribers; diff --git a/src/OpenApiPhp/ModelRegister.php b/src/OpenApiPhp/ModelRegister.php index 17d127057..a33fcd4d9 100644 --- a/src/OpenApiPhp/ModelRegister.php +++ b/src/OpenApiPhp/ModelRegister.php @@ -164,7 +164,7 @@ private function createContentForMediaType( string $type, array $properties, OA\AbstractAnnotation $annotation, - Analysis $analysis + Analysis $analysis, ): void { switch ($type) { case 'json': diff --git a/src/OpenApiPhp/Util.php b/src/OpenApiPhp/Util.php index 75d50ac2b..960374846 100644 --- a/src/OpenApiPhp/Util.php +++ b/src/OpenApiPhp/Util.php @@ -252,7 +252,7 @@ public static function getCollectionItem(OA\AbstractAnnotation $parent, string $ * * @see OA\AbstractAnnotation::$_nested */ - public static function getIndexedCollectionItem(OA\AbstractAnnotation $parent, string $class, $value): OA\AbstractAnnotation + public static function getIndexedCollectionItem(OA\AbstractAnnotation $parent, string $class, mixed $value): OA\AbstractAnnotation { $nested = $parent::$_nested; [$collection, $property] = $nested[$class]; @@ -302,7 +302,7 @@ public static function searchCollectionItem(array $collection, array $properties * * @return false|int|string */ - public static function searchIndexedCollectionItem(array $collection, string $member, $value) + public static function searchIndexedCollectionItem(array $collection, string $member, mixed $value) { foreach ($collection as $i => $child) { if ($child->{$member} === $value) { @@ -508,7 +508,7 @@ private static function mergeFromArray(OA\AbstractAnnotation $annotation, array * @param class-string $className * @param mixed $value The value of the property */ - private static function mergeChild(OA\AbstractAnnotation $annotation, string $className, $value, bool $overwrite): void + private static function mergeChild(OA\AbstractAnnotation $annotation, string $className, mixed $value, bool $overwrite): void { self::merge(self::getChild($annotation, $className), $value, $overwrite); } diff --git a/src/PropertyDescriber/PropertyDescriber.php b/src/PropertyDescriber/PropertyDescriber.php index f748aed1e..100f1788c 100644 --- a/src/PropertyDescriber/PropertyDescriber.php +++ b/src/PropertyDescriber/PropertyDescriber.php @@ -32,7 +32,7 @@ final class PropertyDescriber implements PropertyDescriberInterface, ModelRegist * @param iterable $propertyDescribers */ public function __construct( - iterable $propertyDescribers + iterable $propertyDescribers, ) { $this->propertyDescribers = $propertyDescribers; } diff --git a/src/RouteDescriber/RouteArgumentDescriber.php b/src/RouteDescriber/RouteArgumentDescriber.php index 14bea9077..b79699bdc 100644 --- a/src/RouteDescriber/RouteArgumentDescriber.php +++ b/src/RouteDescriber/RouteArgumentDescriber.php @@ -30,7 +30,7 @@ final class RouteArgumentDescriber implements RouteDescriberInterface, ModelRegi */ public function __construct( private ArgumentMetadataFactoryInterface $argumentMetadataFactory, - private iterable $inlineParameterDescribers + private iterable $inlineParameterDescribers, ) { } diff --git a/src/Routing/FilteredRouteCollectionBuilder.php b/src/Routing/FilteredRouteCollectionBuilder.php index 4c943ad04..319b87e03 100644 --- a/src/Routing/FilteredRouteCollectionBuilder.php +++ b/src/Routing/FilteredRouteCollectionBuilder.php @@ -35,7 +35,7 @@ final class FilteredRouteCollectionBuilder public function __construct( ControllerReflector $controllerReflector, string $area, - array $options = [] + array $options = [], ) { $resolver = new OptionsResolver(); $resolver diff --git a/tests/Functional/Controller/ApiController.php b/tests/Functional/Controller/ApiController.php index a36d11382..3af2a0e77 100644 --- a/tests/Functional/Controller/ApiController.php +++ b/tests/Functional/Controller/ApiController.php @@ -465,7 +465,7 @@ public function securityOverrideActionAttributes() #[Route('/inline_path_parameters')] #[OA\Response(response: '200', description: '')] public function inlinePathParameters( - #[OA\PathParameter] string $product_id + #[OA\PathParameter] string $product_id, ) { } diff --git a/tests/Functional/Controller/MapQueryStringController.php b/tests/Functional/Controller/MapQueryStringController.php index e08fe8c50..e0d7819e6 100644 --- a/tests/Functional/Controller/MapQueryStringController.php +++ b/tests/Functional/Controller/MapQueryStringController.php @@ -27,14 +27,14 @@ class MapQueryStringController #[Route('/article_map_query_string', methods: ['GET'])] #[OA\Response(response: '200', description: '')] public function fetchArticleFromMapQueryString( - #[MapQueryString] SymfonyMapQueryString $article81Query + #[MapQueryString] SymfonyMapQueryString $article81Query, ) { } #[Route('/article_map_query_string_nullable', methods: ['GET'])] #[OA\Response(response: '200', description: '')] public function fetchArticleFromMapQueryStringNullable( - #[MapQueryString] ?SymfonyMapQueryString $article81Query + #[MapQueryString] ?SymfonyMapQueryString $article81Query, ) { } @@ -74,7 +74,7 @@ public function fetchArticleFromMapQueryStringHandlesValidationGroups( )] #[OA\Response(response: '200', description: '')] public function fetchArticleFromMapQueryStringOverwriteParameters( - #[MapQueryString] SymfonyMapQueryString $article81Query + #[MapQueryString] SymfonyMapQueryString $article81Query, ) { } diff --git a/tests/Functional/JMSFunctionalTest.php b/tests/Functional/JMSFunctionalTest.php index 39981f662..a8834fef4 100644 --- a/tests/Functional/JMSFunctionalTest.php +++ b/tests/Functional/JMSFunctionalTest.php @@ -328,7 +328,7 @@ public function testNamingStrategyWithConstraints(): void 'type' => 'string', 'maxLength' => 10, 'minLength' => 3, - 'default' => 'default' + 'default' => 'default', ], ], 'schema' => 'JMSNamingStrategyConstraints', @@ -376,8 +376,8 @@ public function testEnumSupport(): void 'type' => 'string', 'enum' => [ 'draft', - 'final' - ] + 'final', + ], ], json_decode($this->getModel('ArticleType81')->toJson(), true)); if (TestKernel::isAnnotationsAvailable()) { @@ -390,8 +390,8 @@ public function testEnumSupport(): void 'type' => 'string', 'enum' => [ 'DRAFT', - 'FINAL' - ] + 'FINAL', + ], ], json_decode($this->getModel('ArticleType812')->toJson(), true)); self::assertEquals([ @@ -399,24 +399,24 @@ public function testEnumSupport(): void 'type' => 'object', 'properties' => [ 'enum_value' => [ - '$ref' => '#/components/schemas/ArticleType81' + '$ref' => '#/components/schemas/ArticleType81', ], 'enum_values' => [ 'type' => 'array', 'items' => [ - '$ref' => '#/components/schemas/ArticleType81' - ] + '$ref' => '#/components/schemas/ArticleType81', + ], ], 'enum_name' => [ - '$ref' => '#/components/schemas/ArticleType812' + '$ref' => '#/components/schemas/ArticleType812', ], 'enum_names' => [ 'type' => 'array', 'items' => [ - '$ref' => '#/components/schemas/ArticleType812' - ] + '$ref' => '#/components/schemas/ArticleType812', + ], ], - ] + ], ], json_decode($this->getModel('JMSEnum')->toJson(), true)); } diff --git a/tests/Routing/FilteredRouteCollectionBuilderTest.php b/tests/Routing/FilteredRouteCollectionBuilderTest.php index e7f70d8f8..9bca7b5ed 100644 --- a/tests/Routing/FilteredRouteCollectionBuilderTest.php +++ b/tests/Routing/FilteredRouteCollectionBuilderTest.php @@ -244,7 +244,7 @@ public function testRoutesWithDisabledDefaultRoutes( Route $route, \ReflectionMethod $reflectionMethod, array $options, - int $expectedRoutesCount + int $expectedRoutesCount, ): void { $routes = new RouteCollection(); $routes->add($name, $route);