Completed
Push — master ( 0f6ac6...c701d2 )
by WEBEWEB
01:05
created

CommunesResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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\Model\Response;
13
14
use WBW\Library\GeoAPI\Model\AbstractResponse;
15
use WBW\Library\GeoAPI\Model\Commune;
16
17
/**
18
 * Communes response.
19
 *
20
 * @author webeweb <https://github.com/webeweb/>
21
 * @package WBW\Library\GeoAPI\Model\Response
22
 */
23
class CommunesResponse extends AbstractResponse {
24
25
    /**
26
     * Communes.
27
     *
28
     * @var Commune[]
29
     */
30
    private $communes;
31
32
    /**
33
     * Constructor.
34
     */
35
    public function __construct() {
36
        $this->setCommunes([]);
37
    }
38
39
    /**
40
     * Add a commune.
41
     *
42
     * @param Commune $commune The commune.
43
     * @return CommunesResponse Returns this communes response.
44
     */
45
    public function addCommune(Commune $commune) {
46
        $this->communes[] = $commune;
47
        return $this;
48
    }
49
50
    /**
51
     * Get the communes.
52
     *
53
     * @return Commune[] Returns the communes.
54
     */
55
    public function getCommunes() {
56
        return $this->communes;
57
    }
58
59
    /**
60
     * Set the communes.
61
     *
62
     * @param Commune[] $communes The communes.
63
     * @return CommunesResponse Returns this communes response.
64
     */
65
    protected function setCommunes(array $communes) {
66
        $this->communes = $communes;
67
        return $this;
68
    }
69
}