Skip to content

Commit abde29a

Browse files
lacatoirelacatoire
andauthored
style(tests): add missing void return types (#2641)
This PR adds explicit void return types to methods that don't return any value. --------- Co-authored-by: lacatoire <[email protected]>
1 parent 8c804b9 commit abde29a

18 files changed

+82
-82
lines changed

tests/Functional/Controller/ApiController.php

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class ApiController
6262
#[Route('/article/{id}', methods: ['GET'])]
6363
#[OA\Parameter(name: 'Accept-Version', in: 'header', schema: new OA\Schema(type: 'string'))]
6464
#[OA\Parameter(name: 'Application-Name', in: 'header', schema: new OA\Schema(type: 'string'))]
65-
public function fetchArticleAction()
65+
public function fetchArticleAction(): void
6666
{
6767
}
6868

@@ -81,7 +81,7 @@ public function fetchArticleAction()
8181
#[Route('/article-interface/{id}', methods: ['GET'])]
8282
#[OA\Parameter(name: 'Accept-Version', in: 'header', schema: new OA\Schema(type: 'string'))]
8383
#[OA\Parameter(name: 'Application-Name', in: 'header', schema: new OA\Schema(type: 'string'))]
84-
public function fetchArticleInterfaceAction()
84+
public function fetchArticleInterfaceAction(): void
8585
{
8686
}
8787

@@ -110,7 +110,7 @@ public function fetchArticleInterfaceAction()
110110
),
111111
],
112112
)]
113-
public function swaggerAction()
113+
public function swaggerAction(): void
114114
{
115115
}
116116

@@ -130,7 +130,7 @@ public function swaggerAction()
130130
),
131131
)]
132132
#[OA\Tag(name: 'implicit')]
133-
public function implicitSwaggerAction()
133+
public function implicitSwaggerAction(): void
134134
{
135135
}
136136

@@ -146,7 +146,7 @@ public function implicitSwaggerAction()
146146
description: 'This is a request body',
147147
content: new Model(type: UserType::class, options: ['bar' => 'baz']),
148148
)]
149-
public function submitUserTypeAction()
149+
public function submitUserTypeAction(): void
150150
{
151151
}
152152

@@ -182,7 +182,7 @@ public function adminAction()
182182
new OA\Response(response: '201', description: ''),
183183
],
184184
)]
185-
public function filteredAction()
185+
public function filteredAction(): void
186186
{
187187
}
188188

@@ -192,7 +192,7 @@ public function filteredAction()
192192
content: new Model(type: DummyType::class),
193193
)]
194194
#[OA\Response(response: 201, description: '')]
195-
public function formAction()
195+
public function formAction(): void
196196
{
197197
}
198198

@@ -202,7 +202,7 @@ public function formAction()
202202
content: new Model(type: FormWithModel::class),
203203
)]
204204
#[OA\Response(response: 201, description: '')]
205-
public function formWithModelAction()
205+
public function formWithModelAction(): void
206206
{
207207
}
208208

@@ -212,7 +212,7 @@ public function formWithModelAction()
212212
content: new Model(type: FormWithModel::class, name: 'RenamedFormWithModel'),
213213
)]
214214
#[OA\Response(response: 201, description: '')]
215-
public function formWithModelRenamed()
215+
public function formWithModelRenamed(): void
216216
{
217217
}
218218

@@ -239,7 +239,7 @@ public function securityActionOverride()
239239
description: 'Used for symfony constraints test',
240240
content: new Model(type: SymfonyConstraints::class),
241241
)]
242-
public function symfonyConstraintsAction()
242+
public function symfonyConstraintsAction(): void
243243
{
244244
}
245245

@@ -261,7 +261,7 @@ public function configReferenceAction()
261261
#[OA\Get(description: 'This is the get operation')]
262262
#[OA\Post(description: 'This is post')]
263263
#[OA\Response(response: 200, description: 'Worked well!', attachables: [new Model(type: DummyType::class)])]
264-
public function operationsWithOtherAnnotations()
264+
public function operationsWithOtherAnnotations(): void
265265
{
266266
}
267267

@@ -273,19 +273,19 @@ public function newAreaAction()
273273

274274
#[Route('/compound', methods: ['GET', 'POST'])]
275275
#[OA\Response(response: 200, description: 'Worked well!', attachables: [new Model(type: CompoundEntity::class)])]
276-
public function compoundEntityAction()
276+
public function compoundEntityAction(): void
277277
{
278278
}
279279

280280
#[Route('/discriminator-mapping', methods: ['GET', 'POST'])]
281281
#[OA\Response(response: 200, description: 'Worked well!', attachables: [new Model(type: SymfonyDiscriminator::class)])]
282-
public function discriminatorMappingAction()
282+
public function discriminatorMappingAction(): void
283283
{
284284
}
285285

286286
#[Route('/discriminator-mapping-configured-with-file', methods: ['GET', 'POST'])]
287287
#[OA\Response(response: 200, description: 'Worked well!', attachables: [new Model(type: SymfonyDiscriminatorFileMapping::class)])]
288-
public function discriminatorMappingConfiguredWithFileAction()
288+
public function discriminatorMappingConfiguredWithFileAction(): void
289289
{
290290
}
291291

