Completed
Push — master ( 0e81d4...c51b03 )
by Nicolas
05:56 queued 02:39
created

GeoBounds   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setField() 0 4 1
1
<?php
2
namespace Elastica\Aggregation;
3
4
/**
5
 * Class GeoBounds.
6
 *
7
 * @link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-geobounds-aggregation.html
8
 */
9
class GeoBounds extends AbstractAggregation
10
{
11
    /**
12
     * @param string $name  the name of this aggregation
13
     * @param string $field the field on which to perform this aggregation
14
     */
15
    public function __construct($name, $field)
16
    {
17
        parent::__construct($name);
18
        $this->setField($field);
19
    }
20
21
    /**
22
     * Set the field for this aggregation.
23
     *
24
     * @param string $field the name of the document field on which to perform this aggregation
25
     *
26
     * @return $this
27
     */
28
    public function setField($field)
29
    {
30
        return $this->setParam('field', $field);
31
    }
32
}
33