Completed
Pull Request — master (#6)
by ANTHONIUS
02:44
created

DotfilesExtension::process()   A

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
/*
4
 * This file is part of the dotfiles project.
5
 *
6
 * (c) Anthonius Munthi <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was disstributed with this source code.
10
 */
11
12
namespace Dotfiles\Behat;
13
14
15
use Behat\Testwork\ServiceContainer\Extension;
16
use Behat\Testwork\ServiceContainer\ExtensionManager;
17
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
18
use Symfony\Component\Config\FileLocator;
19
use Symfony\Component\DependencyInjection\ContainerBuilder;
20
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
21
22
class DotfilesExtension implements Extension
23
{
24
    public function getConfigKey()
25
    {
26
        return 'dotfiles';
27
    }
28
29
    public function initialize(ExtensionManager $extensionManager)
30
    {
31
        // TODO: Implement initialize() method.
32
    }
33
34
    public function configure(ArrayNodeDefinition $builder)
35
    {
36
        $builder
37
            ->addDefaultsIfNotSet()
38
            ->children()
39
                ->scalarNode('command_prefix')
40
                    ->defaultValue('dotfiles ')
41
                ->end()
42
            ->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

42
            ->/** @scrutinizer ignore-call */ end()
Loading history...
43
        ;
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function load(ContainerBuilder $container, array $config)
50
    {
51
        $locator = new FileLocator(__DIR__.'/Resources');
52
        $loader = new YamlFileLoader($container,$locator);
53
        $loader->load('services.yaml');
54
55
        $container->setParameter('dotfiles.command_prefix',$config['command_prefix']);
56
    }
57
58
    public function process(ContainerBuilder $container)
59
    {
60
        // TODO: Implement process() method.
61
    }
62
}
63