Skip to content

Commit 97deb01

Browse files
clsourceErickTamayo
authored andcommitted
Removed count function. Fixes ErickTamayo#80 (ErickTamayo#84)
Since php 7.2, count a number will generate a warning. Because $results['hits']['total'] is a number we can just compare it to zero. `if ($results['hits']['total'] === 0)`
1 parent 12c8d2f commit 97deb01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ElasticsearchEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public function mapIds($results)
210210
*/
211211
public function map($results, $model)
212212
{
213-
if (count($results['hits']['total']) === 0) {
213+
if ($results['hits']['total'] === 0) {
214214
return Collection::make();
215215
}
216216

0 commit comments

Comments
 (0)