Completed
Push — master ( 97fc71...726d4b )
by WEBEWEB
01:08
created

CommunesResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 47
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A addCommune() 0 4 1
A getCommunes() 0 3 1
A setCommunes() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the geo-api-library package.
5
 *
6
 * (c) 2020 WEBEWEB
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
namespace WBW\Library\GeoAPI\Response;
13
14
use WBW\Library\GeoAPI\Model\Commune;
15
16
/**
17
 * Communes response.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Library\GeoAPI\Response
21
 */
22
class CommunesResponse extends AbstractResponse {
23
24
    /**
25
     * Communes.
26
     *
27
     * @var Commune[]
28
     */
29
    private $communes;
30
31
    /**
32
     * Constructor.
33
     */
34
    public function __construct() {
35
        $this->setCommunes([]);
36
    }
37
38
    /**
39
     * Add a commune.
40
     *
41
     * @param Commune $commune The commune.
42
     * @return CommunesResponse Returns this communes response.
43
     */
44
    public function addCommune(Commune $commune): CommunesResponse {
45
        $this->communes[] = $commune;
46
        return $this;
47
    }
48
49
    /**
50
     * Get the communes.
51
     *
52
     * @return Commune[] Returns the communes.
53
     */
54
    public function getCommunes(): array {
55
        return $this->communes;
56
    }
57
58
    /**
59
     * Set the communes.
60
     *
61
     * @param Commune[] $communes The communes.
62
     * @return CommunesResponse Returns this communes response.
63
     */
64
    protected function setCommunes(array $communes): CommunesResponse {
65
        $this->communes = $communes;
66
        return $this;
67
    }
68
}