Completed
Push — master ( 5e9615...0f6ac6 )
by WEBEWEB
02:26
created

ListeRegionsResponse   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
c 0
b 0
f 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A addRegion() 0 4 1
A getRegions() 0 3 1
A setRegions() 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\Model\Response\Region;
13
14
use WBW\Library\GeoAPI\Model\AbstractResponse;
15
use WBW\Library\GeoAPI\Model\Region;
16
17
/**
18
 * Liste régions response.
19
 *
20
 * @author webeweb <https://github.com/webeweb/>
21
 * @package WBW\Library\GeoAPI\Model\Response\Region
22
 */
23
class ListeRegionsResponse extends AbstractResponse {
24
25
    /**
26
     * Régions.
27
     *
28
     * @var Region[]
29
     */
30
    private $regions;
31
32
    /**
33
     * Constructor.
34
     */
35
    public function __construct() {
36
        $this->setRegions([]);
37
    }
38
39
    /**
40
     * Add a région.
41
     *
42
     * @param Region $region The région.
43
     * @return ListeRegionsResponse Returns this liste région response.
44
     */
45
    public function addRegion(Region $region) {
46
        $this->regions[] = $region;
47
        return $this;
48
    }
49
50
    /**
51
     * Get the régions.
52
     *
53
     * @return Region[] Returns the régions.
54
     */
55
    public function getRegions() {
56
        return $this->regions;
57
    }
58
59
    /**
60
     * Set the régions.
61
     *
62
     * @param Region[] $regions The régions.
63
     * @return ListeRegionsResponse Returns this liste régions response.
64
     */
65
    protected function setRegions(array $regions) {
66
        $this->regions = $regions;
67
        return $this;
68
    }
69
}