Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Commit

Permalink
Removed count function. Fixes #80 (#84)
Browse files Browse the repository at this point in the history
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)`
  • Loading branch information
clsource authored and ErickTamayo committed Oct 24, 2017
1 parent 12c8d2f commit 97deb01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ElasticsearchEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 97deb01

Please sign in to comment.