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.

RegisterTaggedServiceWithManagerPass   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 4
dl 0
loc 57
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A process() 0 17 2
1
<?php
2
3
namespace Nimble\ElasticBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\DependencyInjection\Reference;
7
8
class RegisterTaggedServiceWithManagerPass extends AbstractCompilerPass
9
{
10
    /**
11
     * @var string
12
     */
13
    private $tagName;
14
15
    /**
16
     * @var string
17
     */
18
    private $managerServiceId;
19
20
    /**
21
     * @var string
22
     */
23
    private $registrationMethodName;
24
25
    /**
26
     * @var string
27
     */
28
    private $registeredServiceClassName;
29
30
    /**
31
     * @param string $tagName
32
     * @param string $managerServiceId
33
     * @param string $registrationMethodName
34
     * @param string $registeredServiceClassName
35
     */
36
    public function __construct($tagName, $managerServiceId, $registrationMethodName, $registeredServiceClassName)
37
    {
38
        $this->tagName = $tagName;
39
        $this->managerServiceId = $managerServiceId;
40
        $this->registrationMethodName = $registrationMethodName;
41
        $this->registeredServiceClassName = $registeredServiceClassName;
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function process(ContainerBuilder $container)
48
    {
49
        $synchronizerManagerDefinition = $container->getDefinition($this->managerServiceId);
50
51
        foreach ($container->findTaggedServiceIds($this->tagName) as $registeredServiceId => $tag) {
52
            $this->validateServiceClass(
53
                $container->getDefinition($registeredServiceId)->getClass(),
54
                $this->registeredServiceClassName,
55
                $this->managerServiceId,
56
                $this->tagName
57
            );
58
59
            $synchronizerManagerDefinition->addMethodCall($this->registrationMethodName, [
60
                new Reference($registeredServiceId)
61
            ]);
62
        }
63
    }
64
}
65