Skip to content

Commit

Permalink
Merge pull request #46 from Betalabs/pr
Browse files Browse the repository at this point in the history
Fix for a PHP 7.2 compatibility issue which was caused by a behaviour change in count()
  • Loading branch information
marcelgwerder authored Dec 2, 2017
2 parents 05d85f2 + 619335c commit 1743354
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,4 @@ The envelope has the following structure:

]
}
```
```
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
}
},
"minimum-stability": "stable"
}
}
4 changes: 2 additions & 2 deletions src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ protected function parseFields($fieldsParam)
protected function parseWith($withParam)
{
$fields = $this->query->columns;
$fieldsCount = count($fields);
$fieldsCount = count($fields ?: []);
$baseModel = $this->builder->getModel();

$withHistory = [];
Expand Down Expand Up @@ -449,7 +449,7 @@ protected function parseWith($withParam)
$this->builder->with($withsArr);

//Merge the base fields
if (count($fields) > 0) {
if (count($fields ?: []) > 0) {
if (!is_array($this->query->columns)) {
$this->query->columns = [];
}
Expand Down

0 comments on commit 1743354

Please sign in to comment.