@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | */ |
298 | 298 | public function getDirection() |
299 | 299 | { |
300 | - return $this->direction; |
|
300 | + return $this->direction; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | |
@@ -433,17 +433,17 @@ discard block |
||
433 | 433 | } else |
434 | 434 | { |
435 | 435 | $map = array( |
436 | - 'position' => $this->coordinates, |
|
437 | - 'height' => $this->height, |
|
438 | - 'width' => $this->width, |
|
439 | - 'zoom' => $this->zoom, |
|
440 | - 'type' => $this->type, |
|
441 | - 'scrollable' => $this->scrollable, |
|
442 | - 'key' => $this->key, |
|
443 | - 'bound' => $this->bound, |
|
444 | - 'cluster' => $this->markerClusterer, |
|
445 | - 'clusterOptions' => $this->clusterOptions, |
|
446 | - 'waypoint' => !is_null($this->waypoints) ? array_merge($this->waypoints, $this->direction) : NULL |
|
436 | + 'position' => $this->coordinates, |
|
437 | + 'height' => $this->height, |
|
438 | + 'width' => $this->width, |
|
439 | + 'zoom' => $this->zoom, |
|
440 | + 'type' => $this->type, |
|
441 | + 'scrollable' => $this->scrollable, |
|
442 | + 'key' => $this->key, |
|
443 | + 'bound' => $this->bound, |
|
444 | + 'cluster' => $this->markerClusterer, |
|
445 | + 'clusterOptions' => $this->clusterOptions, |
|
446 | + 'waypoint' => !is_null($this->waypoints) ? array_merge($this->waypoints, $this->direction) : NULL |
|
447 | 447 | ); |
448 | 448 | $this->template->map = Json::encode($map); |
449 | 449 | $this->template->setFile(dirname(__FILE__) . '/template.latte'); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function setCoordinates(array $coordinates) |
127 | 127 | { |
128 | - if(!count($coordinates)) |
|
128 | + if (!count($coordinates)) |
|
129 | 129 | { |
130 | 130 | $this->coordinates = array(NULL, NULL); |
131 | 131 | } else |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function setType($type) |
193 | 193 | { |
194 | - if($type !== self::HYBRID && $type !== self::ROADMAP && $type !== self::SATELLITE && |
|
194 | + if ($type !== self::HYBRID && $type !== self::ROADMAP && $type !== self::SATELLITE && |
|
195 | 195 | $type !== self::TERRAIN) |
196 | 196 | { |
197 | 197 | throw new InvalidArgumentException; |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | throw new InvalidArgumentException; |
215 | 215 | } |
216 | 216 | |
217 | - if($key === 'waypoint') |
|
217 | + if ($key === 'waypoint') |
|
218 | 218 | { |
219 | 219 | $this->waypoints['waypoints'][] = $waypoint; |
220 | 220 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | public function setDirection(array $direction) |
235 | 235 | { |
236 | 236 | $this->direction = $direction; |
237 | - if(!array_key_exists('travelmode', $this->direction)) |
|
237 | + if (!array_key_exists('travelmode', $this->direction)) |
|
238 | 238 | { |
239 | 239 | $this->direction['travelmode'] = 'DRIVING'; |
240 | 240 | } else if (!in_array($direction['travelmode'], [ |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | $this->template->position = $this->coordinates; |
430 | 430 | $this->template->markers = $this->markers; |
431 | 431 | $this->template->clickable = $this->clickable; |
432 | - $this->template->setFile(dirname(__FILE__) . '/static.latte'); |
|
432 | + $this->template->setFile(dirname(__FILE__).'/static.latte'); |
|
433 | 433 | } else |
434 | 434 | { |
435 | 435 | $map = array( |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | 'waypoint' => !is_null($this->waypoints) ? array_merge($this->waypoints, $this->direction) : NULL |
447 | 447 | ); |
448 | 448 | $this->template->map = Json::encode($map); |
449 | - $this->template->setFile(dirname(__FILE__) . '/template.latte'); |
|
449 | + $this->template->setFile(dirname(__FILE__).'/template.latte'); |
|
450 | 450 | } |
451 | 451 | $this->template->render(); |
452 | 452 | } |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Copyright (c) 2015 Petr Olišar (http://olisar.eu) |
|
4 | - * |
|
5 | - * For the full copyright and license information, please view |
|
6 | - * the file LICENSE.md that was distributed with this source code. |
|
7 | - */ |
|
3 | + * Copyright (c) 2015 Petr Olišar (http://olisar.eu) |
|
4 | + * |
|
5 | + * For the full copyright and license information, please view |
|
6 | + * the file LICENSE.md that was distributed with this source code. |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace Oli\GoogleAPI; |
10 | 10 |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function addMarkers(array $markers) |
56 | 56 | { |
57 | - if(count($markers)) |
|
57 | + if (count($markers)) |
|
58 | 58 | { |
59 | - foreach($markers as $marker) |
|
59 | + foreach ($markers as $marker) |
|
60 | 60 | { |
61 | 61 | $this->createMarker($marker); |
62 | 62 | } |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | { |
75 | 75 | if (!is_string($animation) && !is_bool($animation)) |
76 | 76 | { |
77 | - throw new InvalidArgumentException("Animation must be string or boolean, $animation (" . |
|
78 | - gettype($animation) . ") was given"); |
|
77 | + throw new InvalidArgumentException("Animation must be string or boolean, $animation (". |
|
78 | + gettype($animation).") was given"); |
|
79 | 79 | } |
80 | 80 | if (!is_string($title) && $title != null) |
81 | 81 | { |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | { |
128 | 128 | throw new LogicException("setMessage must be called after addMarker()"); |
129 | 129 | } |
130 | - end($this->markers); // move the internal pointer to the end of the array |
|
130 | + end($this->markers); // move the internal pointer to the end of the array |
|
131 | 131 | $key = key($this->markers); |
132 | 132 | $this->markers[$key]['message'] = $message; |
133 | 133 | $this->markers[$key]['autoOpen'] = $autoOpen; |
@@ -218,16 +218,16 @@ discard block |
||
218 | 218 | { |
219 | 219 | throw new LogicException("setIcon must be called after addMarker()"); |
220 | 220 | } |
221 | - end($this->markers); // move the internal pointer to the end of the array |
|
221 | + end($this->markers); // move the internal pointer to the end of the array |
|
222 | 222 | $key = key($this->markers); |
223 | - if($icon instanceof Marker\Icon) |
|
223 | + if ($icon instanceof Marker\Icon) |
|
224 | 224 | { |
225 | - $icon->setUrl(is_null($this->iconDefaultPath) ? $icon->getUrl() : $this->iconDefaultPath . $icon->getUrl()); |
|
225 | + $icon->setUrl(is_null($this->iconDefaultPath) ? $icon->getUrl() : $this->iconDefaultPath.$icon->getUrl()); |
|
226 | 226 | $this->markers[$key]['icon'] = $icon->getArray(); |
227 | 227 | |
228 | 228 | } else |
229 | 229 | { |
230 | - $this->markers[$key]['icon'] = is_null($this->iconDefaultPath) ? $icon : $this->iconDefaultPath . $icon; |
|
230 | + $this->markers[$key]['icon'] = is_null($this->iconDefaultPath) ? $icon : $this->iconDefaultPath.$icon; |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | return $this; |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function setDefaultIconPath($defaultPath) |
242 | 242 | { |
243 | - if(!is_null($defaultPath) && |
|
243 | + if (!is_null($defaultPath) && |
|
244 | 244 | !Strings::endsWith($defaultPath, '/') && |
245 | 245 | !Strings::endsWith($defaultPath, '\\')) |
246 | 246 | { |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | { |
277 | 277 | throw new InvalidArgumentException("setColor must be called after addMarker()"); |
278 | 278 | } |
279 | - end($this->markers); // move the internal pointer to the end of the array |
|
279 | + end($this->markers); // move the internal pointer to the end of the array |
|
280 | 280 | $key = key($this->markers); |
281 | 281 | $this->markers[$key]['color'] = $color; |
282 | 282 | return $this; |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | */ |
289 | 289 | private function createMarker(array $marker) |
290 | 290 | { |
291 | - if(!array_key_exists('coordinates', $marker)) |
|
291 | + if (!array_key_exists('coordinates', $marker)) |
|
292 | 292 | { |
293 | 293 | throw new InvalidArgumentException('Coordinates must be set in every marker'); |
294 | 294 | } |
@@ -297,9 +297,9 @@ discard block |
||
297 | 297 | isset($marker['animation']) ? $marker['animation'] : false, |
298 | 298 | isset($marker['title']) ? $marker['title'] : null); |
299 | 299 | |
300 | - if(array_key_exists('message', $marker)) |
|
300 | + if (array_key_exists('message', $marker)) |
|
301 | 301 | { |
302 | - if(is_array($marker['message'])) |
|
302 | + if (is_array($marker['message'])) |
|
303 | 303 | { |
304 | 304 | $message = array_values($marker['message']); |
305 | 305 | $this->setMessage($message[0], $message[1]); |
@@ -309,23 +309,23 @@ discard block |
||
309 | 309 | } |
310 | 310 | } |
311 | 311 | |
312 | - if(array_key_exists('icon', $marker)) |
|
312 | + if (array_key_exists('icon', $marker)) |
|
313 | 313 | { |
314 | - if(is_array($marker['icon'])) |
|
314 | + if (is_array($marker['icon'])) |
|
315 | 315 | { |
316 | 316 | $icon = new Marker\Icon($marker['icon']['url']); |
317 | 317 | |
318 | - if(array_key_exists('size', $marker['icon'])) |
|
318 | + if (array_key_exists('size', $marker['icon'])) |
|
319 | 319 | { |
320 | 320 | $icon->setSize($marker['icon']['size']); |
321 | 321 | } |
322 | 322 | |
323 | - if(array_key_exists('anchor', $marker['icon'])) |
|
323 | + if (array_key_exists('anchor', $marker['icon'])) |
|
324 | 324 | { |
325 | 325 | $icon->setAnchor($marker['icon']['anchor']); |
326 | 326 | } |
327 | 327 | |
328 | - if(array_key_exists('origin', $marker['icon'])) |
|
328 | + if (array_key_exists('origin', $marker['icon'])) |
|
329 | 329 | { |
330 | 330 | $icon->setOrigin($marker['icon']['origin']); |
331 | 331 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | } |
338 | 338 | } |
339 | 339 | |
340 | - if(array_key_exists('color', $marker)) |
|
340 | + if (array_key_exists('color', $marker)) |
|
341 | 341 | { |
342 | 342 | $this->setColor($marker['color']); |
343 | 343 | } |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: petr |
|
5 | - * Date: 22.1.16 |
|
6 | - * Time: 20:22 |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: petr |
|
5 | + * Date: 22.1.16 |
|
6 | + * Time: 20:22 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace Oli\GoogleAPI; |
10 | 10 |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: petr |
|
5 | - * Date: 22.1.16 |
|
6 | - * Time: 20:14 |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: petr |
|
5 | + * Date: 22.1.16 |
|
6 | + * Time: 20:14 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace Oli\GoogleAPI; |
10 | 10 |