Completed
Push — master ( be5d10...3892c2 )
by Sergey
07:31
created

TermsAggregation::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1.0046

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 6
cp 0.8333
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
crap 1.0046
1
<?php
2
3
namespace Isswp101\Persimmon\QueryBuilder\Aggregations;
4
5
class TermsAggregation extends Aggregation
6
{
7
    protected $field;
8
    protected $size = 0;
9
10 1
    public function __construct($field, $size = 0)
11
    {
12 1
        parent::__construct($field);
13 1
        $this->field = $field;
14 1
        $this->size = $size;
15 1
    }
16
17 1
    public function make()
18
    {
19
        return [
20
            'terms' => [
21 1
                'field' => $this->field,
22 1
                'size' => $this->size
23 1
            ]
24 1
        ];
25
    }
26
}
27