ConfiguratorScript   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildConfig() 0 14 2
1
<?php
2
3
namespace PhpGitHooks\Infrastructure\Composer;
4
5
require_once __DIR__.'/../../../../app/AppKernel.php';
6
7
use AppKernel;
8
use Composer\Script\Event;
9
use PhpGitHooks\Module\Configuration\Contract\Command\ConfigurationProcessor;
10
use PhpGitHooks\Module\Configuration\Contract\Command\ConfigurationProcessorHandler;
11
12
/**
13
 * Class ConfiguratorScript.
14
 *
15
 * @codingStandardsIgnoreFile
16
 */
17
class ConfiguratorScript
18
{
19
    /**
20
     * @param Event $event
21
     *
22
     * @return mixed
23
     */
24
    public static function buildConfig(Event $event)
25
    {
26
        if (true === $event->isDevMode()) {
27
            $app = new AppKernel('dev', true);
28
            $app->boot();
29
            $container = $app->getContainer();
30
            /**
31
             * @var ConfigurationProcessorHandler
32
             */
33
            $processor = $container->get('bruli.command.bus');
34
35
            $processor->handle(new ConfigurationProcessor($event->getIO()));
36
        }
37
    }
38
}
39