@@ -309,7 +309,7 @@ public function customOperationIdAction()
309309
description: 'Used for symfony constraints with validation groups test',
310310
content: new Model(type: SymfonyConstraintsWithValidationGroups::class, groups: ['test']),
311311
)]
312-
public function symfonyConstraintsWithGroupsAction()
312+
public function symfonyConstraintsWithGroupsAction(): void
313313
{
314314
}
315315

@@ -322,7 +322,7 @@ public function symfonyConstraintsWithGroupsAction()
322322
ref: new Model(type: EntityWithAlternateType::class),
323323
),
324324
)]
325-
public function alternateEntityType()
325+
public function alternateEntityType(): void
326326
{
327327
}
328328

@@ -335,7 +335,7 @@ public function alternateEntityType()
335335
ref: new Model(type: EntityWithRef::class),
336336
),
337337
)]
338-
public function entityWithRef()
338+
public function entityWithRef(): void
339339
{
340340
}
341341

@@ -348,7 +348,7 @@ public function entityWithRef()
348348
ref: new Model(type: EntityWithObjectType::class),
349349
),
350350
)]
351-
public function entityWithObjectType()
351+
public function entityWithObjectType(): void
352352
{
353353
}
354354

@@ -360,7 +360,7 @@ public function entityWithObjectType()
360360
ref: new Model(type: EntityWithUuid::class),
361361
),
362362
)]
363-
public function entityWithUuid()
363+
public function entityWithUuid(): void
364364
{
365365
}
366366

@@ -372,7 +372,7 @@ public function entityWithUuid()
372372
ref: new Model(type: EntityWithUlid::class),
373373
),
374374
)]
375-
public function entityWithUlid()
375+
public function entityWithUlid(): void
376376
{
377377
}
378378

@@ -384,7 +384,7 @@ public function entityWithUlid()
384384
ref: new Model(type: EntityWithTranslatable::class),
385385
),
386386
)]
387-
public function entityWithTranslatable()
387+
public function entityWithTranslatable(): void
388388
{
389389
}
390390

@@ -396,7 +396,7 @@ public function entityWithTranslatable()
396396
#[OA\RequestBody(
397397
content: new Model(type: FormWithAlternateSchemaType::class),
398398
)]
399-
public function formWithAlternateSchemaType()
399+
public function formWithAlternateSchemaType(): void
400400
{
401401
}
402402

@@ -408,7 +408,7 @@ public function formWithAlternateSchemaType()
408408
#[OA\RequestBody(
409409
content: new Model(type: FormWithRefType::class),
410410
)]
411-
public function formWithRefSchemaType()
411+
public function formWithRefSchemaType(): void
412412
{
413413
}
414414

@@ -420,7 +420,7 @@ public function formWithRefSchemaType()
420420
#[OA\RequestBody(
421421
content: new Model(type: FormWithCsrfProtectionEnabledType::class),
422422
)]
423-
public function formWithCsrfProtectionEnabledType()
423+
public function formWithCsrfProtectionEnabledType(): void
424424
{
425425
}
426426

@@ -432,7 +432,7 @@ public function formWithCsrfProtectionEnabledType()
432432
#[OA\RequestBody(
433433
content: new Model(type: FormWithCsrfProtectionDisabledType::class),
434434
)]
435-
public function formWithCsrfProtectionDisabledType()
435+
public function formWithCsrfProtectionDisabledType(): void
436436
{
437437
}
438438

@@ -444,7 +444,7 @@ public function formWithCsrfProtectionDisabledType()
444444
new Model(type: EntityWithNullableSchemaSet::class),
445445
],
446446
)]
447-
public function entityWithNullableSchemaSet()
447+
public function entityWithNullableSchemaSet(): void
448448
{
449449
}
450450

@@ -456,7 +456,7 @@ public function entityWithNullableSchemaSet()
456456
#[OA\RequestBody(
457457
content: new Model(type: EntityWithFalsyDefaults::class),
458458
)]
459-
public function entityWithFalsyDefaults()
459+
public function entityWithFalsyDefaults(): void
460460
{
461461
}
462462

@@ -472,7 +472,7 @@ public function entityWithFalsyDefaults()
472472
#[OA\Parameter(ref: '#/components/parameters/test')]
473473
#[Route('/article_attributes/{id}', methods: ['GET'])]
474474
#[OA\Parameter(name: 'Accept-Version', in: 'header', schema: new OA\Schema(type: 'string'))]
475-
public function fetchArticleActionWithAttributes()
475+
public function fetchArticleActionWithAttributes(): void
476476
{
477477
}
478478

