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 ( 58ccc5...f31612 )
by Elemér
05:08
created

Configuration   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 96.36%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 70
ccs 53
cts 55
cp 0.9636
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 62 2
1
<?php
2
3
namespace Erelke\TwigSpreadsheetBundle\DependencyInjection;
4
5
use RuntimeException;
6
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
7
use Symfony\Component\Config\Definition\ConfigurationInterface;
8
use Symfony\Component\HttpKernel\Kernel;
9
10
/**
11
 * Class Configuration.
12
 */
13
class Configuration implements ConfigurationInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     *
18
     * @throws RuntimeException
19
     */
20 2
    public function getConfigTreeBuilder()
21
    {
22 2
    	if (version_compare(Kernel::VERSION, '4.3.0', '>=')) {
23 2
		    $treeBuilder = new TreeBuilder('erelke_twig_spreadsheet');
24 2
		    $rootNode = $treeBuilder->getRootNode();
25
	    } else {
26
		    $treeBuilder = new TreeBuilder();
27
		    $rootNode = $treeBuilder->root('erelke_twig_spreadsheet');
0 ignored issues
show
Deprecated Code introduced by
The method Symfony\Component\Config...der\TreeBuilder::root() has been deprecated with message: since Symfony 4.3, pass the root name to the constructor instead

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
28
	    }
29
30
        $rootNode
31 2
            ->children()
32 2
                ->booleanNode('pre_calculate_formulas')
33 2
                    ->defaultTrue()
34 2
                    ->info('Disabling formula calculations can improve the performance but the resulting documents won\'t immediately show formula results in external programs.')
35 2
                ->end()
36 2
                ->arrayNode('cache')
37 2
                    ->addDefaultsIfNotSet()
38 2
                    ->children()
39 2
                        ->scalarNode('bitmap')
40 2
                            ->defaultValue('%kernel.cache_dir%/spreadsheet/bitmap')
41 2
                            ->cannotBeEmpty()
42 2
                            ->info('Using a bitmap cache is necessary, PhpSpreadsheet supports only local files.')
43 2
                        ->end()
44 2
                        ->scalarNode('xml')
45 2
                            ->defaultFalse()
46 2
                            ->example('"%kernel.cache_dir%/spreadsheet/xml"')
47 2
                            ->info('Using XML caching can improve memory consumption by writing data to disk. Works only for .xlsx and .ods documents.')
48 2
                        ->end()
49 2
                    ->end()
50 2
                ->end()
51 2
                ->arrayNode('csv_writer')
52 2
                    ->addDefaultsIfNotSet()
53 2
                    ->info('See PhpOffice\PhpSpreadsheet\Writer\Csv.php for more information.')
54 2
                    ->children()
55 2
                        ->scalarNode('delimiter')
56 2
                            ->defaultValue(',')
57 2
                        ->end()
58 2
                        ->scalarNode('enclosure')
59 2
                            ->defaultValue('"')
60 2
                        ->end()
61 2
                        ->booleanNode('excel_compatibility')
62 2
                            ->defaultFalse()
63 2
                        ->end()
64 2
                        ->booleanNode('include_separator_line')
65 2
                            ->defaultFalse()
66 2
                        ->end()
67 2
                        ->scalarNode('line_ending')
68 2
                            ->defaultValue(PHP_EOL)
69 2
                        ->end()
70 2
                        ->integerNode('sheet_index')
71 2
                            ->defaultValue(0)
72 2
                        ->end()
73 2
                        ->booleanNode('use_bom')
74 2
                            ->defaultFalse()
75 2
                        ->end()
76 2
                    ->end()
77 2
                ->end()
78 2
            ->end();
79
80 2
        return $treeBuilder;
81
    }
82
}
83