From c6584072bce1806c15d699ec45933ad99fb1d459 Mon Sep 17 00:00:00 2001 From: soyuka Date: Fri, 11 Aug 2023 15:43:30 +0200 Subject: [PATCH] cs: fixes --- .gitignore | 5 +++-- src/Api/CompositeIdentifierParser.php | 1 + src/ApiResource/Error.php | 2 +- src/{ => Metadata}/Exception/ProblemExceptionInterface.php | 5 ++++- src/Metadata/IriConverterInterface.php | 1 - src/Metadata/Util/CompositeIdentifierParser.php | 1 + src/Serializer/Tests/Fixtures/ApiResource/SecuredDummy.php | 5 ----- src/State/UriVariablesResolverTrait.php | 4 ++-- src/Symfony/Validator/Exception/ValidationException.php | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) rename src/{ => Metadata}/Exception/ProblemExceptionInterface.php (88%) diff --git a/.gitignore b/.gitignore index ef76a6ce6cf..57d0a18c303 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,10 @@ *.log /.php-cs-fixer.php /.php-cs-fixer.cache -/.phpunit.result.cache +.phpunit.result.cache /.phpunit.cache/ /build/ -/composer.lock +composer.lock /composer.phar /phpstan.neon /phpunit.xml @@ -16,3 +16,4 @@ /tests/Metadata/Extractor/Adapter/*.yaml /vendor/ /Dockerfile + diff --git a/src/Api/CompositeIdentifierParser.php b/src/Api/CompositeIdentifierParser.php index 9a53d072df5..e434e63df4e 100644 --- a/src/Api/CompositeIdentifierParser.php +++ b/src/Api/CompositeIdentifierParser.php @@ -17,6 +17,7 @@ * Normalizes a composite identifier. * * @author Antoine Bluchet + * * @deprecated */ final class CompositeIdentifierParser diff --git a/src/ApiResource/Error.php b/src/ApiResource/Error.php index b68e5974f1a..5d6170c7d0f 100644 --- a/src/ApiResource/Error.php +++ b/src/ApiResource/Error.php @@ -13,10 +13,10 @@ namespace ApiPlatform\ApiResource; -use ApiPlatform\Exception\ProblemExceptionInterface; use ApiPlatform\Metadata\ApiProperty; use ApiPlatform\Metadata\ErrorResource; use ApiPlatform\Metadata\Exception\HttpExceptionInterface; +use ApiPlatform\Metadata\Exception\ProblemExceptionInterface; use ApiPlatform\Metadata\Get; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface as SymfonyHttpExceptionInterface; use Symfony\Component\Serializer\Annotation\Groups; diff --git a/src/Exception/ProblemExceptionInterface.php b/src/Metadata/Exception/ProblemExceptionInterface.php similarity index 88% rename from src/Exception/ProblemExceptionInterface.php rename to src/Metadata/Exception/ProblemExceptionInterface.php index 1fdd37aca85..6b4ef927ac3 100644 --- a/src/Exception/ProblemExceptionInterface.php +++ b/src/Metadata/Exception/ProblemExceptionInterface.php @@ -11,8 +11,11 @@ declare(strict_types=1); -namespace ApiPlatform\Exception; +namespace ApiPlatform\Metadata\Exception; +/** + * Implements the Problem Error specification. + */ interface ProblemExceptionInterface { public function getType(): string; diff --git a/src/Metadata/IriConverterInterface.php b/src/Metadata/IriConverterInterface.php index c85fb10882c..b55bb75b984 100644 --- a/src/Metadata/IriConverterInterface.php +++ b/src/Metadata/IriConverterInterface.php @@ -17,7 +17,6 @@ use ApiPlatform\Metadata\Exception\ItemNotFoundException; use ApiPlatform\Metadata\Exception\RuntimeException; - /** * Converts item and resources to IRI and vice versa. * diff --git a/src/Metadata/Util/CompositeIdentifierParser.php b/src/Metadata/Util/CompositeIdentifierParser.php index 67613d2ef77..f433cdf0abe 100644 --- a/src/Metadata/Util/CompositeIdentifierParser.php +++ b/src/Metadata/Util/CompositeIdentifierParser.php @@ -17,6 +17,7 @@ * Normalizes a composite identifier. * * @internal + * * @author Antoine Bluchet */ final class CompositeIdentifierParser diff --git a/src/Serializer/Tests/Fixtures/ApiResource/SecuredDummy.php b/src/Serializer/Tests/Fixtures/ApiResource/SecuredDummy.php index 8ee4d0696de..1b02f8a721f 100644 --- a/src/Serializer/Tests/Fixtures/ApiResource/SecuredDummy.php +++ b/src/Serializer/Tests/Fixtures/ApiResource/SecuredDummy.php @@ -101,8 +101,6 @@ class SecuredDummy /** * A dummy that only users can access. The security on RelatedSecuredDummy shouldn't be run. - * - * @var mixed */ #[ApiProperty(security: "is_granted('ROLE_USER')")] protected $relatedSecuredDummy; @@ -114,8 +112,6 @@ class SecuredDummy /** * A dummy that anyone can access. There is no ApiProperty security, and the security on RelatedSecuredDummy shouldn't be run. - * - * @var mixed */ protected $publicRelatedSecuredDummy; @@ -180,5 +176,4 @@ public function setOwner(string $owner): void { $this->owner = $owner; } - } diff --git a/src/State/UriVariablesResolverTrait.php b/src/State/UriVariablesResolverTrait.php index 2742da937e6..b9e222aab0a 100644 --- a/src/State/UriVariablesResolverTrait.php +++ b/src/State/UriVariablesResolverTrait.php @@ -13,10 +13,10 @@ namespace ApiPlatform\State; -use ApiPlatform\Metadata\Util\CompositeIdentifierParser; -use ApiPlatform\Metadata\UriVariablesConverterInterface; use ApiPlatform\Metadata\Exception\InvalidIdentifierException; use ApiPlatform\Metadata\HttpOperation; +use ApiPlatform\Metadata\UriVariablesConverterInterface; +use ApiPlatform\Metadata\Util\CompositeIdentifierParser; trait UriVariablesResolverTrait { diff --git a/src/Symfony/Validator/Exception/ValidationException.php b/src/Symfony/Validator/Exception/ValidationException.php index a2ff6945e40..5f582d4e31a 100644 --- a/src/Symfony/Validator/Exception/ValidationException.php +++ b/src/Symfony/Validator/Exception/ValidationException.php @@ -13,10 +13,10 @@ namespace ApiPlatform\Symfony\Validator\Exception; -use ApiPlatform\Api\CompositeIdentifierParser; -use ApiPlatform\Exception\ProblemExceptionInterface; use ApiPlatform\Metadata\ErrorResource; +use ApiPlatform\Metadata\Exception\ProblemExceptionInterface; use ApiPlatform\Metadata\Get; +use ApiPlatform\Metadata\Util\CompositeIdentifierParser; use ApiPlatform\Validator\Exception\ValidationException as BaseValidationException; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\SerializedName;