Skip to content

Commit d62a8c6

Browse files
author
Ted Bowman
committed
move ResourceResponse
1 parent 0af2970 commit d62a8c6

7 files changed

Lines changed: 11 additions & 11 deletions

File tree

core/modules/rest/src/ResourceResponse.php renamed to core/lib/Drupal/Core/Response/ResourceResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Drupal\rest;
3+
namespace Drupal\Core\Response;
44

55
use Drupal\Core\Cache\CacheableResponseInterface;
66
use Drupal\Core\Cache\CacheableResponseTrait;

core/modules/dblog/src/Plugin/rest/resource/DBLogResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Drupal\dblog\Plugin\rest\resource;
44

55
use Drupal\Core\Plugin\ResourceBase;
6-
use Drupal\rest\ResourceResponse;
6+
use Drupal\Core\Response\ResourceResponse;
77
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
88
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
99

@@ -28,7 +28,7 @@ class DBLogResource extends ResourceBase {
2828
* @param int $id
2929
* The ID of the watchdog log entry.
3030
*
31-
* @return \Drupal\rest\ResourceResponse
31+
* @return \Drupal\Core\Response\ResourceResponse
3232
* The response containing the log entry.
3333
*
3434
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException

core/modules/rest/src/ModifiedResourceResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Used when resources are modified by a request: responses to unsafe requests
1313
* (POST/PATCH/DELETE) can never be cached.
1414
*
15-
* @see \Drupal\rest\ResourceResponse
15+
* @see \Drupal\Core\Response\ResourceResponse
1616
*/
1717
class ModifiedResourceResponse extends Response implements ResourceResponseInterface {
1818

core/modules/rest/src/Plugin/rest/resource/EntityResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Drupal\Core\Field\FieldItemListInterface;
1515
use Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException;
1616
use Drupal\Core\Plugin\ResourceBase;
17-
use Drupal\rest\ResourceResponse;
17+
use Drupal\Core\Response\ResourceResponse;
1818
use Psr\Log\LoggerInterface;
1919
use Symfony\Component\DependencyInjection\ContainerInterface;
2020
use Drupal\rest\ModifiedResourceResponse;
@@ -114,7 +114,7 @@ public static function create(ContainerInterface $container, array $configuratio
114114
* @param \Drupal\Core\Entity\EntityInterface $entity
115115
* The entity object.
116116
*
117-
* @return \Drupal\rest\ResourceResponse
117+
* @return \Drupal\Core\Response\ResourceResponse
118118
* The response containing the entity with its accessible fields.
119119
*
120120
* @throws \Symfony\Component\HttpKernel\Exception\HttpException

core/modules/rest/tests/modules/rest_test/src/Plugin/rest/resource/NoSerializationClassTestResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Drupal\rest_test\Plugin\rest\resource;
44

55
use Drupal\Core\Plugin\ResourceBase;
6-
use Drupal\rest\ResourceResponse;
6+
use Drupal\Core\Response\ResourceResponse;
77

88
/**
99
* Class used to test that serialization_class is optional.
@@ -23,7 +23,7 @@ class NoSerializationClassTestResource extends ResourceBase {
2323
* @param array $data
2424
* An array with the payload.
2525
*
26-
* @return \Drupal\rest\ResourceResponse
26+
* @return \Drupal\Core\Response\ResourceResponse
2727
*/
2828
public function post(array $data) {
2929
return new ResourceResponse($data);

core/modules/rest/tests/src/Kernel/RequestHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Drupal\KernelTests\KernelTestBase;
99
use Drupal\Core\Plugin\ResourceBase;
1010
use Drupal\rest\RequestHandler;
11-
use Drupal\rest\ResourceResponse;
11+
use Drupal\Core\Response\ResourceResponse;
1212
use Drupal\rest\RestResourceConfigInterface;
1313
use Symfony\Component\HttpFoundation\Request;
1414
use Symfony\Component\Routing\Route;

core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Drupal\Core\Routing\RouteMatchInterface;
1111
use Drupal\Core\EventSubscriber\ResourceResponseSubscriber;
1212
use Drupal\rest\ModifiedResourceResponse;
13-
use Drupal\rest\ResourceResponse;
13+
use Drupal\Core\Response\ResourceResponse;
1414
use Drupal\Core\Response\ResourceResponseInterface;
1515
use Drupal\serialization\Encoder\JsonEncoder;
1616
use Drupal\serialization\Encoder\XmlEncoder;
@@ -53,7 +53,7 @@ public function testSerialization($data, $expected_response = FALSE) {
5353

5454
public function providerTestSerialization() {
5555
return [
56-
// The default data for \Drupal\rest\ResourceResponse.
56+
// The default data for \Drupal\Core\Response\ResourceResponse.
5757
'default' => [NULL, ''],
5858
'empty string' => [''],
5959
'simple string' => ['string'],

0 commit comments

Comments
 (0)