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.
Test Failed
Push — master ( c38bf5...417d52 )
by Mewes
03:09
created

Configuration::getConfigTreeBuilder()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 57

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 52
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 57
ccs 52
cts 52
cp 1
rs 8.9381
c 0
b 0
f 0
cc 1
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 MewesK\TwigSpreadsheetBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
/**
9
 * Class Configuration.
10
 */
11
class Configuration implements ConfigurationInterface
12
{
13
    /**
14
     * {@inheritdoc}
15
     *
16
     * @throws \RuntimeException
17
     */
18 2
    public function getConfigTreeBuilder()
19
    {
20 2
        $treeBuilder = new TreeBuilder();
21 2
        $rootNode = $treeBuilder->root('mewes_k_twig_spreadsheet');
22
23
        $rootNode
24 2
            ->children()
25 2
                ->booleanNode('pre_calculate_formulas')
26 2
                    ->defaultTrue()
27 2
                    ->info('Disabling formula calculations can improve the performance but the resulting documents won\'t immediately show formula results in external programs.')
28 2
                ->end()
29 2
                ->arrayNode('cache')
30 2
                    ->addDefaultsIfNotSet()
31 2
                    ->children()
32 2
                        ->scalarNode('bitmap')
33 2
                            ->defaultValue('%kernel.cache_dir%/spreadsheet/bitmap')
34 2
                            ->cannotBeEmpty()
35 2
                            ->info('Using a bitmap cache is necessary, PhpSpreadsheet supports only local files.')
36 2
                        ->end()
37 2
                        ->scalarNode('xml')
38 2
                            ->defaultFalse()
39 2
                            ->example('"%kernel.cache_dir%/spreadsheet/xml"')
40 2
                            ->info('Using XML caching can improve memory consumption by writing data to disk. Works only for .xlsx and .ods documents.')
41 2
                        ->end()
42 2
                    ->end()
43 2
                ->end()
44 2
                ->arrayNode('csv_writer')
45 2
                    ->addDefaultsIfNotSet()
46 2
                    ->info('See PhpOffice\PhpSpreadsheet\Writer\Csv.php for more information.')
47 2
                    ->children()
48 2
                        ->scalarNode('delimiter')
49 2
                            ->defaultValue(',')
50 2
                        ->end()
51 2
                        ->scalarNode('enclosure')
52 2
                            ->defaultValue('"')
53 2
                        ->end()
54 2
                        ->booleanNode('excel_compatibility')
55 2
                            ->defaultFalse()
56 2
                        ->end()
57 2
                        ->booleanNode('include_separator_line')
58 2
                            ->defaultFalse()
59 2
                        ->end()
60 2
                        ->scalarNode('line_ending')
61 2
                            ->defaultValue(PHP_EOL)
62 2
                        ->end()
63 2
                        ->integerNode('sheet_index')
64 2
                            ->defaultValue(0)
65 2
                        ->end()
66 2
                        ->booleanNode('use_bom')
67 2
                            ->defaultFalse()
68 2
                        ->end()
69 2
                    ->end()
70 2
                ->end()
71 2
            ->end();
72
73 2
        return $treeBuilder;
74
    }
75
}
76