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   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 28
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handleMap() 0 14 4
A getSubscribedEvents() 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\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