public function range($key, $operator, $value, $bool, $filter, array $params = []) {
        if (is_array($operator) && !is_array($value) || !is_array($operator) && is_array($value) || is_array($operator) && count($operator) !== count($value)) {
            throw new \BadMethodCallException("Operator and value parameters should be both a scalar type or both an array with same number of elements");
        }
        if (is_array($key)) {
            return $this->multiRange($key, $operator, $value, $bool, $filter, $params);
        }
        $query = [];
        $operators = (array) $operator;
        $values = (array) $value;
        foreach ($operators as $index => $operator) {
            $query[$operator] = $values[$index];
        }
        $this->addBool(["range" => [$key => $query]], $bool, $filter, $params);
        return $this;
    }
public function range($key, $operator, $value, $bool, $filter, array $params = []) {
        if (is_array($operator) && !is_array($value) || !is_array($operator) && is_array($value) || is_array($operator) && count($operator) !== count($value)) {
            throw new \BadMethodCallException("Operator and value parameters should be both a scalar type or both an array with same number of elements");
        }
        if (is_array($key)) {
            return $this->multiRange($key, $operator, $value, $bool, $filter, $params);
        }
        $query = [];
        $operators = (array) $operator;
        $values = (array) $value;
        foreach ($operators as $index => $operator) {
            $query[$operator] = $values[$index];
        }
        $this->addBool(["range" => [$key => $query]], $bool, $filter, $params);
        return $this;
    }
public function range ( $ key , $ operator , $ value , $ bool , $ filter , array $ params = [ ] ) { if ( is_array ( $ operator ) && ! is_array ( $ value ) || ! is_array ( $ operator ) && is_array ( $ value ) || is_array ( $ operator ) && count ( $ operator ) !== count ( $ value ) ) { throw new \ BadMethodCallException ( "Operator and value parameters should be both a scalar type or both an array with same number of elements" ) ; } if ( is_array ( $ key ) ) { return $ this -> multiRange ( $ key , $ operator , $ value , $ bool , $ filter , $ params ) ; } $ query = [ ] ; $ operators = ( array ) $ operator ; $ values = ( array ) $ value ; foreach ( $ operators as $ index => $ operator ) { $ query [ $ operator ] = $ values [ $ index ] ; } $ this -> addBool ( [ "range" => [ $ key => $ query ] ] , $ bool , $ filter , $ params ) ; return $ this ; }
Creates a range query

@param string $key The key to create the range query for
@param string|string[] $operator lt, gt, lte, gte. Can be an array of mixed lt,gt,lte,gte; and if so, it should match the number of elements in the $value array too.
@param scalar|scalar[] $value the value for the range comparison. Should be an array of same element count if the $operator is also an array.
@param string $bool must, should, or must_not
@param boolean $filter to use the filter part instead of the query part
@param array $params additional query parameters for the range query
@return QueryBuilder|static|self
@throws \BadMethodCallException
Creates a range query