Completed
Push — master ( 4d44a5...1590a9 )
by Sergey
12:05
created

TermsAggregation::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
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
    public function __construct($field, $size = 0)
11
    {
12
        parent::__construct($field);
13
        $this->field = $field;
14
        $this->size = $size;
15
    }
16
17
    public function make()
18
    {
19
        return [
20
            'terms' => [
21
                'field' => $this->field,
22
                'size' => $this->size
23
            ]
24
        ];
25
    }
26
}