Issues (10)

src/DependencyInjection/Configuration.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Sendy\SendyBundle\DependencyInjection;
6
7
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
8
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
9
use Symfony\Component\Config\Definition\ConfigurationInterface;
10
11
final class Configuration implements ConfigurationInterface
12
{
13
    public function getConfigTreeBuilder(): TreeBuilder
14
    {
15
        $treeBuilder = new TreeBuilder('sendy');
16
17
        $rootNode = $treeBuilder->getRootNode();
18
        $this->addSendySection($rootNode);
19
20
        return $treeBuilder;
21
    }
22
23
    /**
24
     * Parses the "sendy" block config section
25
     * Example for yaml section:
26
     * sendy:
27
     *     api_key: "yourapiKEYHERE"
28
     *     api_host: "https://updates.mydomain.com"
29
     *     list_id: "your_list_id_goes_here".
30
     */
31
    private function addSendySection(ArrayNodeDefinition $node): void
32
    {
33
        $node
34
            ->children()
35
                ->scalarNode('api_key')
36
                    ->isRequired()
37
                    ->cannotBeEmpty()
38
                ->end()
39
                ->scalarNode('api_host')
0 ignored issues
show
The method scalarNode() does not exist on Symfony\Component\Config...der\NodeParentInterface. It seems like you code against a sub-type of Symfony\Component\Config...der\NodeParentInterface such as Symfony\Component\Config...ion\Builder\NodeBuilder. ( Ignorable by Annotation )

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

39
                ->/** @scrutinizer ignore-call */ scalarNode('api_host')
Loading history...
40
                    ->isRequired()
41
                    ->cannotBeEmpty()
42
                ->end()
43
                ->scalarNode('list_id')
44
                    ->isRequired()
45
                    ->cannotBeEmpty()
46
                ->end()
47
            ->end();
48
    }
49
}
50