Issues (3)

src/DependencyInjection/Configuration.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the AutoFormBundle package.
7
 *
8
 * (c) David ALLIX <http://a2lix.fr>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace A2lix\AutoFormBundle\DependencyInjection;
15
16
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
17
use Symfony\Component\Config\Definition\ConfigurationInterface;
18
19
class Configuration implements ConfigurationInterface
20
{
21
    public function getConfigTreeBuilder(): TreeBuilder
22
    {
23
        $treeBuilder = new TreeBuilder('a2lix_auto_form');
24
        $rootNode = method_exists(TreeBuilder::class, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->root('a2lix_auto_form');
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

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

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...
25
26
        $rootNode
27
            ->children()
28
                ->arrayNode('excluded_fields')
29
                    ->defaultValue(['id', 'locale', 'translatable'])
30
                    ->beforeNormalization()
31
                        ->ifString()
32
                        ->then(function ($v) {
33
                            return preg_split('/\s*,\s*/', $v);
34
                        })
35
                    ->end()
36
                    ->prototype('scalar')
37
                    ->info('Global list of fields to exclude from form generation. (Default: id, locale, translatable)')->end()
38
                ->end()
39
            ->end()
40
        ;
41
42
        return $treeBuilder;
43
    }
44
}
45