Skip to content

Commit 1743354

Browse files
Merge pull request #46 from Betalabs/pr
Fix for a PHP 7.2 compatibility issue which was caused by a behaviour change in count()
2 parents 05d85f2 + 619335c commit 1743354

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,4 @@ The envelope has the following structure:
272272

273273
]
274274
}
275-
```
275+
```

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
}
2727
},
2828
"minimum-stability": "stable"
29-
}
29+
}

src/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ protected function parseFields($fieldsParam)
328328
protected function parseWith($withParam)
329329
{
330330
$fields = $this->query->columns;
331-
$fieldsCount = count($fields);
331+
$fieldsCount = count($fields ?: []);
332332
$baseModel = $this->builder->getModel();
333333

334334
$withHistory = [];
@@ -449,7 +449,7 @@ protected function parseWith($withParam)
449449
$this->builder->with($withsArr);
450450

451451
//Merge the base fields
452-
if (count($fields) > 0) {
452+
if (count($fields ?: []) > 0) {
453453
if (!is_array($this->query->columns)) {
454454
$this->query->columns = [];
455455
}

0 commit comments

Comments
 (0)