Completed
Push — master ( ef7b9e...c9d01b )
by
unknown
02:39
created

GlobalAggregation::_getBaseName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Elastica\Aggregation;
4
5
/**
6
 * Class GlobalAggregation.
7
 *
8
 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-global-aggregation.html
9
 */
10
class GlobalAggregation extends AbstractAggregation
11
{
12
    public function toArray(): array
13
    {
14
        $array = parent::toArray();
15
        // Force json encoding to object
16
        $array[$this->_getBaseName()] = new \ArrayObject();
17
18
        return $array;
19
    }
20
}
21