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.

AjglCsvExtension::load()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 19
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 2.0014

Importance

Changes 6
Bugs 2 Features 0
Metric Value
c 6
b 2
f 0
dl 0
loc 19
ccs 13
cts 14
cp 0.9286
rs 9.4285
cc 2
eloc 13
nc 2
nop 2
crap 2.0014
1
<?php
2
3
/*
4
 * AJGL CSV Bundle
5
 *
6
 * Copyright (C) Antonio J. García Lagar <[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 Ajgl\Bundle\CsvBundle\DependencyInjection;
13
14
use Symfony\Component\Config\FileLocator;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Loader;
17
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
18
19
/**
20
 * @author Antonio J. García Lagar <[email protected]>
21
 */
22
class AjglCsvExtension extends Extension
23
{
24 1
    public function load(array $config, ContainerBuilder $container)
25
    {
26 1
        $configuration = new Configuration();
27 1
        $config = $this->processConfiguration($configuration, $config);
28
29 1
        $container->setParameter('ajgl_csv.reader.default_type', $config['reader_default_type']);
30 1
        $container->setParameter('ajgl_csv.writer.default_type', $config['writer_default_type']);
31
32 1
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
33 1
        if (method_exists('Symfony\Component\DependencyInjection\Definition', 'getFactoryClass')) {
34 1
            $loader->load('csv.legacy.xml');
35 1
        } else {
36
            $loader->load('csv.xml');
37
        }
38
39 1
        $csvDefinition = $container->getDefinition('ajgl_csv');
40 1
        $csvDefinition->addMethodCall('setDefaultReaderType', array('%ajgl_csv.reader.default_type%'));
41 1
        $csvDefinition->addMethodCall('setDefaultWriterType', array('%ajgl_csv.writer.default_type%'));
42 1
    }
43
}
44