Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Commit 6daad2e

Browse files
authored
Merge pull request #382 from Geziwen/bugfix-php74-array-offset-notice
Silence notice thrown by php74 on array offset access of non-array types
2 parents 9ef326c + 8d563ea commit 6daad2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ElasticEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public function map(Builder $builder, $results, $model)
348348
*/
349349
public function getTotalCount($results)
350350
{
351-
return $results['hits']['total']['value'];
351+
return $results['hits']['total']['value'] ?? 0;
352352
}
353353

354354
/**

0 commit comments

Comments
 (0)