Aggs::getAggregations()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
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 41
    protected function addAggregation(AbstractAggregation $agg)
21
    {
22 41
        $this->aggregations[] = $agg;
23 41
    }
24
    
25
    /**
26
     * Get aggregations
27
     *
28
     * @return array
29
     */
30 41
    public function getAggregations() : array
31
    {
32 41
        return $this->aggregations;
33
    }
34
}
35