Skip to content

Commit

Permalink
refactor: [5.x] phpcs trailing_comma_in_multiline
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert committed Nov 15, 2024
1 parent 54bc1b9 commit 4be027c
Show file tree
Hide file tree
Showing 17 changed files with 29 additions and 30 deletions.
1 change: 0 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
file that was distributed with this source code.
HEADER
],
'trailing_comma_in_multiline' => false,
])
->setFinder($finder);
2 changes: 1 addition & 1 deletion src/Attribute/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/ModelDescriber/Annotations/AnnotationsReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/ModelDescriber/Annotations/ReflectionReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion src/ModelDescriber/ApplyOpenApiDiscriminatorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected function applyOpenApiDiscriminator(
OA\Schema $schema,
ModelRegistry $modelRegistry,
string $discriminatorProperty,
array $typeMap
array $typeMap,
): void {
$weakContext = Util::createWeakContext($schema->_context);

Expand Down
2 changes: 1 addition & 1 deletion src/ModelDescriber/FormModelDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(
FormFactoryInterface $formFactory,
array $mediaTypes,
bool $useValidationGroups,
bool $isFormCsrfExtensionEnabled
bool $isFormCsrfExtensionEnabled,
) {
$this->formFactory = $formFactory;
$this->mediaTypes = $mediaTypes;
Expand Down
2 changes: 1 addition & 1 deletion src/ModelDescriber/JMSModelDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/ModelDescriber/ObjectModelDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/OpenApiPhp/ModelRegister.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private function createContentForMediaType(
string $type,
array $properties,
OA\AbstractAnnotation $annotation,
Analysis $analysis
Analysis $analysis,
): void {
switch ($type) {
case 'json':
Expand Down
2 changes: 1 addition & 1 deletion src/PropertyDescriber/PropertyDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class PropertyDescriber implements PropertyDescriberInterface, ModelRegist
* @param iterable<PropertyDescriberInterface> $propertyDescribers
*/
public function __construct(
iterable $propertyDescribers
iterable $propertyDescribers,
) {
$this->propertyDescribers = $propertyDescribers;
}
Expand Down
2 changes: 1 addition & 1 deletion src/RouteDescriber/RouteArgumentDescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class RouteArgumentDescriber implements RouteDescriberInterface, ModelRegi
*/
public function __construct(
private ArgumentMetadataFactoryInterface $argumentMetadataFactory,
private iterable $inlineParameterDescribers
private iterable $inlineParameterDescribers,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Routing/FilteredRouteCollectionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class FilteredRouteCollectionBuilder
public function __construct(
ControllerReflector $controllerReflector,
string $area,
array $options = []
array $options = [],
) {
$resolver = new OptionsResolver();
$resolver
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Functional/Controller/MapQueryStringController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

Expand Down Expand Up @@ -74,7 +74,7 @@ public function fetchArticleFromMapQueryStringHandlesValidationGroups(
)]
#[OA\Response(response: '200', description: '')]
public function fetchArticleFromMapQueryStringOverwriteParameters(
#[MapQueryString] SymfonyMapQueryString $article81Query
#[MapQueryString] SymfonyMapQueryString $article81Query,
) {
}

Expand Down
24 changes: 12 additions & 12 deletions tests/Functional/JMSFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public function testNamingStrategyWithConstraints(): void
'type' => 'string',
'maxLength' => 10,
'minLength' => 3,
'default' => 'default'
'default' => 'default',
],
],
'schema' => 'JMSNamingStrategyConstraints',
Expand Down Expand Up @@ -376,8 +376,8 @@ public function testEnumSupport(): void
'type' => 'string',
'enum' => [
'draft',
'final'
]
'final',
],
], json_decode($this->getModel('ArticleType81')->toJson(), true));

if (TestKernel::isAnnotationsAvailable()) {
Expand All @@ -390,33 +390,33 @@ public function testEnumSupport(): void
'type' => 'string',
'enum' => [
'DRAFT',
'FINAL'
]
'FINAL',
],
], json_decode($this->getModel('ArticleType812')->toJson(), true));

self::assertEquals([
'schema' => 'JMSEnum',
'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));
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Routing/FilteredRouteCollectionBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4be027c

Please sign in to comment.