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

DepartementsResponse   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 addDepartement() 0 4 1
A getDepartements() 0 3 1
A setDepartements() 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\Departement;
15
16
/**
17
 * Départements response.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Library\GeoAPI\Response
21
 */
22
class DepartementsResponse extends AbstractResponse {
23
24
    /**
25
     * Départements.
26
     *
27
     * @var Departement[]
28
     */
29
    private $departements;
30
31
    /**
32
     * Constructor.
33
     */
34
    public function __construct() {
35
        $this->setDepartements([]);
36
    }
37
38
    /**
39
     * Add a département.
40
     *
41
     * @param Departement $departement The département.
42
     * @return DepartementsResponse Returns this départements response.
43
     */
44
    public function addDepartement(Departement $departement): DepartementsResponse {
45
        $this->departements[] = $departement;
46
        return $this;
47
    }
48
49
    /**
50
     * Get the départements.
51
     *
52
     * @return Departement[] Returns the départements.
53
     */
54
    public function getDepartements(): array {
55
        return $this->departements;
56
    }
57
58
    /**
59
     * Set the départements.
60
     *
61
     * @param Departement[] $departements The départements.
62
     * @return DepartementsResponse Returns this départements response.
63
     */
64
    protected function setDepartements(array $departements): DepartementsResponse {
65
        $this->departements = $departements;
66
        return $this;
67
    }
68
}