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 ( f79bcb...de7e43 )
by Eric
80:29 queued 77:22
created

Marker   A

Complexity

Total Complexity 22

Size/Duplication

Total Lines 207
Duplicated Lines 0 %

Coupling/Cohesion

Components 4
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 22
lcom 4
cbo 2
dl 0
loc 207
ccs 57
cts 57
cp 1
rs 10
c 0
b 0
f 0

18 Methods

Rating   Name   Duplication   Size   Complexity  
A getSymbol() 0 4 1
A __construct() 0 19 3
A getPosition() 0 4 1
A setPosition() 0 4 1
A hasAnimation() 0 4 1
A getAnimation() 0 4 1
A setAnimation() 0 4 1
A hasIcon() 0 4 1
A getIcon() 0 4 1
A setIcon() 0 8 2
A hasSymbol() 0 4 1
A setSymbol() 0 8 2
A hasShape() 0 4 1
A getShape() 0 4 1
A setShape() 0 4 1
A hasInfoWindow() 0 4 1
A getInfoWindow() 0 4 1
A setInfoWindow() 0 4 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\Overlay;
13
14
use Ivory\GoogleMap\Base\Coordinate;
15
use Ivory\GoogleMap\Utility\OptionsAwareInterface;
16
use Ivory\GoogleMap\Utility\OptionsAwareTrait;
17
use Ivory\GoogleMap\Utility\VariableAwareTrait;
18
19
/**
20
 * @see http://code.google.com/apis/maps/documentation/javascript/reference.html#Marker
21
 *
22
 * @author GeLo <[email protected]>
23
 */
24
class Marker implements ExtendableInterface, OptionsAwareInterface
25
{
26
    use OptionsAwareTrait;
27
    use VariableAwareTrait;
28
29
    /**
30
     * @var Coordinate
31
     */
32
    private $position;
33
34
    /**
35
     * @var string|null
36
     */
37
    private $animation;
38
39
    /**
40
     * @var Icon|null
41
     */
42
    private $icon;
43
44
    /**
45
     * @var Symbol|null
46
     */
47
    private $symbol;
48
49
    /**
50
     * @var MarkerShape|null
51
     */
52
    private $shape;
53
54
    /**
55
     * @var InfoWindow|null
56
     */
57
    private $infoWindow;
58
59
    /**
60
     * @param Coordinate       $position
61
     * @param string|null      $animation
62
     * @param Icon|null        $icon
63
     * @param MarkerShape|null $shape
64
     * @param Symbol|null      $symbol
65
     * @param mixed[]          $options
66
     */
67 160
    public function __construct(
68
        Coordinate $position,
69
        $animation = null,
70
        Icon $icon = null,
71
        Symbol $symbol = null,
72
        MarkerShape $shape = null,
73
        array $options = []
74
    ) {
75 160
        $this->setPosition($position);
76 160
        $this->setAnimation($animation);
77 160
        $this->setShape($shape);
78 160
        $this->addOptions($options);
79
80 160
        if ($icon !== null) {
81 8
            $this->setIcon($icon);
82 158
        } elseif ($symbol !== null) {
83 8
            $this->setSymbol($symbol);
84 4
        }
85 160
    }
86
87
    /**
88
     * @return Coordinate
89
     */
90 80
    public function getPosition()
91
    {
92 80
        return $this->position;
93
    }
94
95
    /**
96
     * @param Coordinate $position
97
     */
98 160
    public function setPosition(Coordinate $position)
99
    {
100 160
        $this->position = $position;
101 160
    }
102
103
    /**
104
     * @return bool
105
     */
106 80
    public function hasAnimation()
107
    {
108 80
        return $this->animation !== null;
109
    }
110
111
    /**
112
     * @return string|null
113
     */
114 32
    public function getAnimation()
115
    {
116 32
        return $this->animation;
117
    }
118
119
    /**
120
     * @param string|null $animation
121
     */
122 160
    public function setAnimation($animation = null)
123
    {
124 160
        $this->animation = $animation;
125 160
    }
126
127
    /**
128
     * @return bool
129
     */
130 100
    public function hasIcon()
131
    {
132 100
        return $this->icon !== null;
133
    }
134
135
    /**
136
     * @return Icon|null
137
     */
138 52
    public function getIcon()
139
    {
140 52
        return $this->icon;
141
    }
142
143
    /**
144
     * @param Icon|null $icon
145
     */
146 68
    public function setIcon(Icon $icon = null)
147
    {
148 68
        $this->icon = $icon;
149
150 68
        if ($icon !== null) {
151 44
            $this->setSymbol(null);
152 22
        }
153 68
    }
154
155
    /**
156
     * @return bool
157
     */
158 84
    public function hasSymbol()
159
    {
160 84
        return $this->symbol !== null;
161
    }
162
163
    /**
164
     * @return Symbol|null
165
     */
166 36
    public function getSymbol()
167
    {
168 36
        return $this->symbol;
169
    }
170
171
    /**
172
     * @param Symbol|null $symbol
173
     */
174 68
    public function setSymbol(Symbol $symbol = null)
175
    {
176 68
        $this->symbol = $symbol;
177
178 68
        if ($symbol !== null) {
179 32
            $this->setIcon(null);
180 16
        }
181 68
    }
182
183
    /**
184
     * @return bool
185
     */
186 84
    public function hasShape()
187
    {
188 84
        return $this->shape !== null;
189
    }
190
191
    /**
192
     * @return MarkerShape|null
193
     */
194 36
    public function getShape()
195
    {
196 36
        return $this->shape;
197
    }
198
199
    /**
200
     * @param MarkerShape|null $shape
201
     */
202 160
    public function setShape(MarkerShape $shape = null)
203
    {
204 160
        $this->shape = $shape;
205 160
    }
206
207
    /**
208
     * @return bool
209
     */
210 100
    public function hasInfoWindow()
211
    {
212 100
        return $this->infoWindow !== null;
213
    }
214
215
    /**
216
     * @return InfoWindow|null
217
     */
218 60
    public function getInfoWindow()
219
    {
220 60
        return $this->infoWindow;
221
    }
222
223
    /**
224
     * @param InfoWindow|null $infoWindow
225
     */
226 24
    public function setInfoWindow(InfoWindow $infoWindow = null)
227
    {
228 24
        $this->infoWindow = $infoWindow;
229 24
    }
230
}
231