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.

Configuration::getConfigTreeBuilder()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 34
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 28
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 34
ccs 28
cts 28
cp 1
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 28
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Funstaff\RefLibRisBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * Configuration
10
 *
11
 * @author Bertrand Zuchuat <[email protected]>
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18 5
    public function getConfigTreeBuilder()
19
    {
20 5
        $treeBuilder = new TreeBuilder();
21 5
        $rootNode = $treeBuilder->root('ref_lib_ris');
22
23
        $rootNode
24 5
            ->children()
25 5
                ->arrayNode('classes')
26 5
                    ->addDefaultsIfNotSet()
27 5
                    ->children()
28 5
                        ->scalarNode('ris_fields_mapping')->defaultValue('Funstaff\RefLibRis\RisFieldsMapping')->end()
29 5
                        ->scalarNode('record_processing')->defaultValue('Funstaff\RefLibRis\RecordProcessing')->end()
30 5
                        ->scalarNode('ris_definition')->defaultValue('Funstaff\RefLibRis\RisDefinition')->end()
31 5
                        ->scalarNode('ris_writer')->defaultValue('Funstaff\RefLibRis\RisWriter')->end()
32 5
                    ->end()
33 5
                ->end()
34 5
                ->arrayNode('mapping_fields')
35 5
                ->isRequired()
36 5
                ->requiresAtLeastOneElement()
37 5
                ->useAttributeAsKey('name')
38 5
                ->prototype('array')
39 5
                    ->prototype('scalar')->end()
40 5
                ->end()
41 5
                ->validate()
42 5
                ->ifTrue(function($v) {
43 4
                    return !array_key_exists('TY', $v);
44 5
                })
45 5
                ->thenInvalid('TY field is mandatory')
46 5
                ->end()
47 5
            ->end()
48
        ;
49
50 5
        return $treeBuilder;
51
    }
52
}
53