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::process()   B

Complexity

Conditions 5
Paths 3

Size

Total Lines 19
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 5

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 5
eloc 11
c 2
b 0
f 1
nc 3
nop 1
dl 0
loc 19
ccs 13
cts 13
cp 1
crap 5
rs 8.8571
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