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 — master ( f3e785...6efe3c )
by Cas
04:09
created

RegisterApiClientPass   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B process() 0 19 5
1
<?php
2
3
namespace CL\Bundle\SlackBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
class RegisterApiClientPass implements CompilerPassInterface
9
{
10 3
    public function process(ContainerBuilder $container)
11
    {
12 3
        $clientId = 'cl_slack.api_client';
13 3
        $mockClientId = 'cl_slack.mock_api_client';
14
15 3
        if (!$container->hasDefinition($clientId) ||
16 3
            !$container->hasDefinition($mockClientId) ||
17 3
            !$container->hasParameter('cl_slack.test')
18 3
        ) {
19 1
            return;
20
        }
21
22 2
        if (!$container->getParameter('cl_slack.test')) {
23 1
            return;
24
        }
25
26 1
        $container->removeDefinition($clientId);
27 1
        $container->setAlias($clientId, $mockClientId);
28 1
    }
29
}
30