Skip to content

Commit

Permalink
Remove superfluous PHPDoc tags (#2111)
Browse files Browse the repository at this point in the history
* Remove superfluous PHPDoc tags

* Remove one more faulty param tag

* alpha order

* Fix PHPStan
  • Loading branch information
dunglas authored Jul 19, 2018
1 parent 9060b8d commit b4e5c21
Show file tree
Hide file tree
Showing 113 changed files with 37 additions and 1,065 deletions.
1 change: 1 addition & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ return PhpCsFixer\Config::create()
'use',
],
],
'no_superfluous_phpdoc_tags' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => [
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ parameters:
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Filter\\FilterInterface::apply\(\) invoked with 5 parameters, 3-4 required\.#'
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Filter\\OrderFilter::filterProperty\(\) invoked with 7 parameters, 5-6 required\.#'
- '#Method ApiPlatform\\Core\\DataProvider\\CollectionDataProviderInterface::getCollection\(\) invoked with 3 parameters, 1-2 required.#'
- '#PHPDoc tag @param references unknown parameter \$operationName#'
10 changes: 2 additions & 8 deletions src/Action/ExceptionAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ final class ExceptionAction
private $exceptionToStatus;

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

/**
* Converts a an exception to a JSON response.
*
* @param FlattenException $exception
* @param Request $request
*
* @return Response
*/
public function __invoke(FlattenException $exception, Request $request): Response
{
Expand Down
4 changes: 0 additions & 4 deletions src/Api/FilterCollectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ public function __construct(array $filtersIds)

/**
* Creates a filter collection from a filter locator.
*
* @param ContainerInterface $filterLocator
*
* @return FilterCollection
*/
public function createFilterCollectionFromLocator(ContainerInterface $filterLocator): FilterCollection
{
Expand Down
4 changes: 0 additions & 4 deletions src/Api/FilterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ interface FilterInterface
* The description can contain additional data specific to a filter.
*
* @see \ApiPlatform\Core\Swagger\Serializer\DocumentationNormalizer::getFiltersParameters
*
* @param string $resourceClass
*
* @return array
*/
public function getDescription(string $resourceClass): array;
}
2 changes: 0 additions & 2 deletions src/Api/FilterLocatorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ trait FilterLocatorTrait
* Sets a filter locator with a backward compatibility.
*
* @param ContainerInterface|FilterCollection|null $filterLocator
* @param bool $allowNull
*/
private function setFilterLocator($filterLocator = null, bool $allowNull = false)
{
Expand All @@ -49,7 +48,6 @@ private function setFilterLocator($filterLocator = null, bool $allowNull = false
/**
* Gets a filter with a backward compatibility.
*
* @param string $filterId
*
* @return FilterInterface|null
*/
Expand Down
2 changes: 0 additions & 2 deletions src/Api/IdentifiersExtractorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public function getIdentifiersFromResourceClass(string $resourceClass): array;
* @param object $item
*
* @throws RuntimeException
*
* @return array
*/
public function getIdentifiersFromItem($item): array;
}
19 changes: 0 additions & 19 deletions src/Api/IriConverterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ interface IriConverterInterface
/**
* Retrieves an item from its IRI.
*
* @param string $iri
* @param array $context
*
* @throws InvalidArgumentException
* @throws ItemNotFoundException
Expand All @@ -41,50 +39,33 @@ public function getItemFromIri(string $iri, array $context = []);
* Gets the IRI associated with the given item.
*
* @param object $item
* @param int $referenceType
*
* @throws InvalidArgumentException
* @throws RuntimeException
*
* @return string
*/
public function getIriFromItem($item, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;

/**
* Gets the IRI associated with the given resource collection.
*
* @param string $resourceClass
* @param int $referenceType
*
* @throws InvalidArgumentException
*
* @return string
*/
public function getIriFromResourceClass(string $resourceClass, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;

/**
* Gets the item IRI associated with the given resource.
*
* @param string $resourceClass
* @param array $identifiers
* @param int $referenceType
*
* @throws InvalidArgumentException
*
* @return string
*/
public function getItemIriFromResourceClass(string $resourceClass, array $identifiers, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;

/**
* Gets the IRI associated with the given resource subresource.
*
* @param string $resourceClass
* @param array $identifiers
* @param int $referenceType
*
* @throws InvalidArgumentException
*
* @return string
*/
public function getSubresourceIriFromResourceClass(string $resourceClass, array $identifiers, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;
}
8 changes: 0 additions & 8 deletions src/Api/OperationMethodResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,16 @@ interface OperationMethodResolverInterface
/**
* Resolves the uppercased HTTP method associated with a collection operation.
*
* @param string $resourceClass
* @param string $operationName
*
* @throws RuntimeException
*
* @return string
*/
public function getCollectionOperationMethod(string $resourceClass, string $operationName): string;

/**
* Resolves the uppercased HTTP method associated with an item operation.
*
* @param string $resourceClass
* @param string $operationName
*
* @throws RuntimeException
*
* @return string
*/
public function getItemOperationMethod(string $resourceClass, string $operationName): string;
}
2 changes: 0 additions & 2 deletions src/Api/OperationTypeDeprecationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ final class OperationTypeDeprecationHelper
{
/**
* @param string|bool $operationType
*
* @return string
*/
public static function getOperationType($operationType): string
{
Expand Down
9 changes: 0 additions & 9 deletions src/Api/ResourceClassResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,13 @@ interface ResourceClassResolverInterface
/**
* Guesses the associated resource.
*
* @param mixed $value
* @param string|null $resourceClass
* @param bool $strict
*
* @throws InvalidArgumentException
*
* @return string
*/
public function getResourceClass($value, string $resourceClass = null, bool $strict = false): string;

/**
* Is the given class a resource class?
*
* @param string $type
*
* @return bool
*/
public function isResourceClass(string $type): bool;
}
1 change: 0 additions & 1 deletion src/Bridge/Doctrine/Common/DataPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public function remove($data)
/**
* Gets the Doctrine object manager associated with given data.
*
* @param mixed $data
*
* @return DoctrineObjectManager|null
*/
Expand Down
4 changes: 0 additions & 4 deletions src/Bridge/Doctrine/EventListener/WriteListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public function __construct(ManagerRegistry $managerRegistry)

/**
* Persists, updates or delete data return by the controller if applicable.
*
* @param GetResponseForControllerResultEvent $event
*/
public function onKernelView(GetResponseForControllerResultEvent $event)
{
Expand Down Expand Up @@ -72,8 +70,6 @@ public function onKernelView(GetResponseForControllerResultEvent $event)
/**
* Gets the manager if applicable.
*
* @param string $resourceClass
* @param mixed $data
*
* @return ObjectManager|null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,5 @@ interface ContextAwareQueryItemExtensionInterface extends QueryItemExtensionInte
{
public function supportsResult(string $resourceClass, string $operationName = null, array $context = []): bool;

/**
* @return mixed
*/
public function getResult(QueryBuilder $queryBuilder, string $resourceClass = null, string $operationName = null, array $context = []);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,5 @@ interface ContextAwareQueryResultCollectionExtensionInterface extends QueryResul
{
public function supportsResult(string $resourceClass, string $operationName = null, array $context = []): bool;

/**
* @return mixed
*/
public function getResult(QueryBuilder $queryBuilder, string $resourceClass = null, string $operationName = null, array $context = []);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,5 @@ interface ContextAwareQueryResultItemExtensionInterface extends QueryResultItemE
{
public function supportsResult(string $resourceClass, string $operationName = null, array $context = []): bool;

/**
* @return mixed
*/
public function getResult(QueryBuilder $queryBuilder, string $resourceClass = null, string $operationName = null, array $context = []);
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ public function applyToCollection(QueryBuilder $queryBuilder, QueryNameGenerator
/**
* Returns a clone of the given query builder where everything gets re-aliased.
*
* @param QueryBuilder $queryBuilder
* @param QueryNameGeneratorInterface $queryNameGenerator
* @param string $originAlias the base alias
* @param string $replacement the replacement for the base alias, will change the from alias
* @param string $originAlias the base alias
* @param string $replacement the replacement for the base alias, will change the from alias
*
* @return QueryBuilder
*/
Expand Down
4 changes: 0 additions & 4 deletions src/Bridge/Doctrine/Orm/Extension/PaginationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,6 @@ private function useFetchJoinCollection(QueryBuilder $queryBuilder, string $reso

/**
* Determines whether output walkers should be used.
*
* @param QueryBuilder $queryBuilder
*
* @return bool
*/
private function useOutputWalkers(QueryBuilder $queryBuilder): bool
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@ interface QueryResultCollectionExtensionInterface extends QueryCollectionExtensi
{
public function supportsResult(string $resourceClass, string $operationName = null): bool;

/**
* @return mixed
*/
public function getResult(QueryBuilder $queryBuilder);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,5 @@ interface QueryResultItemExtensionInterface extends QueryItemExtensionInterface
{
public function supportsResult(string $resourceClass, string $operationName = null): bool;

/**
* @return mixed
*/
public function getResult(QueryBuilder $queryBuilder);
}
34 changes: 0 additions & 34 deletions src/Bridge/Doctrine/Orm/Filter/AbstractFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ abstract protected function filterProperty(string $property, $value, QueryBuilde

/**
* Gets class metadata for the given resource.
*
* @param string $resourceClass
*
* @return ClassMetadata
*/
protected function getClassMetadata(string $resourceClass): ClassMetadata
{
Expand All @@ -94,10 +90,6 @@ protected function getClassMetadata(string $resourceClass): ClassMetadata

/**
* Determines whether the given property is enabled.
*
* @param string $property
*
* @return bool
*/
protected function isPropertyEnabled(string $property/*, string $resourceClass*/): bool
{
Expand All @@ -123,12 +115,6 @@ protected function isPropertyEnabled(string $property/*, string $resourceClass*/

/**
* Determines whether the given property is mapped.
*
* @param string $property
* @param string $resourceClass
* @param bool $allowAssociation
*
* @return bool
*/
protected function isPropertyMapped(string $property, string $resourceClass, bool $allowAssociation = false): bool
{
Expand All @@ -145,10 +131,6 @@ protected function isPropertyMapped(string $property, string $resourceClass, boo

/**
* Determines whether the given property is nested.
*
* @param string $property
*
* @return bool
*/
protected function isPropertyNested(string $property/*, string $resourceClass*/): bool
{
Expand All @@ -174,11 +156,6 @@ protected function isPropertyNested(string $property/*, string $resourceClass*/)

/**
* Determines whether the given property is embedded.
*
* @param string $property
* @param string $resourceClass
*
* @return bool
*/
protected function isPropertyEmbedded(string $property, string $resourceClass): bool
{
Expand All @@ -188,10 +165,7 @@ protected function isPropertyEmbedded(string $property, string $resourceClass):
/**
* Gets nested class metadata for the given resource.
*
* @param string $resourceClass
* @param string[] $associations
*
* @return ClassMetadata
*/
protected function getNestedMetadata(string $resourceClass, array $associations): ClassMetadata
{
Expand All @@ -217,10 +191,6 @@ protected function getNestedMetadata(string $resourceClass, array $associations)
* Returns an array with the following keys:
* - associations: array of associations according to nesting order
* - field: string holding the actual field (leaf node)
*
* @param string $property
*
* @return array
*/
protected function splitPropertyParts(string $property/*, string $resourceClass*/): array
{
Expand Down Expand Up @@ -292,10 +262,6 @@ protected function extractProperties(Request $request/*, string $resourceClass*/
/**
* Adds the necessary joins for a nested property.
*
* @param string $property
* @param string $rootAlias
* @param QueryBuilder $queryBuilder
* @param QueryNameGeneratorInterface $queryNameGenerator
*
* @throws InvalidArgumentException If property is not nested
*
Expand Down
5 changes: 0 additions & 5 deletions src/Bridge/Doctrine/Orm/Filter/BooleanFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ protected function filterProperty(string $property, $value, QueryBuilder $queryB

/**
* Determines whether the given property refers to a boolean field.
*
* @param string $property
* @param string $resourceClass
*
* @return bool
*/
protected function isBooleanField(string $property, string $resourceClass): bool
{
Expand Down
Loading

0 comments on commit b4e5c21

Please sign in to comment.