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
Pull Request — master (#238)
by Eric
236:24 queued 232:18
created

ZoomSubscriber::handleMap()   A

Complexity

Conditions 4
Paths 6

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 11
cts 11
cp 1
rs 9.2
c 0
b 0
f 0
cc 4
eloc 8
nc 6
nop 1
crap 4
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\Helper\Subscriber\Image;
13
14
use Ivory\GoogleMap\Helper\Event\StaticMapEvent;
15
use Ivory\GoogleMap\Helper\Event\StaticMapEvents;
16
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
17
18
/**
19
 * @author GeLo <[email protected]>
20
 */
21
class ZoomSubscriber implements EventSubscriberInterface
22
{
23
    /**
24
     * @param StaticMapEvent $event
25
     */
26 96
    public function handleMap(StaticMapEvent $event)
27
    {
28 96
        $map = $event->getMap();
29
30 96
        if ($map->hasMapOption('zoom')) {
31 4
            $zoom = $map->getMapOption('zoom');
32 94
        } elseif (!$map->isAutoZoom()) {
33 72
            $zoom = 3;
34 36
        }
35
36 96
        if (isset($zoom)) {
37 76
            $event->setParameter('zoom', $zoom);
38 38
        }
39 96
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44 100
    public static function getSubscribedEvents()
45
    {
46 100
        return [StaticMapEvents::ZOOM => 'handleMap'];
47
    }
48
}
49