Skip to content

Commit

Permalink
Fixed some issues reported by scrutinizer
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Dec 31, 2015
1 parent 30ea3a5 commit 9bb3b4c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ORM/Query.php
Expand Up @@ -303,11 +303,11 @@ public function contain($associations = null, $override = false)
$this->_dirty();
}

$result = $loader->contain($associations);
if ($associations === null) {
return $result;
return $loader->contain();
}

$result = $loader->contain($associations);
$this->_addAssociationsToTypeMap($this->repository(), $this->typeMap(), $result);
return $this;
}
Expand All @@ -324,7 +324,6 @@ public function contain($associations = null, $override = false)
*/
protected function _addAssociationsToTypeMap($table, $typeMap, $associations)
{
$typeMap = $this->typeMap();
foreach ($associations as $name => $nested) {
$association = $table->association($name);
if (!$association) {
Expand Down Expand Up @@ -771,7 +770,10 @@ protected function _performCount()
* The callback will receive as first argument a clone of this query and not this
* query itself.
*
* @param callable $counter The counter value
* If the first param is a null value, the built-in counter function will be called
* instead
*
* @param callable|null $counter The counter value
* @return $this
*/
public function counter($counter)
Expand Down

0 comments on commit 9bb3b4c

Please sign in to comment.