.../JsonApiDocumentTopLevelNormalizer.php | 2 +- .../Value/DocumentRootNormalizerValue.php | 2 +- src/Normalizer/Value/EntityNormalizerValue.php | 10 +++++++--- .../Value/EntityNormalizerValueInterface.php | 22 ---------------------- src/Normalizer/Value/FieldItemNormalizerValue.php | 2 +- .../Value/FieldItemNormalizerValueInterface.php | 2 +- .../Normalizer/Value/EntityNormalizerValueTest.php | 2 +- .../Normalizer/Value/FieldNormalizerValueTest.php | 2 +- 8 files changed, 13 insertions(+), 31 deletions(-) diff --git a/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php b/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php index 3702841..cad1895 100644 --- a/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php +++ b/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php @@ -135,7 +135,7 @@ class JsonApiDocumentTopLevelNormalizer extends NormalizerBase implements Denorm /** * Build the normalizer value. * - * @return \Drupal\jsonapi\Normalizer\Value\EntityNormalizerValueInterface + * @return \Drupal\jsonapi\Normalizer\Value\DocumentRootNormalizerValue * The normalizer value. */ public function buildNormalizerValue($data, $format = NULL, array $context = array()) { diff --git a/src/Normalizer/Value/DocumentRootNormalizerValue.php b/src/Normalizer/Value/DocumentRootNormalizerValue.php index 8f877c7..8980676 100644 --- a/src/Normalizer/Value/DocumentRootNormalizerValue.php +++ b/src/Normalizer/Value/DocumentRootNormalizerValue.php @@ -142,7 +142,7 @@ class DocumentRootNormalizerValue implements ValueExtractorInterface, RefinableC /** * Gets a flattened list of includes in all the chain. * - * @return EntityNormalizerValueInterface[] + * @return \Drupal\jsonapi\Normalizer\Value\EntityNormalizerValue[] * The array of included relationships. */ public function getIncludes() { diff --git a/src/Normalizer/Value/EntityNormalizerValue.php b/src/Normalizer/Value/EntityNormalizerValue.php index 26012c1..a769cd1 100644 --- a/src/Normalizer/Value/EntityNormalizerValue.php +++ b/src/Normalizer/Value/EntityNormalizerValue.php @@ -2,6 +2,7 @@ namespace Drupal\jsonapi\Normalizer\Value; +use Drupal\Core\Cache\RefinableCacheableDependencyInterface; use Drupal\Core\Cache\RefinableCacheableDependencyTrait; use Drupal\Core\Entity\EntityInterface; @@ -10,7 +11,7 @@ use Drupal\Core\Entity\EntityInterface; * * @package Drupal\jsonapi\Normalizer\Value */ -class EntityNormalizerValue implements EntityNormalizerValueInterface { +class EntityNormalizerValue implements ValueExtractorInterface, RefinableCacheableDependencyInterface { use RefinableCacheableDependencyTrait; @@ -121,7 +122,10 @@ class EntityNormalizerValue implements EntityNormalizerValueInterface { } /** - * {@inheritdoc} + * Gets the values. + * + * @return mixed + * The values. */ public function getValues() { return $this->values; @@ -130,7 +134,7 @@ class EntityNormalizerValue implements EntityNormalizerValueInterface { /** * Gets a flattened list of includes in all the chain. * - * @return EntityNormalizerValueInterface + * @return \Drupal\jsonapi\Normalizer\Value\EntityNormalizerValue[] * The array of included relationships. */ public function getIncludes() { diff --git a/src/Normalizer/Value/EntityNormalizerValueInterface.php b/src/Normalizer/Value/EntityNormalizerValueInterface.php deleted file mode 100644 index bb70efe..0000000 --- a/src/Normalizer/Value/EntityNormalizerValueInterface.php +++ /dev/null @@ -1,22 +0,0 @@ -prophesize('\Drupal\jsonapi\Normalizer\Value\FieldItemNormalizerValueInterface'); - $include = $this->prophesize('\Drupal\jsonapi\Normalizer\Value\EntityNormalizerValueInterface'); + $include = $this->prophesize('\Drupal\jsonapi\Normalizer\Value\EntityNormalizerValue'); $include->rasterizeValue()->willReturn('Lorem'); $value->getInclude()->willReturn($include->reveal()); $object = new FieldNormalizerValue([$value->reveal()], 1);