Completed
Pull Request — develop (#45)
by Hugo
07:07 queued 25s
created

TermsAggregation::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php namespace Nord\Lumen\Elasticsearch\Search\Aggregation\Bucket;
2
3
use Nord\Lumen\Elasticsearch\Search\Traits\HasField;
4
5
/**
6
 * A multi-bucket value source based aggregation where buckets are dynamically built - one per unique value.
7
 *
8
 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html
9
 */
10
class TermsAggregation extends AbstractAggregation
11
{
12
    use HasField;
13
14
    public function toArray()
15
    {
16
        return [
17
            'terms' => [
18
                'field' => $this->getField()
19
            ]
20
        ];
21
    }
22
}
23