diff --git a/composer.json b/composer.json index 3ba7d6b8..387935dd 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ }, "require-dev": { "phpunit/phpunit": "^7 | ^9.5.10", - "doctrine/coding-standard": "^5.0 | ^8.0", + "doctrine/coding-standard": "^12.0", "doctrine/persistence": "^1.3.4 | ^2.0 | ^3.0", "pagerfanta/core": "^2.4 || ^3.0", "phpdocumentor/type-resolver": "^1.5.1", diff --git a/phpcs.xml.dist b/phpcs.xml.dist index bf60569c..60a288af 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -31,12 +31,17 @@ + + + + + @@ -99,10 +104,6 @@ tests/* - - tests/* - - diff --git a/src/Configuration/Metadata/Driver/AnnotationDriver.php b/src/Configuration/Metadata/Driver/AnnotationDriver.php index 8e2c5c58..549eb2a7 100644 --- a/src/Configuration/Metadata/Driver/AnnotationDriver.php +++ b/src/Configuration/Metadata/Driver/AnnotationDriver.php @@ -28,7 +28,7 @@ public function __construct( } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getClassAnnotations(\ReflectionClass $class): array { diff --git a/src/Configuration/Metadata/Driver/AttributeDriver.php b/src/Configuration/Metadata/Driver/AttributeDriver.php index b06ef83d..d0194c04 100644 --- a/src/Configuration/Metadata/Driver/AttributeDriver.php +++ b/src/Configuration/Metadata/Driver/AttributeDriver.php @@ -7,7 +7,7 @@ class AttributeDriver extends AnnotationOrAttributeDriver { /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getClassAnnotations(\ReflectionClass $class): array { diff --git a/src/Configuration/Metadata/Driver/CheckExpressionTrait.php b/src/Configuration/Metadata/Driver/CheckExpressionTrait.php index 0c83e764..e8476310 100644 --- a/src/Configuration/Metadata/Driver/CheckExpressionTrait.php +++ b/src/Configuration/Metadata/Driver/CheckExpressionTrait.php @@ -16,7 +16,6 @@ trait CheckExpressionTrait /** * @param mixed $exp - * @param array $names * * @return Expression|mixed */ diff --git a/src/Configuration/Metadata/Driver/XmlDriver.php b/src/Configuration/Metadata/Driver/XmlDriver.php index a3973410..c171fd00 100644 --- a/src/Configuration/Metadata/Driver/XmlDriver.php +++ b/src/Configuration/Metadata/Driver/XmlDriver.php @@ -41,6 +41,7 @@ public function __construct( ParserInterface $typeParser ) { parent::__construct($locator); + $this->relationProvider = $relationProvider; $this->expressionLanguage = $expressionLanguage; $this->typeParser = $typeParser; @@ -177,7 +178,7 @@ private function createEmbedded($embedded): Embedded { $embeddedExclusion = isset($embedded->exclusion) ? $this->parseExclusion($embedded->exclusion) : null; $xmlElementName = isset($embedded->attributes('')->{'xml-element-name'}) ? $this->checkExpression((string) $embedded->attributes('')->{'xml-element-name'}) : null; - $type = isset($embedded->attributes('')->{'type'}) ? $this->typeParser->parse((string) $embedded->attributes('')->{'type'}) : null; + $type = isset($embedded->attributes('')->type) ? $this->typeParser->parse((string) $embedded->attributes('')->type) : null; return new Embedded( $this->checkExpression((string) $embedded->content), diff --git a/src/Configuration/Metadata/Driver/YamlDriver.php b/src/Configuration/Metadata/Driver/YamlDriver.php index 2d39acfd..da057fc1 100644 --- a/src/Configuration/Metadata/Driver/YamlDriver.php +++ b/src/Configuration/Metadata/Driver/YamlDriver.php @@ -40,6 +40,7 @@ public function __construct( ParserInterface $typeParser ) { parent::__construct($locator); + $this->relationProvider = $relationProvider; $this->expressionLanguage = $expressionLanguage; $this->typeParser = $typeParser; diff --git a/src/Configuration/Provider/ChainProvider.php b/src/Configuration/Provider/ChainProvider.php index 4fac547a..19279edf 100644 --- a/src/Configuration/Provider/ChainProvider.php +++ b/src/Configuration/Provider/ChainProvider.php @@ -24,7 +24,7 @@ public function addProvider(RelationProviderInterface $resolver): void } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getRelations(RelationProvider $configuration, string $class): array { diff --git a/src/Configuration/Provider/ExpressionEvaluatorProvider.php b/src/Configuration/Provider/ExpressionEvaluatorProvider.php index 772aca71..82bc288c 100644 --- a/src/Configuration/Provider/ExpressionEvaluatorProvider.php +++ b/src/Configuration/Provider/ExpressionEvaluatorProvider.php @@ -20,7 +20,7 @@ public function __construct(ExpressionEvaluatorInterface $expressionEvaluator) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getRelations(RelationProvider $configuration, string $class): array { diff --git a/src/Configuration/Provider/FunctionProvider.php b/src/Configuration/Provider/FunctionProvider.php index 6ff1201d..0145032c 100644 --- a/src/Configuration/Provider/FunctionProvider.php +++ b/src/Configuration/Provider/FunctionProvider.php @@ -9,7 +9,7 @@ class FunctionProvider implements RelationProviderInterface { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getRelations(RelationProvider $configuration, string $class): array { diff --git a/src/Configuration/Provider/StaticMethodProvider.php b/src/Configuration/Provider/StaticMethodProvider.php index 40198b02..7b9374f3 100644 --- a/src/Configuration/Provider/StaticMethodProvider.php +++ b/src/Configuration/Provider/StaticMethodProvider.php @@ -9,7 +9,7 @@ class StaticMethodProvider implements RelationProviderInterface { /** - * {@inheritdoc} + * {@inheritDoc} */ public function getRelations(RelationProvider $configuration, string $class): array { diff --git a/src/Configuration/Relation.php b/src/Configuration/Relation.php index b46c649d..202e1362 100644 --- a/src/Configuration/Relation.php +++ b/src/Configuration/Relation.php @@ -39,7 +39,6 @@ class Relation * @param string|Expression $name * @param string|Route $href * @param Embedded|string|mixed $embedded - * @param array $attributes */ public function __construct(string $name, $href = null, $embedded = null, array $attributes = [], ?Exclusion $exclusion = null) { @@ -71,9 +70,6 @@ public function getHref() return $this->href; } - /** - * @return array - */ public function getAttributes(): array { return $this->attributes; diff --git a/src/Expression/LinkExpressionFunction.php b/src/Expression/LinkExpressionFunction.php index 7cdfa042..670671b5 100644 --- a/src/Expression/LinkExpressionFunction.php +++ b/src/Expression/LinkExpressionFunction.php @@ -11,8 +11,6 @@ class LinkExpressionFunction implements ExpressionFunctionProviderInterface { /** * @return ExpressionFunction[] - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint */ public function getFunctions(): array { diff --git a/src/Factory/EmbeddedsFactory.php b/src/Factory/EmbeddedsFactory.php index 6f74148c..8119fa62 100644 --- a/src/Factory/EmbeddedsFactory.php +++ b/src/Factory/EmbeddedsFactory.php @@ -48,9 +48,6 @@ public function create(object $object, SerializationContext $context): array if (null !== ($classMetadata = $this->metadataFactory->getMetadataForClass(get_class($object)))) { $langugeData = ['object' => $object, 'context' => $context]; - /** - * @var $relation Relation - */ foreach ($classMetadata->getRelations() as $relation) { if ($this->exclusionManager->shouldSkipEmbedded($object, $relation, $context)) { continue; @@ -71,7 +68,6 @@ public function create(object $object, SerializationContext $context): array /** * @param mixed $exp - * @param array $data * * @return mixed */ diff --git a/src/Factory/LinkFactory.php b/src/Factory/LinkFactory.php index 044c8756..edd3a871 100644 --- a/src/Factory/LinkFactory.php +++ b/src/Factory/LinkFactory.php @@ -75,7 +75,6 @@ public function createLink(object $object, Relation $relation, SerializationCont /** * @param mixed $exp - * @param array $data * * @return mixed */ @@ -88,12 +87,6 @@ private function checkExpression($exp, array $data) } } - /** - * @param array $array - * @param array $data - * - * @return array - */ private function evaluateArray(array $array, array $data): array { $newArray = []; diff --git a/src/Hateoas.php b/src/Hateoas.php index 294a26ae..7157e8dd 100644 --- a/src/Hateoas.php +++ b/src/Hateoas.php @@ -28,7 +28,7 @@ public function __construct(SerializerInterface $serializer, LinkHelper $linkHel } /** - * {@inheritdoc} + * {@inheritDoc} */ public function serialize($data, string $format, ?SerializationContext $context = null, ?string $type = null): string { @@ -36,7 +36,7 @@ public function serialize($data, string $format, ?SerializationContext $context } /** - * {@inheritdoc} + * {@inheritDoc} */ public function deserialize(string $data, string $type, string $format, ?DeserializationContext $context = null) { diff --git a/src/HateoasBuilder.php b/src/HateoasBuilder.php index dc2fd8c2..81a5fb9a 100644 --- a/src/HateoasBuilder.php +++ b/src/HateoasBuilder.php @@ -303,8 +303,6 @@ public function includeInterfaceMetadata(bool $include): HateoasBuilder * Set a map of namespace prefixes to directories. * * This method overrides any previously defined directories. - * - * @param array $namespacePrefixToDirMap */ public function setMetadataDirs(array $namespacePrefixToDirMap): HateoasBuilder { @@ -357,8 +355,6 @@ public function addMetadataDir(string $dir, string $namespacePrefix = ''): Hateo /** * Add a map of namespace prefixes to directories. - * - * @param array $namespacePrefixToDirMap */ public function addMetadataDirs(array $namespacePrefixToDirMap): HateoasBuilder { diff --git a/src/Model/Link.php b/src/Model/Link.php index 0c0c19e4..0b2a3e02 100644 --- a/src/Model/Link.php +++ b/src/Model/Link.php @@ -21,9 +21,6 @@ class Link */ private $attributes; - /** - * @param array $attributes - */ public function __construct(string $rel, string $href, array $attributes = []) { $this->rel = $rel; @@ -31,9 +28,6 @@ public function __construct(string $rel, string $href, array $attributes = []) $this->attributes = $attributes; } - /** - * @return array - */ public function getAttributes(): array { return $this->attributes; diff --git a/src/Representation/AbstractSegmentedRepresentation.php b/src/Representation/AbstractSegmentedRepresentation.php index bb39f7ac..f0e67d92 100644 --- a/src/Representation/AbstractSegmentedRepresentation.php +++ b/src/Representation/AbstractSegmentedRepresentation.php @@ -60,8 +60,6 @@ public function getLimit(): int /** * @param null $limit - * - * @return array */ public function getParameters(?int $limit = null): array { diff --git a/src/Representation/OffsetRepresentation.php b/src/Representation/OffsetRepresentation.php index cf5db677..bf2847b7 100644 --- a/src/Representation/OffsetRepresentation.php +++ b/src/Representation/OffsetRepresentation.php @@ -94,8 +94,6 @@ public function getOffset(): ?int /** * @param null $offset * @param null $limit - * - * @return array */ public function getParameters(?int $offset = null, ?int $limit = null): array { diff --git a/src/Representation/PaginatedRepresentation.php b/src/Representation/PaginatedRepresentation.php index 9fe8c33b..ef864bc5 100644 --- a/src/Representation/PaginatedRepresentation.php +++ b/src/Representation/PaginatedRepresentation.php @@ -109,8 +109,6 @@ public function getPage(): int /** * @param null $page * @param null $limit - * - * @return array */ public function getParameters($page = null, $limit = null): array { diff --git a/src/Representation/RouteAwareRepresentation.php b/src/Representation/RouteAwareRepresentation.php index f346395b..6532c90b 100644 --- a/src/Representation/RouteAwareRepresentation.php +++ b/src/Representation/RouteAwareRepresentation.php @@ -46,7 +46,6 @@ class RouteAwareRepresentation /** * @param mixed $inline - * @param array $parameters */ public function __construct($inline, string $route, array $parameters = [], bool $absolute = false) { @@ -69,9 +68,6 @@ public function getRoute(): string return $this->route; } - /** - * @return array - */ public function getParameters(): array { return $this->parameters;