Completed
Pull Request — master (#348)
by
unknown
10:14
created

GlobalAggregation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 28
c 0
b 0
f 0
rs 10
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace ONGR\ElasticsearchDSL\Aggregation\Bucketing;
15
16
use ONGR\ElasticsearchDSL\Aggregation\AbstractAggregation;
17
use ONGR\ElasticsearchDSL\Aggregation\Type\BucketingTrait;
18
use stdClass;
19
20
/**
21
 * Class representing GlobalAggregation.
22
 *
23
 * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-global-aggregation.html
24
 */
25
class GlobalAggregation extends AbstractAggregation
26
{
27
    use BucketingTrait;
28
29
    public function setField(?string $field): static
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STATIC
Loading history...
30
    {
31
        throw new \LogicException("Global aggregation, doesn't support `field` parameter");
32
    }
33
34
    public function getType(): string
35
    {
36
        return 'global';
37
    }
38
39
    public function getArray(): stdClass
40
    {
41
        return new stdClass();
42
    }
43
}
44