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 — master ( 51d046...9a1850 )
by Eric
03:10
created

ControlManager   B

Complexity

Total Complexity 27

Size/Duplication

Total Lines 245
Duplicated Lines 0 %

Coupling/Cohesion

Components 7
Dependencies 0

Importance

Changes 4
Bugs 0 Features 2
Metric Value
wmc 27
c 4
b 0
f 2
lcom 7
cbo 0
dl 0
loc 245
rs 8.3333

25 Methods

Rating   Name   Duplication   Size   Complexity  
A hasFullscreenControl() 0 4 1
A getFullscreenControl() 0 4 1
A setFullscreenControl() 0 4 1
A hasMapTypeControl() 0 4 1
A getMapTypeControl() 0 4 1
A setMapTypeControl() 0 4 1
A hasRotateControl() 0 4 1
A getRotateControl() 0 4 1
A setRotateControl() 0 4 1
A hasScaleControl() 0 4 1
A getScaleControl() 0 4 1
A setScaleControl() 0 4 1
A hasStreetViewControl() 0 4 1
A getStreetViewControl() 0 4 1
A setStreetViewControl() 0 4 1
A hasZoomControl() 0 4 1
A getZoomControl() 0 4 1
A setZoomControl() 0 4 1
A hasCustomControls() 0 4 1
A getCustomControls() 0 4 1
A setCustomControls() 0 5 1
A addCustomControls() 0 6 2
A hasCustomControl() 0 4 1
A addCustomControl() 0 6 2
A removeCustomControl() 0 5 1
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\Control;
13
14
/**
15
 * @author GeLo <[email protected]>
16
 */
17
class ControlManager
18
{
19
    /**
20
     * @var FullscreenControl|null
21
     */
22
    private $fullscreenControl;
23
24
    /**
25
     * @var MapTypeControl|null
26
     */
27
    private $mapTypeControl;
28
29
    /**
30
     * @var RotateControl|null
31
     */
32
    private $rotateControl;
33
34
    /**
35
     * @var ScaleControl|null
36
     */
37
    private $scaleControl;
38
39
    /**
40
     * @var StreetViewControl|null
41
     */
42
    private $streetViewControl;
43
44
    /**
45
     * @var ZoomControl|null
46
     */
47
    private $zoomControl;
48
49
    /**
50
     * @var CustomControl[]
51
     */
52
    private $customControls = [];
53
54
    /**
55
     * @return bool
56
     */
57
    public function hasFullscreenControl()
58
    {
59
        return $this->fullscreenControl !== null;
60
    }
61
62
    /**
63
     * @return FullscreenControl|null
64
     */
65
    public function getFullscreenControl()
66
    {
67
        return $this->fullscreenControl;
68
    }
69
70
    /**
71
     * @param FullscreenControl|null $fullscreenControl
72
     */
73
    public function setFullscreenControl(FullscreenControl $fullscreenControl = null)
74
    {
75
        $this->fullscreenControl = $fullscreenControl;
76
    }
77
78
    /**
79
     * @return bool
80
     */
81
    public function hasMapTypeControl()
82
    {
83
        return $this->mapTypeControl !== null;
84
    }
85
86
    /**
87
     * @return MapTypeControl|null
88
     */
89
    public function getMapTypeControl()
90
    {
91
        return $this->mapTypeControl;
92
    }
93
94
    /**
95
     * @param MapTypeControl|null $mapTypeControl
96
     */
97
    public function setMapTypeControl(MapTypeControl $mapTypeControl = null)
98
    {
99
        $this->mapTypeControl = $mapTypeControl;
100
    }
101
102
    /**
103
     * @return bool
104
     */
105
    public function hasRotateControl()
106
    {
107
        return $this->rotateControl !== null;
108
    }
109
110
    /**
111
     * @return RotateControl|null
112
     */
113
    public function getRotateControl()
114
    {
115
        return $this->rotateControl;
116
    }
117
118
    /**
119
     * @param RotateControl|null $rotateControl
120
     */
121
    public function setRotateControl(RotateControl $rotateControl = null)
122
    {
123
        $this->rotateControl = $rotateControl;
124
    }
125
126
    /**
127
     * @return bool
128
     */
129
    public function hasScaleControl()
130
    {
131
        return $this->scaleControl !== null;
132
    }
133
134
    /**
135
     * @return ScaleControl|null
136
     */
137
    public function getScaleControl()
138
    {
139
        return $this->scaleControl;
140
    }
141
142
    /**
143
     * @param ScaleControl|null $scaleControl
144
     */
145
    public function setScaleControl(ScaleControl $scaleControl = null)
146
    {
147
        $this->scaleControl = $scaleControl;
148
    }
149
150
    /**
151
     * @return bool
152
     */
153
    public function hasStreetViewControl()
154
    {
155
        return $this->streetViewControl !== null;
156
    }
157
158
    /**
159
     * @return StreetViewControl|null
160
     */
161
    public function getStreetViewControl()
162
    {
163
        return $this->streetViewControl;
164
    }
165
166
    /**
167
     * @param StreetViewControl|null $streetViewControl
168
     */
169
    public function setStreetViewControl(StreetViewControl $streetViewControl = null)
170
    {
171
        $this->streetViewControl = $streetViewControl;
172
    }
173
174
    /**
175
     * @return bool
176
     */
177
    public function hasZoomControl()
178
    {
179
        return $this->zoomControl !== null;
180
    }
181
182
    /**
183
     * @return ZoomControl|null
184
     */
185
    public function getZoomControl()
186
    {
187
        return $this->zoomControl;
188
    }
189
190
    /**
191
     * @param ZoomControl|null $zoomControl
192
     */
193
    public function setZoomControl(ZoomControl $zoomControl = null)
194
    {
195
        $this->zoomControl = $zoomControl;
196
    }
197
198
    /**
199
     * @return bool
200
     */
201
    public function hasCustomControls()
202
    {
203
        return !empty($this->customControls);
204
    }
205
206
    /**
207
     * @return CustomControl[]
208
     */
209
    public function getCustomControls()
210
    {
211
        return $this->customControls;
212
    }
213
214
    /**
215
     * @param CustomControl[] $customControls
216
     */
217
    public function setCustomControls(array $customControls)
218
    {
219
        $this->customControls = [];
220
        $this->addCustomControls($customControls);
221
    }
222
223
    /**
224
     * @param CustomControl[] $customControls
225
     */
226
    public function addCustomControls(array $customControls)
227
    {
228
        foreach ($customControls as $customControl) {
229
            $this->addCustomControl($customControl);
230
        }
231
    }
232
233
    /**
234
     * @param CustomControl $customControl
235
     *
236
     * @return bool
237
     */
238
    public function hasCustomControl(CustomControl $customControl)
239
    {
240
        return in_array($customControl, $this->customControls, true);
241
    }
242
243
    /**
244
     * @param CustomControl $customControl
245
     */
246
    public function addCustomControl(CustomControl $customControl)
247
    {
248
        if (!$this->hasCustomControl($customControl)) {
249
            $this->customControls[] = $customControl;
250
        }
251
    }
252
253
    /**
254
     * @param CustomControl $customControl
255
     */
256
    public function removeCustomControl(CustomControl $customControl)
257
    {
258
        unset($this->customControls[array_search($customControl, $this->customControls, true)]);
259
        $this->customControls = array_values($this->customControls);
260
    }
261
}
262