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

TermsAggregation::make()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1.0876

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 5
cts 9
cp 0.5556
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
crap 1.0876
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