Skip to content

Commit

Permalink
Merge pull request #8 from OskarD/development
Browse files Browse the repository at this point in the history
Fixed some typehinting problems
  • Loading branch information
OskarD committed Jun 2, 2016
2 parents 39a4e4d + 89aebec commit e60b90e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 0 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
<whitelist>
<directory>./src/</directory>
<exclude>
<directory>./src/config/</directory>
<directory>./src/Facades/</directory>
<directory>./vendor/</directory>
</exclude>
</whitelist>
Expand Down
16 changes: 9 additions & 7 deletions src/OskarD/JsonApiModel/Factories/ApiModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Art4\JsonApiClient\Resource\CollectionInterface;
use Art4\JsonApiClient\Resource\IdentifierCollectionInterface;
use Art4\JsonApiClient\Resource\Item;
use Art4\JsonApiClient\Resource\ResourceInterface;
use Art4\JsonApiClient\Utils\DataContainer;
use OskarD\JsonApiModel\ApiModelInterface;
use OskarD\JsonApiModel\Exceptions\ApiModelBuilderException;
Expand Down Expand Up @@ -54,14 +55,15 @@ public function build()
}

/**
* Builds an <code>ApiModel</code> from an <code>ElementInterface</code>.
* Builds an <code>ApiModel</code> from a <code>ResourceInterface</code>.
*
* @param \Art4\JsonApiClient\ElementInterface $resource
* @return array|\OskarD\JsonApiModel\ApiModelInterface
* @param \Art4\JsonApiClient\Resource\ResourceInterface $resource
* @return array
*/
protected function buildResource(ElementInterface $resource)
protected function buildResource(ResourceInterface $resource)
{
if ($this->isCollection($resource)) {
if ($resource->isCollection()) {
/** @var CollectionInterface $resource */
return $this->buildFromCollection($resource);
}

Expand Down Expand Up @@ -106,10 +108,10 @@ protected function documentContainsACollection()
/**
* Builds objects from an <code>ElementInterface</code> <code>Collection</code>.
*
* @param \Art4\JsonApiClient\ElementInterface $collection
* @param \Art4\JsonApiClient\Resource\CollectionInterface $collection
* @return array
*/
protected function buildFromCollection(ElementInterface $collection)
protected function buildFromCollection(CollectionInterface $collection)
{
$items = [];

Expand Down

0 comments on commit e60b90e

Please sign in to comment.