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 — static-map ( 1bc0cf )
by Eric
64:02
created

CenterSubscriber::handleMap()   B

Complexity

Conditions 5
Paths 6

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 8.8571
c 0
b 0
f 0
cc 5
eloc 8
nc 6
nop 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 Ivory\GoogleMap\Helper\Renderer\Image\Base\CoordinateRenderer;
17
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
18
19
/**
20
 * @author GeLo <[email protected]>
21
 */
22
class CenterSubscriber implements EventSubscriberInterface
23
{
24
    /**
25
     * @var CoordinateRenderer
26
     */
27
    private $coordinateRenderer;
28
29
    /**
30
     * @param CoordinateRenderer $coordinateRenderer
31
     */
32
    public function __construct(CoordinateRenderer $coordinateRenderer)
33
    {
34
        $this->coordinateRenderer = $coordinateRenderer;
35
    }
36
37
    /**
38
     * @param StaticMapEvent $event
39
     */
40
    public function handleMap(StaticMapEvent $event)
41
    {
42
        $map = $event->getMap();
43
44
        if ($map->hasStaticOption('center')) {
45
            $center = $map->getStaticOption('center');
46
        } elseif (!$map->isAutoZoom() && !$map->hasStaticOption('visible')) {
47
            $center = $this->coordinateRenderer->render($map->getCenter());
48
        }
49
50
        if (isset($center)) {
51
            $event->setParameter('center', $center);
52
        }
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public static function getSubscribedEvents()
59
    {
60
        return [StaticMapEvents::CENTER => 'handleMap'];
61
    }
62
}
63