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 — master (#158)
by Bernardo Vieira da
12:24
created

GearmanExtension::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 48

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 28
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 48
ccs 28
cts 28
cp 1
rs 9.1344
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
/**
4
 * Gearman Bundle for Symfony2
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * Feel free to edit as you please, and have fun.
10
 *
11
 * @author Marc Morera <[email protected]>
12
 */
13
14
namespace Mmoreram\GearmanBundle\DependencyInjection;
15
16
use Symfony\Component\Config\FileLocator;
17
use Symfony\Component\DependencyInjection\ContainerBuilder;
18
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
19
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
20
21
/**
22
 * This is the class that loads and manages your bundle configuration
23
 *
24
 * @since 2.3.1
25
 */
26
class GearmanExtension extends Extension
27
{
28
    /**
29
     * Loads a specific configuration.
30
     *
31
     * @param array            $config    An array of configuration values
32
     * @param ContainerBuilder $container A ContainerBuilder instance
33
     *
34
     * @throws \InvalidArgumentException When provided tag is not defined in this extension
35
     *
36
     * @api
37
     */
38 1
    public function load(array $config, ContainerBuilder $container)
39
    {
40 1
        $configuration = new Configuration();
41 1
        $config = $this->processConfiguration($configuration, $config);
42
43
        /**
44
         * Setting all config elements as DI parameters to inject them
45
         */
46 1
        $container->setParameter(
47 1
            'gearman.bundles',
48 1
            $config['bundles']
49
        );
50
51 1
        $container->setParameter(
52 1
            'gearman.resources',
53 1
            $config['resources']
54
        );
55
56 1
        $container->setParameter(
57 1
            'gearman.servers',
58 1
            $config['servers']
59
        );
60
61 1
        $container->setParameter(
62 1
            'gearman.default.settings',
63 1
            $config['defaults']
64
        );
65
66 1
        $container->setParameter(
67 1
            'gearman.default.settings.generate_unique_key',
68 1
            $config['defaults']['generate_unique_key']
69
        );
70
71 1
        $loader = new YamlFileLoader(
72 1
            $container,
73 1
            new FileLocator(__DIR__ . '/../Resources/config')
74
        );
75
76
        /**
77
         * Loading DI definitions
78
         */
79 1
        $loader->load('classes.yml');
80 1
        $loader->load('services.yml');
81 1
        $loader->load('commands.yml');
82 1
        $loader->load('eventDispatchers.yml');
83 1
        $loader->load('generators.yml');
84 1
        $loader->load('externals.yml');
85 1
    }
86
}
87