1<?php
2
3namespace 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 */
10class 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