Completed
Push — master ( 962ce5...5ad7ea )
by Ema
02:34
created

ExtendedStatsBucket::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Elastica\Aggregation;
4
5
/**
6
 * Implements a Extended Stats Bucket Aggregation.
7
 *
8
 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-extended-stats-bucket-aggregation.html
9
 */
10
class ExtendedStatsBucket extends AbstractAggregation
11
{
12
    public function __construct(string $name, string $bucketsPath)
13
    {
14
        parent::__construct($name);
15
        $this->setBucketsPath($bucketsPath);
16
    }
17
18
    public function setBucketsPath(string $bucketsPath): self
19
    {
20
        return $this->setParam('buckets_path', $bucketsPath);
21
    }
22
23
    public function setGapPolicy(string $gapPolicy): self
24
    {
25
        return $this->setParam('gap_policy', $gapPolicy);
26
    }
27
28
    public function setFormat(string $format): self
29
    {
30
        return $this->setParam('format', $format);
31
    }
32
33
    public function setSigma(int $sigma): self
34
    {
35
        return $this->setParam('sigma', $sigma);
36
    }
37
}
38