Configuration::getConfigTreeBuilder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the FirebaseCloudMessagingBundle.
4
 *
5
 * (c) Artem Henvald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Fresh\FirebaseCloudMessagingBundle\DependencyInjection;
14
15
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
16
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
17
use Symfony\Component\Config\Definition\ConfigurationInterface;
18
19
/**
20
 * This is the class that loads and manages bundle configuration.
21
 *
22
 * @author Artem Henvald <[email protected]>
23
 */
24
class Configuration implements ConfigurationInterface
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function getConfigTreeBuilder(): TreeBuilder
30
    {
31
        $treeBuilder = new TreeBuilder('fresh_firebase_cloud_messaging');
32
33
        /** @var ArrayNodeDefinition $root */
34
        $root = $treeBuilder->getRootNode();
35
36
        $root
37
            ->children()
38
                ->scalarNode('sender_id')->end()
39
                ->scalarNode('server_key')->end()
40
                ->scalarNode('endpoint')->defaultValue('https://fcm.googleapis.com/fcm/send')->end()
41
                ->scalarNode('guzzle_timeout')->defaultValue(50)->end()
42
            ->end()
43
        ;
44
45
        return $treeBuilder;
46
    }
47
}
48