Skip to content
Snippets Groups Projects
Commit b566808b authored by David Higgins's avatar David Higgins Committed by Simonas Šerlinskas
Browse files

fixes #255 - added null check to array_filter to allow `0` values to pass through (#258)

Example `['from' => 0, 'to' => 0]` is a valid aggregate range
parent 83c47322
No related branches found
No related tags found
No related merge requests found
...@@ -86,7 +86,10 @@ class DateRangeAggregation extends AbstractAggregation ...@@ -86,7 +86,10 @@ class DateRangeAggregation extends AbstractAggregation
'from' => $from, 'from' => $from,
'to' => $to, 'to' => $to,
'key' => $key, 'key' => $key,
] ],
function ($v) {
return !is_null($v);
}
); );
if (empty($range)) { if (empty($range)) {
......
...@@ -132,7 +132,10 @@ class GeoDistanceAggregation extends AbstractAggregation ...@@ -132,7 +132,10 @@ class GeoDistanceAggregation extends AbstractAggregation
[ [
'from' => $from, 'from' => $from,
'to' => $to, 'to' => $to,
] ],
function ($v) {
return !is_null($v);
}
); );
if (empty($range)) { if (empty($range)) {
......
...@@ -65,7 +65,10 @@ class Ipv4RangeAggregation extends AbstractAggregation ...@@ -65,7 +65,10 @@ class Ipv4RangeAggregation extends AbstractAggregation
[ [
'from' => $from, 'from' => $from,
'to' => $to, 'to' => $to,
] ],
function ($v) {
return !is_null($v);
}
); );
$this->ranges[] = $range; $this->ranges[] = $range;
......
...@@ -84,7 +84,10 @@ class RangeAggregation extends AbstractAggregation ...@@ -84,7 +84,10 @@ class RangeAggregation extends AbstractAggregation
[ [
'from' => $from, 'from' => $from,
'to' => $to, 'to' => $to,
] ],
function ($v) {
return !is_null($v);
}
); );
if ($this->keyed && !empty($key)) { if ($this->keyed && !empty($key)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment