src/Controller/EntryPoint.php | 4 ++-- src/JsonApiResource/LinkCollection.php | 2 +- src/Normalizer/Value/NormalizedValue.php | 7 ------- tests/src/Functional/EntryPointTest.php | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/Controller/EntryPoint.php b/src/Controller/EntryPoint.php index e98cb79..9e430ef 100644 --- a/src/Controller/EntryPoint.php +++ b/src/Controller/EntryPoint.php @@ -78,7 +78,7 @@ class EntryPoint extends ControllerBase { }); $self_link = new Link(new CacheableMetadata(), Url::fromRoute('jsonapi.resource_list'), ['self']); - $urls = array_reduce($resources, function (LinkCollection $carry, ResourceType $resource_type) { + $links = array_reduce($resources, function (LinkCollection $carry, ResourceType $resource_type) { if ($resource_type->isLocatable() || $resource_type->isMutable()) { $route_suffix = $resource_type->isLocatable() ? 'collection' : 'collection.post'; $url = Url::fromRoute(sprintf('jsonapi.%s.%s', $resource_type->getTypeName(), $route_suffix))->setAbsolute(); @@ -100,7 +100,7 @@ class EntryPoint extends ControllerBase { $cacheability = $cacheability->merge($me_url)->addCacheContexts(['user']); } - $response = new ResourceResponse(new JsonApiDocumentTopLevel(new EntityCollection([]), new NullEntityCollection(), $urls, $meta)); + $response = new ResourceResponse(new JsonApiDocumentTopLevel(new EntityCollection([]), new NullEntityCollection(), $links, $meta)); return $response->addCacheableDependency($cacheability); } diff --git a/src/JsonApiResource/LinkCollection.php b/src/JsonApiResource/LinkCollection.php index 1a5519a..9c3d14c 100644 --- a/src/JsonApiResource/LinkCollection.php +++ b/src/JsonApiResource/LinkCollection.php @@ -19,7 +19,7 @@ class LinkCollection implements \IteratorAggregate { protected $links; /** - * LinkCollection constructor. + * JSON:API LinkCollection constructor. * * @param \Drupal\jsonapi\JsonApiResource\Link[] $links * An associated array of key names and JSON:API Link objects. diff --git a/src/Normalizer/Value/NormalizedValue.php b/src/Normalizer/Value/NormalizedValue.php index 46ebebb..08eb815 100644 --- a/src/Normalizer/Value/NormalizedValue.php +++ b/src/Normalizer/Value/NormalizedValue.php @@ -41,11 +41,4 @@ class NormalizedValue implements ValueExtractorInterface, CacheableDependencyInt return $this->value; } - /** - * {@inheritdoc} - */ - public function rasterizeIncludes() { - return []; - } - } diff --git a/tests/src/Functional/EntryPointTest.php b/tests/src/Functional/EntryPointTest.php index c6e08c5..e68461b 100644 --- a/tests/src/Functional/EntryPointTest.php +++ b/tests/src/Functional/EntryPointTest.php @@ -32,7 +32,7 @@ class EntryPointTest extends BrowserTestBase { * Test GETing the entry point. */ public function testEntryPoint() { - $response = $this->request('GET', Url::fromUri('base://jsonapi'), [RequestOptions::HEADERS => ['Accept' => 'application/vnd.api+json']]); + $response = $this->request('GET', Url::fromUri('base:/jsonapi'), [RequestOptions::HEADERS => ['Accept' => 'application/vnd.api+json']]); $document = Json::decode((string) $response->getBody()); $expected_cache_contexts = [ // @todo: remove the `url.query_args` cache contexts in https://www.drupal.org/project/jsonapi/issues/2992673.