Skip to content

Commit 609aab2

Browse files
authored
fix(validator): move exception+interface to ApiPlatform\Validator (#4682)
1 parent abab585 commit 609aab2

File tree

13 files changed

+17
-16
lines changed

13 files changed

+17
-16
lines changed

src/GraphQl/Resolver/Stage/ValidateStage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace ApiPlatform\GraphQl\Resolver\Stage;
1515

1616
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
17-
use ApiPlatform\Symfony\EventListener\ValidatorInterface;
17+
use ApiPlatform\Validator\ValidatorInterface;
1818

1919
/**
2020
* Validate stage of GraphQL resolvers.

src/Symfony/EventListener/ValidateListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
1717
use ApiPlatform\Core\Metadata\Resource\ToggleableOperationAttributeTrait;
1818
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
19-
use ApiPlatform\Symfony\EventListener\Exception\ValidationException;
2019
use ApiPlatform\Util\OperationRequestInitiatorTrait;
2120
use ApiPlatform\Util\RequestAttributesExtractor;
21+
use ApiPlatform\Validator\Exception\ValidationException;
22+
use ApiPlatform\Validator\ValidatorInterface;
2223
use Symfony\Component\HttpFoundation\Response;
2324
use Symfony\Component\HttpKernel\Event\ViewEvent;
2425

src/Symfony/Validator/Exception/ValidationException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace ApiPlatform\Symfony\Validator\Exception;
1515

16-
use ApiPlatform\Symfony\EventListener\Exception\ValidationException as BaseValidationException;
16+
use ApiPlatform\Validator\Exception\ValidationException as BaseValidationException;
1717
use Symfony\Component\Validator\ConstraintViolationListInterface;
1818

1919
/**

src/Symfony/Validator/Validator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
namespace ApiPlatform\Symfony\Validator;
1515

16-
use ApiPlatform\Symfony\EventListener\ValidatorInterface;
1716
use ApiPlatform\Symfony\Validator\Exception\ValidationException;
17+
use ApiPlatform\Validator\ValidatorInterface;
1818
use Psr\Container\ContainerInterface;
1919
use Symfony\Component\Validator\Constraints\GroupSequence;
2020
use Symfony\Component\Validator\Validator\ValidatorInterface as SymfonyValidatorInterface;

src/Symfony/EventListener/Exception/ValidationException.php renamed to src/Validator/Exception/ValidationException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
declare(strict_types=1);
1313

14-
namespace ApiPlatform\Symfony\EventListener\Exception;
14+
namespace ApiPlatform\Validator\Exception;
1515

1616
use ApiPlatform\Exception\RuntimeException;
1717

src/Symfony/EventListener/ValidatorInterface.php renamed to src/Validator/ValidatorInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
declare(strict_types=1);
1313

14-
namespace ApiPlatform\Symfony\EventListener;
14+
namespace ApiPlatform\Validator;
1515

16-
use ApiPlatform\Symfony\EventListener\Exception\ValidationException;
16+
use ApiPlatform\Validator\Exception\ValidationException;
1717

1818
/**
1919
* Validates an item.

src/deprecated_interfaces.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
ApiPlatform\Core\Serializer\Filter\FilterInterface::class => ApiPlatform\Serializer\Filter\FilterInterface::class,
9898
ApiPlatform\Core\Serializer\SerializerContextBuilderInterface::class => ApiPlatform\Serializer\SerializerContextBuilderInterface::class,
9999

100-
ApiPlatform\Core\Validator\ValidatorInterface::class => ApiPlatform\Symfony\EventListener\ValidatorInterface::class,
100+
ApiPlatform\Core\Validator\ValidatorInterface::class => ApiPlatform\Validator\ValidatorInterface::class,
101101

102102
// API:
103103
ApiPlatform\Core\Api\ResourceClassResolverInterface::class => ApiPlatform\Api\ResourceClassResolverInterface::class,

src/deprecation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ class_alias($interfaceName, $oldInterfaceName);
274274

275275
// Bridge\Symfony\Validator
276276
ApiPlatform\Core\Bridge\Symfony\Validator\EventListener\ValidationExceptionListener::class => ApiPlatform\Symfony\Validator\EventListener\ValidationExceptionListener::class,
277-
ApiPlatform\Core\Bridge\Symfony\Validator\Exception\ValidationException::class => ApiPlatform\Symfony\Validator\Exception\ValidationException::class,
277+
ApiPlatform\Core\Bridge\Symfony\Validator\Exception\ValidationException::class => ApiPlatform\Validator\Exception\ValidationException::class,
278278
ApiPlatform\Core\Bridge\Symfony\Validator\Validator::class => ApiPlatform\Symfony\Validator\Validator::class,
279279

280280
// Cache

tests/Core/Bridge/Symfony/Validator/EventListener/ValidateListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
1818
use ApiPlatform\Core\Metadata\Resource\ResourceMetadata;
1919
use ApiPlatform\Core\Tests\ProphecyTrait;
20-
use ApiPlatform\Symfony\Validator\Exception\ValidationException;
2120
use ApiPlatform\Tests\Fixtures\DummyEntity;
21+
use ApiPlatform\Validator\Exception\ValidationException;
2222
use PHPUnit\Framework\TestCase;
2323
use Prophecy\Argument;
2424
use Psr\Container\ContainerInterface;

tests/Core/Validator/EventListener/ValidateListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
1717
use ApiPlatform\Core\Metadata\Resource\ResourceMetadata;
1818
use ApiPlatform\Core\Tests\ProphecyTrait;
19-
use ApiPlatform\Symfony\EventListener\Exception\ValidationException;
2019
use ApiPlatform\Symfony\EventListener\ValidateListener;
21-
use ApiPlatform\Symfony\EventListener\ValidatorInterface;
2220
use ApiPlatform\Tests\Fixtures\DummyEntity;
21+
use ApiPlatform\Validator\Exception\ValidationException;
22+
use ApiPlatform\Validator\ValidatorInterface;
2323
use PHPUnit\Framework\TestCase;
2424
use Prophecy\Argument;
2525
use Symfony\Component\HttpFoundation\Request;

0 commit comments

Comments
 (0)