GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — map-manager-relation ( ddc93b )
by Eric
02:26
created

LayerManager::getMap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Ivory Google Map package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\GoogleMap\Layer;
13
14
/**
15
 * @author GeLo <[email protected]>
16
 */
17
class LayerManager
18
{
19
    /**
20
     * @var KmlLayer[]
21
     */
22
    private $kmlLayers = [];
23
24
    /**
25
     * @return bool
26
     */
27
    public function hasKmlLayers()
28
    {
29
        return !empty($this->kmlLayers);
30
    }
31
32
    /**
33
     * @return KmlLayer[]
34
     */
35
    public function getKmlLayers()
36
    {
37
        return $this->kmlLayers;
38
    }
39
40
    /**
41
     * @param KmlLayer[] $kmlLayers
42
     */
43
    public function setKmlLayers(array $kmlLayers)
44
    {
45
        $this->kmlLayers = [];
46
        $this->addKmlLayers($kmlLayers);
47
    }
48
49
    /**
50
     * @param KmlLayer[] $kmlLayers
51
     */
52
    public function addKmlLayers(array $kmlLayers)
53
    {
54
        foreach ($kmlLayers as $kmlLayer) {
55
            $this->addKmlLayer($kmlLayer);
56
        }
57
    }
58
59
    /**
60
     * @param KmlLayer $kmlLayer
61
     *
62
     * @return bool
63
     */
64
    public function hasKmlLayer(KmlLayer $kmlLayer)
65
    {
66
        return in_array($kmlLayer, $this->kmlLayers, true);
67
    }
68
69
    /**
70
     * @param KmlLayer $kmlLayer
71
     */
72
    public function addKmlLayer(KmlLayer $kmlLayer)
73
    {
74
        if (!$this->hasKmlLayer($kmlLayer)) {
75
            $this->kmlLayers[] = $kmlLayer;
76
        }
77
    }
78
79
    /**
80
     * @param KmlLayer $kmlLayer
81
     */
82
    public function removeKmlLayer(KmlLayer $kmlLayer)
83
    {
84
        unset($this->kmlLayers[array_search($kmlLayer, $this->kmlLayers, true)]);
85
    }
86
}
87