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.

RegisterHelperListenerPass::process()   A
last analyzed

Complexity

Conditions 4
Paths 5

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 12
cts 12
cp 1
rs 9.2
c 0
b 0
f 0
cc 4
eloc 9
nc 5
nop 1
crap 4
1
<?php
2
3
/*
4
 * This file is part of the Ivory Google Map bundle 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\GoogleMapBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
15
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
use Symfony\Component\DependencyInjection\Reference;
18
use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
19
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
20
21
/**
22
 * @author GeLo <[email protected]>
23
 */
24
class RegisterHelperListenerPass implements CompilerPassInterface
25
{
26
    /**
27
     * @var string[]
28
     */
29
    private static $helpers = [
30
        'api',
31
        'map',
32
        'map.static',
33
        'place_autocomplete',
34
    ];
35
36
    /**
37
     * @var RegisterListenersPass[]
38
     */
39
    private $passes = [];
40
41
    /**
42
     * {@inheritdoc}
43
     */
44 684
    public function __construct()
45
    {
46 684
        foreach (self::$helpers as $helper) {
47 684
            $this->passes[] = new RegisterListenersPass(
48 684
                'ivory.google_map.helper.'.$helper.'.event_dispatcher',
49 684
                'ivory.google_map.helper.'.$helper.'.listener',
50 684
                'ivory.google_map.helper.'.$helper.'.subscriber'
51 532
            );
52 532
        }
53 684
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58 513
    public function process(ContainerBuilder $container)
59
    {
60 513
        if (!class_exists(ServiceClosureArgument::class)) {
61 513
            foreach (self::$helpers as $helper) {
62
                $container
63 513
                    ->getDefinition('ivory.google_map.helper.'.$helper.'.event_dispatcher')
64 513
                    ->setClass(ContainerAwareEventDispatcher::class)
65 513
                    ->addArgument(new Reference('service_container'));
66 399
            }
67 399
        }
68
69 513
        foreach ($this->passes as $pass) {
70 513
            $pass->process($container);
71 399
        }
72 513
    }
73
}
74