Issues (14)

src/DependencyInjection/Configuration.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Locastic\SymfonyTranslationBundle\DependencyInjection;
6
7
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
8
use Symfony\Component\Config\Definition\ConfigurationInterface;
9
10
final class Configuration implements ConfigurationInterface
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function getConfigTreeBuilder(): TreeBuilder
16
    {
17
        $treeBuilder = new TreeBuilder('locastic_symfony_translation');
18
        if (\method_exists($treeBuilder, 'getRootNode')) {
19
            $rootNode = $treeBuilder->getRootNode();
20
        } else {
21
            // BC layer for symfony/config 4.1 and older
22
            $rootNode = $treeBuilder->root('locastic_symfony_translation');
0 ignored issues
show
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

22
            /** @scrutinizer ignore-call */ 
23
            $rootNode = $treeBuilder->root('locastic_symfony_translation');

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...
23
        }
24
25
        $rootNode
26
            ->children()
27
                ->scalarNode('default_locale')
28
                    ->defaultValue('en_US')
29
                ->end()
30
                ->arrayNode('locales')->scalarPrototype()->end()->end()
31
            ->end()
32
        ;
33
34
        return $treeBuilder;
35
    }
36
}
37