From 8d563eae204a90fa0cc61bd829da5d4b8705070a Mon Sep 17 00:00:00 2001 From: GodfatherSean Date: Tue, 11 Aug 2020 01:21:41 -0700 Subject: [PATCH] Silence notice thrown by php74 on array offset access of non-array types --- src/ElasticEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ElasticEngine.php b/src/ElasticEngine.php index ca3d1a6..4cd2af2 100755 --- a/src/ElasticEngine.php +++ b/src/ElasticEngine.php @@ -348,7 +348,7 @@ public function map(Builder $builder, $results, $model) */ public function getTotalCount($results) { - return $results['hits']['total']['value']; + return $results['hits']['total']['value'] ?? 0; } /**