Passed
Pull Request — master (#1)
by Christopher
05:53
created

Aggs::getAggregations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Triadev\Es\Dsl\Dsl\Aggregation;
3
4
use ONGR\ElasticsearchDSL\Aggregation\AbstractAggregation;
5
6
abstract class Aggs
7
{
8
    /**
9
     * Aggregations
10
     *
11
     * @var array
12
     */
13
    private $aggregations = [];
14
    
15
    /**
16
     * Add aggregation
17
     *
18
     * @param AbstractAggregation $agg
19
     */
20
    protected function addAggregation(AbstractAggregation $agg)
21
    {
22
        $this->aggregations[] = $agg;
23
    }
24
    
25
    /**
26
     * Get aggregations
27
     *
28
     * @return array
29
     */
30
    public function getAggregations() : array
31
    {
32
        return $this->aggregations;
33
    }
34
}
35