PercentilesBucketAggregation   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 4 1
A getPercents() 0 4 1
A setPercents() 0 6 1
A getArray() 0 10 2
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ONGR\ElasticsearchDSL\Aggregation\Pipeline;
13
14
/**
15
 * Class representing Percentiles Bucket Pipeline Aggregation.
16
 *
17
 * @link https://goo.gl/bqi7m5
18
 */
19
class PercentilesBucketAggregation extends AbstractPipelineAggregation
20
{
21
    /**
22
     * @var array
23
     */
24
    private $percents;
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function getType()
30
    {
31
        return 'percentiles_bucket';
32
    }
33
34
    /**
35
     * @return array
36
     */
37
    public function getPercents()
38
    {
39
        return $this->percents;
40
    }
41
42
    /**
43
     * @param array $percents
44
     *
45
     * @return $this
46
     */
47
    public function setPercents(array $percents)
48
    {
49
        $this->percents = $percents;
50
51
        return $this;
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function getArray()
58
    {
59
        $data = ['buckets_path' => $this->getBucketsPath()];
60
61
        if ($this->getPercents()) {
62
            $data['percents'] = $this->getPercents();
63
        }
64
65
        return $data;
66
    }
67
}
68