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 — 1.x (#220)
by Eric
37:59 queued 34:57
created

ProviderCompilerPass::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 16
ccs 12
cts 12
cp 1
rs 9.4285
cc 2
eloc 10
nc 2
nop 1
crap 2
1
<?php
2
3
/*
4
 * This file is part of the Hautelook\AliceBundle package.
5
 *
6
 * (c) Baldur Rensch <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Hautelook\AliceBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Reference;
17
18
/**
19
 * Add registered Faker providers instances to the {@see Hautelook\AliceBundle\Faker\ProvidersChain}.
20
 *
21
 * @author Théo FIDRY <[email protected]>
22
 */
23
final class ProviderCompilerPass implements CompilerPassInterface
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28 6
    public function process(ContainerBuilder $container)
29
    {
30 6
        $fakerDefinition = $container->findDefinition('hautelook_alice.faker');
31 6
        $providerChainDefinition = $container->findDefinition('hautelook_alice.faker.provider_chain');
32
33 6
        $providersIds = $container->findTaggedServiceIds('hautelook_alice.faker.provider');
34 6
        $providers = [];
35 6
        foreach ($providersIds as $providerId => $tags) {
36 6
            $provider = new Reference($providerId);
37
38 6
            $fakerDefinition->addMethodCall('addProvider', [$provider]);
39 6
            $providers[] = $provider;
40 6
        }
41
42 6
        $providerChainDefinition->addArgument($providers);
43 6
    }
44
}
45