Skip to content

Commit b4e5c21

Browse files
authored
Remove superfluous PHPDoc tags (#2111)
* Remove superfluous PHPDoc tags * Remove one more faulty param tag * alpha order * Fix PHPStan
1 parent 9060b8d commit b4e5c21

File tree

113 files changed

+37
-1065
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+37
-1065
lines changed

.php_cs.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ return PhpCsFixer\Config::create()
6363
'use',
6464
],
6565
],
66+
'no_superfluous_phpdoc_tags' => true,
6667
'no_useless_else' => true,
6768
'no_useless_return' => true,
6869
'ordered_imports' => [

phpstan.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ parameters:
3434
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Filter\\FilterInterface::apply\(\) invoked with 5 parameters, 3-4 required\.#'
3535
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Filter\\OrderFilter::filterProperty\(\) invoked with 7 parameters, 5-6 required\.#'
3636
- '#Method ApiPlatform\\Core\\DataProvider\\CollectionDataProviderInterface::getCollection\(\) invoked with 3 parameters, 1-2 required.#'
37-
- '#PHPDoc tag @param references unknown parameter \$operationName#'

src/Action/ExceptionAction.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ final class ExceptionAction
4646
private $exceptionToStatus;
4747

4848
/**
49-
* @param SerializerInterface $serializer
50-
* @param array $errorFormats A list of enabled formats, the first one will be the default
51-
* @param array $exceptionToStatus A list of exceptions mapped to their HTTP status code
49+
* @param array $errorFormats A list of enabled formats, the first one will be the default
50+
* @param array $exceptionToStatus A list of exceptions mapped to their HTTP status code
5251
*/
5352
public function __construct(SerializerInterface $serializer, array $errorFormats, array $exceptionToStatus = [])
5453
{
@@ -59,11 +58,6 @@ public function __construct(SerializerInterface $serializer, array $errorFormats
5958

6059
/**
6160
* Converts a an exception to a JSON response.
62-
*
63-
* @param FlattenException $exception
64-
* @param Request $request
65-
*
66-
* @return Response
6761
*/
6862
public function __invoke(FlattenException $exception, Request $request): Response
6963
{

src/Api/FilterCollectionFactory.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ public function __construct(array $filtersIds)
3636

3737
/**
3838
* Creates a filter collection from a filter locator.
39-
*
40-
* @param ContainerInterface $filterLocator
41-
*
42-
* @return FilterCollection
4339
*/
4440
public function createFilterCollectionFromLocator(ContainerInterface $filterLocator): FilterCollection
4541
{

src/Api/FilterInterface.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ interface FilterInterface
3737
* The description can contain additional data specific to a filter.
3838
*
3939
* @see \ApiPlatform\Core\Swagger\Serializer\DocumentationNormalizer::getFiltersParameters
40-
*
41-
* @param string $resourceClass
42-
*
43-
* @return array
4440
*/
4541
public function getDescription(string $resourceClass): array;
4642
}

src/Api/FilterLocatorTrait.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ trait FilterLocatorTrait
3131
* Sets a filter locator with a backward compatibility.
3232
*
3333
* @param ContainerInterface|FilterCollection|null $filterLocator
34-
* @param bool $allowNull
3534
*/
3635
private function setFilterLocator($filterLocator = null, bool $allowNull = false)
3736
{
@@ -49,7 +48,6 @@ private function setFilterLocator($filterLocator = null, bool $allowNull = false
4948
/**
5049
* Gets a filter with a backward compatibility.
5150
*
52-
* @param string $filterId
5351
*
5452
* @return FilterInterface|null
5553
*/

src/Api/IdentifiersExtractorInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public function getIdentifiersFromResourceClass(string $resourceClass): array;
3333
* @param object $item
3434
*
3535
* @throws RuntimeException
36-
*
37-
* @return array
3836
*/
3937
public function getIdentifiersFromItem($item): array;
4038
}

src/Api/IriConverterInterface.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ interface IriConverterInterface
2727
/**
2828
* Retrieves an item from its IRI.
2929
*
30-
* @param string $iri
31-
* @param array $context
3230
*
3331
* @throws InvalidArgumentException
3432
* @throws ItemNotFoundException
@@ -41,50 +39,33 @@ public function getItemFromIri(string $iri, array $context = []);
4139
* Gets the IRI associated with the given item.
4240
*
4341
* @param object $item
44-
* @param int $referenceType
4542
*
4643
* @throws InvalidArgumentException
4744
* @throws RuntimeException
48-
*
49-
* @return string
5045
*/
5146
public function getIriFromItem($item, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;
5247

5348
/**
5449
* Gets the IRI associated with the given resource collection.
5550
*
56-
* @param string $resourceClass
57-
* @param int $referenceType
5851
*
5952
* @throws InvalidArgumentException
60-
*
61-
* @return string
6253
*/
6354
public function getIriFromResourceClass(string $resourceClass, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;
6455

6556
/**
6657
* Gets the item IRI associated with the given resource.
6758
*
68-
* @param string $resourceClass
69-
* @param array $identifiers
70-
* @param int $referenceType
7159
*
7260
* @throws InvalidArgumentException
73-
*
74-
* @return string
7561
*/
7662
public function getItemIriFromResourceClass(string $resourceClass, array $identifiers, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;
7763

7864
/**
7965
* Gets the IRI associated with the given resource subresource.
8066
*
81-
* @param string $resourceClass
82-
* @param array $identifiers
83-
* @param int $referenceType
8467
*
8568
* @throws InvalidArgumentException
86-
*
87-
* @return string
8869
*/
8970
public function getSubresourceIriFromResourceClass(string $resourceClass, array $identifiers, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;
9071
}

src/Api/OperationMethodResolverInterface.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,16 @@ interface OperationMethodResolverInterface
2525
/**
2626
* Resolves the uppercased HTTP method associated with a collection operation.
2727
*
28-
* @param string $resourceClass
29-
* @param string $operationName
3028
*
3129
* @throws RuntimeException
32-
*
33-
* @return string
3430
*/
3531
public function getCollectionOperationMethod(string $resourceClass, string $operationName): string;
3632

3733
/**
3834
* Resolves the uppercased HTTP method associated with an item operation.
3935
*
40-
* @param string $resourceClass
41-
* @param string $operationName
4236
*
4337
* @throws RuntimeException
44-
*
45-
* @return string
4638
*/
4739
public function getItemOperationMethod(string $resourceClass, string $operationName): string;
4840
}

src/Api/OperationTypeDeprecationHelper.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ final class OperationTypeDeprecationHelper
3030
{
3131
/**
3232
* @param string|bool $operationType
33-
*
34-
* @return string
3533
*/
3634
public static function getOperationType($operationType): string
3735
{

0 commit comments

Comments
 (0)