ruflin / Elastica

Elastica is a PHP client for elasticsearch
http://elastica.io/
MIT License
2.26k stars 737 forks source link

Elastica\Aggregation\DateHistogram expects int as interval #1504

Closed Vorta closed 5 years ago

Vorta commented 6 years ago

From Elastica\Aggregation\Histogram which DateHistogram extends

    /**
     * @param string $name     the name of this aggregation
     * @param string $field    the name of the field on which to perform the aggregation
     * @param int    $interval the interval by which documents will be bucketed
     */
    public function __construct($name, $field, $interval)
    {
        parent::__construct($name);
        $this->setField($field);
        $this->setInterval($interval);
    }

@param for $interval should be string for DateHistogram, not int.

Suggestion: Change to @param int|string $interval

ruflin commented 6 years ago

If I understand this correctly, it's mainly a documentation issue? Do you want to open a PR with the change?

ruflin commented 5 years ago

Resolved in https://github.com/ruflin/Elastica/pull/1534