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   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 31
dl 0
loc 39
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 37 2
1
<?php
2
3
namespace Webfactory\ShortcodeBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8
class Configuration implements ConfigurationInterface
9
{
10
    public function getConfigTreeBuilder(): TreeBuilder
11
    {
12
        $treeBuilder = new TreeBuilder('webfactory_shortcode');
13
        $rootNode = method_exists(TreeBuilder::class, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->root('webfactory_shortcode');
0 ignored issues
show
Bug introduced by
The method root() does not exist on Symfony\Component\Config...ion\Builder\TreeBuilder. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

13
        $rootNode = method_exists(TreeBuilder::class, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->/** @scrutinizer ignore-call */ root('webfactory_shortcode');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
14
15
        // For details on these configuration options, see https://github.com/thunderer/Shortcode#parsing and
16
        // https://github.com/thunderer/Shortcode#configuration .
17
        $rootNode
18
            ->children()
19
                ->enumNode('parser')
20
                    ->info('Which parser type to use, choose "regular" or "regex".')
21
                    ->values(['regular', 'regex'])
22
                    ->defaultValue('regular')
23
                ->end()
24
                ->integerNode('recursion_depth')
25
                    ->info('Controls how many levels of shortcodes to process')
26
                    ->defaultValue(null)
27
                ->end()
28
                ->integerNode('max_iterations')
29
                    ->info('Limit the number of iterations when resolving shortcodes')
30
                    ->defaultValue(null)
31
                ->end()
32
                ->arrayNode('shortcodes')
33
                    ->normalizeKeys(false)
34
                    ->arrayPrototype()
35
                        ->beforeNormalization()
36
                            ->ifString()->then(static function ($v) {
37
                                return ['controller' => $v];
38
                            })
39
                            ->end()
40
                        ->children()
41
                            ->scalarNode('controller')->isRequired()->end()
42
                            ->enumNode('method')->values(['esi', 'inline'])->defaultValue('inline')->end()
43
                            ->scalarNode('description')->defaultNull()->end()
44
                            ->scalarNode('example')->defaultNull()->end();
45
46
        return $treeBuilder;
47
    }
48
}
49