Issues (9)

DependencyInjection/Configuration.php (2 issues)

1
<?php
2
3
namespace DH\NavigationBundle\DependencyInjection;
4
5
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
6
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
7
use Symfony\Component\Config\Definition\ConfigurationInterface;
8
9
class Configuration implements ConfigurationInterface
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function getConfigTreeBuilder(): TreeBuilder
15
    {
16
        $treeBuilder = new TreeBuilder('dh_navigation');
17
        $rootNode = $treeBuilder->getRootNode();
18
19
        $rootNode
20
            ->children()
21
            ->append($this->getProvidersNode())
22
        ;
23
24
        return $treeBuilder;
25
    }
26
27
    private function getProvidersNode(): ArrayNodeDefinition
28
    {
29
        $treeBuilder = new TreeBuilder('providers');
30
        $node = $treeBuilder->getRootNode();
31
32
        $node
33
            ->requiresAtLeastOneElement()
0 ignored issues
show
The method requiresAtLeastOneElement() does not exist on Symfony\Component\Config...\Builder\NodeDefinition. It seems like you code against a sub-type of Symfony\Component\Config...\Builder\NodeDefinition such as Symfony\Component\Config...der\ArrayNodeDefinition. ( Ignorable by Annotation )

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

33
            ->/** @scrutinizer ignore-call */ 
34
              requiresAtLeastOneElement()
Loading history...
34
            ->useAttributeAsKey('name')
35
            ->prototype('array')
36
            ->fixXmlConfig('plugin')
37
                ->children()
38
                    ->scalarNode('factory')->isRequired()->cannotBeEmpty()->end()
39
                    ->variableNode('options')->defaultValue([])->end()
40
                    ->arrayNode('aliases')
41
                        ->prototype('scalar')->end()
42
                    ->end()
43
                ->end()
44
            ->end()
45
        ;
46
47
        return $node;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $node returns the type Symfony\Component\Config...\Builder\NodeDefinition which includes types incompatible with the type-hinted return Symfony\Component\Config...der\ArrayNodeDefinition.
Loading history...
48
    }
49
}
50