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

TermsAggregation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 22
rs 10

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
    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
}