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

ExtendedStatsBucket   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 28
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setBucketsPath() 0 4 1
A setGapPolicy() 0 4 1
A setFormat() 0 4 1
A setSigma() 0 4 1
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