-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPHPBrewPlugin.php
35 lines (29 loc) · 1.04 KB
/
PHPBrewPlugin.php
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
<?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\Plugins\PHPBrew;
use Dotfiles\Core\Plugin;
use Dotfiles\Core\Util\Toolkit;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
class PHPBrewPlugin extends Plugin
{
public function load(array $configs, ContainerBuilder $container): void
{
$locator = new FileLocator(__DIR__.'/Resources');
$loader = new YamlFileLoader($container, $locator);
$loader->load('services.yaml');
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
Toolkit::flattenArray($config, 'phpbrew');
$container->getParameterBag()->add($config);
}
}