Skip to content

Commit

Permalink
TransformerAbstract should return a ResourceInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoît Burnichon committed Mar 23, 2016
1 parent 16f0762 commit efb4366
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/TransformerAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use League\Fractal\Resource\Collection;
use League\Fractal\Resource\Item;
use League\Fractal\Resource\NullResource;
use League\Fractal\Resource\ResourceAbstract;
use League\Fractal\Resource\ResourceInterface;

/**
* Transformer Abstract
Expand Down Expand Up @@ -188,13 +188,13 @@ protected function callIncludeMethod(Scope $scope, $includeName, $data)
return false;
}

if (! $resource instanceof ResourceAbstract) {
if (! $resource instanceof ResourceInterface) {
throw new \Exception(sprintf(
'Invalid return value from %s::%s(). Expected %s, received %s.',
__CLASS__,
$methodName,
'League\Fractal\Resource\ResourceAbstract',
gettype($resource)
'League\Fractal\Resource\ResourceInterface',
is_object($resource) ? get_class($resource) : gettype($resource)
));
}

Expand Down

0 comments on commit efb4366

Please sign in to comment.