From 97deb01452f947b3c515545c2ee65804f1a59853 Mon Sep 17 00:00:00 2001 From: Camilo Castro Date: Tue, 24 Oct 2017 12:43:54 -0300 Subject: [PATCH] Removed count function. Fixes #80 (#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)` --- src/ElasticsearchEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ElasticsearchEngine.php b/src/ElasticsearchEngine.php index ef6f2c0..61c86de 100644 --- a/src/ElasticsearchEngine.php +++ b/src/ElasticsearchEngine.php @@ -210,7 +210,7 @@ public function mapIds($results) */ public function map($results, $model) { - if (count($results['hits']['total']) === 0) { + if ($results['hits']['total'] === 0) { return Collection::make(); }