src/JsonApiResource/LinkCollection.php | 1 + src/Normalizer/ContentEntityDenormalizer.php | 14 +------------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/JsonApiResource/LinkCollection.php b/src/JsonApiResource/LinkCollection.php index bc5fb24..3e0429c 100644 --- a/src/JsonApiResource/LinkCollection.php +++ b/src/JsonApiResource/LinkCollection.php @@ -114,6 +114,7 @@ final class LinkCollection implements \IteratorAggregate { * A new LinkCollection with the given context. */ public function withContext($context) { + assert(Inspector::assertAllObjects([$context], JsonApiDocumentTopLevel::class, ResourceObject::class)); return new static($this->links, $context); } diff --git a/src/Normalizer/ContentEntityDenormalizer.php b/src/Normalizer/ContentEntityDenormalizer.php index 5c5157a..7d6c28d 100644 --- a/src/Normalizer/ContentEntityDenormalizer.php +++ b/src/Normalizer/ContentEntityDenormalizer.php @@ -19,19 +19,7 @@ final class ContentEntityDenormalizer extends EntityDenormalizerBase { protected $supportedInterfaceOrClass = ContentEntityInterface::class; /** - * Prepares the input data to create the entity. - * - * @param array $data - * The input data to modify. - * @param \Drupal\jsonapi\ResourceType\ResourceType $resource_type - * Contains the info about the resource type. - * @param string $format - * Format the given data was extracted from. - * @param array $context - * Options available to the denormalizer. - * - * @return array - * The modified input data. + * {@inheritdoc} */ protected function prepareInput(array $data, ResourceType $resource_type, $format, array $context) { $data_internal = [];