diff --git a/src/Context/FieldResolver.php b/src/Context/FieldResolver.php index b2adcd3..9eab90d 100644 --- a/src/Context/FieldResolver.php +++ b/src/Context/FieldResolver.php @@ -3,7 +3,7 @@ namespace Drupal\jsonapi\Context; use Drupal\Core\Entity\EntityFieldManagerInterface; -use Drupal\jsonapi\Error\SerializableHttpException; +use Drupal\jsonapi\Exception\SerializableHttpException; /** * Service which resolves public field names to and from Drupal field names. diff --git a/src/Controller/EntityResource.php b/src/Controller/EntityResource.php index 03eb30c..92cc17b 100644 --- a/src/Controller/EntityResource.php +++ b/src/Controller/EntityResource.php @@ -18,8 +18,8 @@ use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem; use Drupal\jsonapi\Resource\EntityCollection; use Drupal\jsonapi\Resource\JsonApiDocumentTopLevel; use Drupal\jsonapi\ResourceType\ResourceType; -use Drupal\jsonapi\Error\SerializableHttpException; -use Drupal\jsonapi\Error\UnprocessableHttpEntityException; +use Drupal\jsonapi\Exception\SerializableHttpException; +use Drupal\jsonapi\Exception\UnprocessableHttpEntityException; use Drupal\jsonapi\Query\QueryBuilder; use Drupal\jsonapi\Context\CurrentContext; use Drupal\jsonapi\ResourceResponse; @@ -129,7 +129,7 @@ class EntityResource { * @param \Drupal\Core\Entity\EntityInterface $entity * The entity object. * - * @throws \Drupal\jsonapi\Error\SerializableHttpException + * @throws \Drupal\jsonapi\Exception\SerializableHttpException * If validation errors are found. */ protected function validate(EntityInterface $entity) { diff --git a/src/Controller/RequestHandler.php b/src/Controller/RequestHandler.php index c4616b0..c318b5a 100644 --- a/src/Controller/RequestHandler.php +++ b/src/Controller/RequestHandler.php @@ -7,7 +7,7 @@ use Drupal\Core\Render\RenderContext; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\jsonapi\Context\CurrentContext; use Drupal\jsonapi\Error\ErrorHandler; -use Drupal\jsonapi\Error\SerializableHttpException; +use Drupal\jsonapi\Exception\SerializableHttpException; use Drupal\jsonapi\ResourceResponse; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; diff --git a/src/EventSubscriber/DefaultExceptionSubscriber.php b/src/EventSubscriber/DefaultExceptionSubscriber.php index 55c1a8d..fb21a3e 100644 --- a/src/EventSubscriber/DefaultExceptionSubscriber.php +++ b/src/EventSubscriber/DefaultExceptionSubscriber.php @@ -2,7 +2,7 @@ namespace Drupal\jsonapi\EventSubscriber; -use Drupal\jsonapi\Error\SerializableHttpException; +use Drupal\jsonapi\Exception\SerializableHttpException; use Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber as SerializationDefaultExceptionSubscriber; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; diff --git a/src/Error/SerializableHttpException.php b/src/Exception/SerializableHttpException.php similarity index 87% rename from src/Error/SerializableHttpException.php rename to src/Exception/SerializableHttpException.php index 91b0732..3aaa117 100644 --- a/src/Error/SerializableHttpException.php +++ b/src/Exception/SerializableHttpException.php @@ -1,6 +1,6 @@ prophesize(EntityFieldManagerInterface::class); diff --git a/tests/src/Unit/LinkManager/LinkManagerTest.php b/tests/src/Unit/LinkManager/LinkManagerTest.php index 65ccefe..996e59c 100644 --- a/tests/src/Unit/LinkManager/LinkManagerTest.php +++ b/tests/src/Unit/LinkManager/LinkManagerTest.php @@ -120,7 +120,7 @@ class LinkManagerTest extends UnitTestCase { * Test errors. * * @covers ::getPagerLinks - * @expectedException \Drupal\jsonapi\Error\SerializableHttpException + * @expectedException \Drupal\jsonapi\Exception\SerializableHttpException * @dataProvider getPagerLinksErrorProvider */ public function testGetPagerLinksError($offset, $size, $total, array $pages) { diff --git a/tests/src/Unit/Normalizer/EntityReferenceFieldNormalizerTest.php b/tests/src/Unit/Normalizer/EntityReferenceFieldNormalizerTest.php index 144ffc6..2f27c5d 100644 --- a/tests/src/Unit/Normalizer/EntityReferenceFieldNormalizerTest.php +++ b/tests/src/Unit/Normalizer/EntityReferenceFieldNormalizerTest.php @@ -130,7 +130,7 @@ class EntityReferenceFieldNormalizerTest extends UnitTestCase { /** * @covers ::denormalize - * @expectedException \Drupal\jsonapi\Error\SerializableHttpException + * @expectedException \Drupal\jsonapi\Exception\SerializableHttpException * @dataProvider denormalizeInvalidResourceProvider */ public function testDenormalizeInvalidResource($data, $field_name) { diff --git a/tests/src/Unit/Routing/Param/FilterTest.php b/tests/src/Unit/Routing/Param/FilterTest.php index ebddb20..15b1928 100644 --- a/tests/src/Unit/Routing/Param/FilterTest.php +++ b/tests/src/Unit/Routing/Param/FilterTest.php @@ -87,7 +87,7 @@ class FilterTest extends UnitTestCase { /** * @covers ::get - * @expectedException \Drupal\jsonapi\Error\SerializableHttpException + * @expectedException \Drupal\jsonapi\Exception\SerializableHttpException */ public function testGetFail() { $pager = new Filter( diff --git a/tests/src/Unit/Routing/Param/OffsetPageTest.php b/tests/src/Unit/Routing/Param/OffsetPageTest.php index a5fb407..c23e5e0 100644 --- a/tests/src/Unit/Routing/Param/OffsetPageTest.php +++ b/tests/src/Unit/Routing/Param/OffsetPageTest.php @@ -35,7 +35,7 @@ class OffsetPageTest extends UnitTestCase { /** * @covers ::get - * @expectedException \Drupal\jsonapi\Error\SerializableHttpException + * @expectedException \Drupal\jsonapi\Exception\SerializableHttpException */ public function testGetFail() { $pager = new OffsetPage('lorem'); diff --git a/tests/src/Unit/Routing/Param/SortTest.php b/tests/src/Unit/Routing/Param/SortTest.php index 5774029..a407ea5 100644 --- a/tests/src/Unit/Routing/Param/SortTest.php +++ b/tests/src/Unit/Routing/Param/SortTest.php @@ -52,7 +52,7 @@ class SortTest extends UnitTestCase { /** * @covers ::get * @dataProvider getFailProvider - * @expectedException \Drupal\jsonapi\Error\SerializableHttpException + * @expectedException \Drupal\jsonapi\Exception\SerializableHttpException */ public function testGetFail($input) { $sort = new Sort($input);