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

TermsAggregation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 22
ccs 10
cts 15
cp 0.6667
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A make() 0 9 1
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