-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPHPCSFixerPlugin.php
More file actions
40 lines (33 loc) · 1.12 KB
/
PHPCSFixerPlugin.php
File metadata and controls
40 lines (33 loc) · 1.12 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
<?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\PHPCSFixer;
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 PHPCSFixerPlugin extends Plugin
{
public function getName(): string
{
return 'phpcs';
}
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, 'phpcs');
$container->getParameterBag()->add($config);
}
}