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 (#217)
by Eric
65:19 queued 62:20
created

SizeSubscriber   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handleMap() 0 4 1
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 Ivory\GoogleMap\Helper\Renderer\Image\SizeRenderer;
17
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
18
19
/**
20
 * @author GeLo <[email protected]>
21
 */
22
class SizeSubscriber implements EventSubscriberInterface
23
{
24
    /**
25
     * @var SizeRenderer
26
     */
27
    private $sizeRenderer;
28
29
    /**
30
     * @param SizeRenderer $sizeRenderer
31
     */
32
    public function __construct(SizeRenderer $sizeRenderer)
33
    {
34
        $this->sizeRenderer = $sizeRenderer;
35
    }
36
37
    /**
38
     * @param StaticMapEvent $event
39
     */
40
    public function handleMap(StaticMapEvent $event)
41
    {
42
        $event->setParameter('size', $this->sizeRenderer->render($event->getMap()));
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    public static function getSubscribedEvents()
49
    {
50
        return [StaticMapEvents::SIZE => 'handleMap'];
51
    }
52
}
53