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 ( 6daa1e...29b462 )
by Maximilian
03:41
created

Configuration::getConfigTreeBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 52
Code Lines 47

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 45
CRAP Score 1

Importance

Changes 6
Bugs 1 Features 1
Metric Value
c 6
b 1
f 1
dl 0
loc 52
ccs 45
cts 45
cp 1
rs 9.4929
cc 1
eloc 47
nc 1
nop 0
crap 1

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace Ma27\ApiKeyAuthenticationBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * This is the class that validates and merges configuration from your app/config files.
10
 *
11
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18 8
    public function getConfigTreeBuilder()
19
    {
20 8
        $treeBuilder = new TreeBuilder();
21 8
        $rootNode = $treeBuilder->root('ma27_api_key_authentication');
22
23
        $rootNode
24 8
            ->children()
25 8
                ->arrayNode('user')
26 8
                    ->children()
27 8
                        ->integerNode('api_key_length')
28 8
                            ->min(50)
29 8
                            ->defaultValue(200)
30 8
                        ->end()
31 8
                        ->scalarNode('object_manager')->isRequired()->end()
32 8
                        ->scalarNode('model_name')->defaultValue('AppBundle\\Entity\\User')->end()
33 8
                        ->arrayNode('password')
34 8
                            ->children()
35 8
                                ->scalarNode('strategy')
36 8
                                    ->validate()
37 8
                                        ->ifNotInArray(array('php55', 'crypt', 'sha512', 'phpass'))
38 8
                                        ->thenInvalid(
39
                                            'Invalid password strategy "%s"! '
40
                                            .'Allowed strategies are "password", "crypt", "sha512", "phpass"!'
41 8
                                        )
42 8
                                    ->end()
43 8
                                ->end()
44 8
                                ->integerNode('phpass_iteration_length')
45 8
                                    ->defaultValue(8)
46 8
                                ->end()
47 8
                            ->end()
48 8
                        ->end()
49 8
                    ->end()
50 8
                ->end()
51 8
                ->arrayNode('api_key_purge')
52 8
                    ->canBeEnabled()
53 8
                    ->children()
54 8
                        ->booleanNode('log_state')->defaultFalse()->end()
55 8
                        ->scalarNode('logger_service')->defaultValue('logger')->end()
56 8
                    ->end()
57 8
                ->end()
58 8
                ->arrayNode('services')
59 8
                    ->addDefaultsIfNotSet()
60 8
                    ->children()
61 8
                        ->scalarNode('auth_handler')->defaultNull()->end()
62 8
                        ->scalarNode('key_factory')->defaultNull()->end()
63 8
                        ->scalarNode('password_hasher')->defaultNull()->end()
64 8
                    ->end()
65 8
                ->end()
66 8
            ->end();
67
68 8
        return $treeBuilder;
69
    }
70
}
71