Skip to content

Commit

Permalink
Merge pull request #251 from analogueorm/analysis-8Al5p9
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
RemiCollin authored Feb 23, 2018
2 parents 68e58b1 + 03b782f commit 3dcfd51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/System/Proxies/CollectionProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace Analogue\ORM\System\Proxies;

use Analogue\ORM\EntityCollection;
use Analogue\ORM\Relationships\Relationship;
use Analogue\ORM\System\Manager;
use CachingIterator;
use Illuminate\Support\Collection;
use ProxyManager\Proxy\ProxyInterface;
use Analogue\ORM\Relationships\Relationship;

class CollectionProxy extends EntityCollection implements ProxyInterface
{
Expand Down Expand Up @@ -83,15 +83,16 @@ public function initializeProxy() : bool
}

/**
* Return instance of the underlying relationship
*
* Return instance of the underlying relationship.
*
* @return Relationship
*/
protected function getRelationshipInstance() : Relationship
{
$relation = $this->relationshipMethod;
$entity = $this->parentEntity;
$entityMap = Manager::getMapper($entity)->getEntityMap();

return $entityMap->$relation($entity);
}

Expand Down Expand Up @@ -208,7 +209,7 @@ public function diffUsing($items, callable $callback)

return $parent->diff($items, $callback);
}

/**
* {@inheritdoc}
*/
Expand Down Expand Up @@ -1137,9 +1138,9 @@ public function count()
}

/**
* Do a count query and return the result
*
* @return integer
* Do a count query and return the result.
*
* @return int
*/
protected function countUsingDatabaseQuery() : int
{
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/CollectionProxyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function we_can_remove_from_a_lazy_collection_without_loading_it()
{
}

/**
/**
* Create a random related set.
*
* @return int
Expand All @@ -97,6 +97,7 @@ protected function createRelatedSet($relatedCount = 1)
'group_id' => $groupId,
]);
}

return $userId;
}
}

0 comments on commit 3dcfd51

Please sign in to comment.