@@ -509,19 +509,19 @@ public function inlinePathParameters(
509509

510510
#[Route('/enum')]
511511
#[OA\Response(response: '201', description: '', attachables: [new Model(type: Article81::class)])]
512-
public function enum()
512+
public function enum(): void
513513
{
514514
}
515515

516516
#[Route('/range_integer', methods: ['GET'])]
517517
#[OA\Response(response: '200', description: '', attachables: [new Model(type: RangeInteger::class)])]
518-
public function rangeInteger()
518+
public function rangeInteger(): void
519519
{
520520
}
521521

522522
#[Route('/serializename', methods: ['GET'])]
523523
#[OA\Response(response: 200, description: 'success', content: new Model(type: SerializedNameEntity::class))]
524-
public function serializedNameAction()
524+
public function serializedNameAction(): void
525525
{
526526
}
527527

@@ -536,19 +536,19 @@ public function serializedNameAction()
536536
description: 'Same class without context',
537537
content: new Model(type: EntityThroughNameConverter::class)
538538
)]
539-
public function nameConverterContext()
539+
public function nameConverterContext(): void
540540
{
541541
}
542542

543543
#[Route('/arbitrary_array', methods: ['GET'])]
544544
#[OA\Response(response: 200, description: 'Success', content: new Model(type: Foo::class))]
545-
public function arbitraryArray()
545+
public function arbitraryArray(): void
546546
{
547547
}
548548

549549
#[Route('/dictionary', methods: ['GET'])]
550550
#[OA\Response(response: 200, description: 'Success', content: new Model(type: Dictionary::class))]
551-
public function dictionary()
551+
public function dictionary(): void
552552
{
553553
}
554554

@@ -560,7 +560,7 @@ public function dictionary()
560560
ref: new Model(type: EntityWithIgnoredProperty::class),
561561
),
562562
)]
563-
public function entityWithIgnoredProperty()
563+
public function entityWithIgnoredProperty(): void
564564
{
565565
}
566566

tests/Functional/Controller/ApiController81Collisions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,25 @@ class ApiController81Collisions
2020
{
2121
#[Route('/article_81_group_full', methods: ['GET'])]
2222
#[OA\Response(response: 200, description: 'Success', content: new Model(type: Article81WithGroups::class, groups: ['full']))]
23-
public function article81GroupFull()
23+
public function article81GroupFull(): void
2424
{
2525
}
2626

2727
#[Route('/article_81_group_default', methods: ['GET'])]
2828
#[OA\Response(response: 200, description: 'Success', content: new Model(type: Article81WithGroups::class, groups: ['default']))]
29-
public function article81GroupDefault()
29+
public function article81GroupDefault(): void
3030
{
3131
}
3232

3333
#[Route('/article_81_group_default_and_full', methods: ['GET'])]
3434
#[OA\Response(response: 200, description: 'Success', content: new Model(type: Article81WithGroups::class, groups: ['default', 'full']))]
35-
public function article81GroupDefaultAndFull()
35+
public function article81GroupDefaultAndFull(): void
3636
{
3737
}
3838

3939
#[Route('/article_81_group_empty', methods: ['GET'])]
4040
#[OA\Response(response: 200, description: 'Success', content: new Model(type: Article81WithGroups::class, groups: []))]
41-
public function article81GroupEmpty()
41+
public function article81GroupEmpty(): void
4242
{
4343
}
4444
}

tests/Functional/Controller/BazingaController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class BazingaController
2525
description: 'Success',
2626
content: new Model(type: BazingaUser::class)
2727
)]
28-
public function userAction()
28+
public function userAction(): void
2929
{
3030
}
3131

@@ -35,7 +35,7 @@ public function userAction()
3535
description: 'Success',
3636
content: new Model(type: BazingaUser::class, groups: ['foo'])
3737
)]
38-
public function userGroupAction()
38+
public function userGroupAction(): void
3939
{
4040
}
4141
}

tests/Functional/Controller/BazingaTypedController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class BazingaTypedController
2525
description: 'Success',
2626
content: new Model(type: BazingaUserTyped::class)
2727
)]
28-
public function userTypedAction()
28+
public function userTypedAction(): void
2929
{
3030
}
3131
}

tests/Functional/Controller/FOSRestController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FOSRestController
3030
#[RequestParam(name: 'datetimeAlt', requirements: new DateTime('c'))]
3131
#[RequestParam(name: 'datetimeNoFormat', requirements: new DateTime())]
3232
#[RequestParam(name: 'date', requirements: new DateTime('Y-m-d'))]
33-
public function fosrestAction()
33+
public function fosrestAction(): void
3434
{
3535
}
3636

@@ -43,7 +43,7 @@ public function fosrestAction()
4343
#[RequestParam(name: 'datetimeAlt', requirements: new DateTime('c'))]
4444
#[RequestParam(name: 'datetimeNoFormat', requirements: new DateTime())]
4545
#[RequestParam(name: 'date', requirements: new DateTime('Y-m-d'))]
46-
public function fosrestAttributesAction()
46+
public function fosrestAttributesAction(): void
4747
{
4848
}
4949
}

tests/Functional/Controller/GenericTypesController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class GenericTypesController
2626
content: new Model(type: GenericTypes::class),
2727
)]
2828
#[Route('/generic-types', methods: ['GET'])]
29-
public function genericTypesAction()
29+
public function genericTypesAction(): void
3030
{
3131
}
3232
}

0 commit comments

Comments
 (0)