DotfilesExtension::process()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
eloc 0
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the dotfiles project.
7
 *
8
 *     (c) Anthonius Munthi <[email protected]>
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 Dotfiles\Behat;
15
16
use Behat\Testwork\ServiceContainer\Extension;
17
use Behat\Testwork\ServiceContainer\ExtensionManager;
18
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
19
use Symfony\Component\Config\FileLocator;
20
use Symfony\Component\DependencyInjection\ContainerBuilder;
21
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
22
23
class DotfilesExtension implements Extension
24
{
25
    public function configure(ArrayNodeDefinition $builder): void
26
    {
27
        $builder
28
            ->addDefaultsIfNotSet()
29
            ->children()
30
                ->scalarNode('command_prefix')
31
                    ->defaultValue('dotfiles ')
32
                ->end()
33
            ->end()
0 ignored issues
show
Bug introduced by
The method end() does not exist on Symfony\Component\Config...der\NodeParentInterface. It seems like you code against a sub-type of said class. However, the method does not exist in Symfony\Component\Config...ion\Builder\TreeBuilder. Are you sure you never get one of those? ( 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 */ end()
Loading history...
34
        ;
35
    }
36
37
    public function getConfigKey()
38
    {
39
        return 'dotfiles';
40
    }
41
42
    public function initialize(ExtensionManager $extensionManager): void
43
    {
44
        // TODO: Implement initialize() method.
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function load(ContainerBuilder $container, array $config): void
51
    {
52
        $locator = new FileLocator(__DIR__.'/Resources');
53
        $loader = new YamlFileLoader($container, $locator);
54
        $loader->load('services.yaml');
55
56
        $container->setParameter('dotfiles.command_prefix', $config['command_prefix']);
57
    }
58
59
    public function process(ContainerBuilder $container): void
60
    {
61
        // TODO: Implement process() method.
62
    }
63
}
64