-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDotfilesExtension.php
More file actions
63 lines (53 loc) · 1.65 KB
/
DotfilesExtension.php
File metadata and controls
63 lines (53 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
declare(strict_types=1);
/*
* This file is part of the dotfiles project.
*
* (c) Anthonius Munthi <me@itstoni.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Dotfiles\Behat;
use Behat\Testwork\ServiceContainer\Extension;
use Behat\Testwork\ServiceContainer\ExtensionManager;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
class DotfilesExtension implements Extension
{
public function configure(ArrayNodeDefinition $builder): void
{
$builder
->addDefaultsIfNotSet()
->children()
->scalarNode('command_prefix')
->defaultValue('dotfiles ')
->end()
->end()
;
}
public function getConfigKey()
{
return 'dotfiles';
}
public function initialize(ExtensionManager $extensionManager): void
{
// TODO: Implement initialize() method.
}
/**
* {@inheritdoc}
*/
public function load(ContainerBuilder $container, array $config): void
{
$locator = new FileLocator(__DIR__.'/Resources');
$loader = new YamlFileLoader($container, $locator);
$loader->load('services.yaml');
$container->setParameter('dotfiles.command_prefix', $config['command_prefix']);
}
public function process(ContainerBuilder $container): void
{
// TODO: Implement process() method.
}
}