Skip to content

Commit

Permalink
DocumentHydratorInterface should extend HydratorInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Mar 26, 2019
1 parent eba24d5 commit c4cbab8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 1 addition & 8 deletions src/JsonApi/Hydrator/DocumentHydratorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use WoohooLabs\Yang\JsonApi\Schema\Document;

interface DocumentHydratorInterface
interface DocumentHydratorInterface extends HydratorInterface
{
/**
* Hydrates a document into an array/list of items regardless if the primary data is a single resource or a
Expand All @@ -21,11 +21,4 @@ public function hydrate(Document $document): iterable;
* @return mixed
*/
public function hydrateSingleResource(Document $document);

/**
* Hydrates a document when its primary data is a collection of resources.
*
* @return iterable<mixed>
*/
public function hydrateCollection(Document $document): iterable;
}
7 changes: 7 additions & 0 deletions src/JsonApi/Hydrator/HydratorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@
interface HydratorInterface
{
/**
* Hydrates a document regardless if the primary data is a single resource or * collection of primary resources.
*
* @return mixed
*/
public function hydrate(Document $document);

/**
* Hydrates a document when its primary data is a collection of resources.
*
* @return iterable<mixed>
*/
public function hydrateCollection(Document $document): iterable;
}

0 comments on commit c4cbab8

Please sign in to comment.