Skip to content

Commit

Permalink
fixed PHP 7.2 compatibility (#190)
Browse files Browse the repository at this point in the history
* fixed Warning: count(): Parameter must be an array or an object that implements Countable
  • Loading branch information
ondrakub authored and dg committed Feb 5, 2018
1 parent acd0fce commit c9b1963
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Database/Table/GroupedSelection.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ protected function execute()
foreach ((array) $this->rows as $key => $row) {
$ref = &$data[$row[$this->column]];
$skip = &$offset[$row[$this->column]];
if ($limit === null || $rows <= 1 || (count($ref) < $limit && $skip >= $this->sqlBuilder->getOffset())) {
if ($limit === null || $rows <= 1 || (count($ref ?: []) < $limit && $skip >= $this->sqlBuilder->getOffset())) {
$ref[$key] = $row;
} else {
unset($this->rows[$key]);
Expand Down

0 comments on commit c9b1963

Please sign in to comment.