Conditions | 4 |
Paths | 4 |
Total Lines | 25 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
10 | public static function buildParameters(Event $event) |
||
11 | { |
||
12 | $extras = $event->getComposer()->getPackage()->getExtra(); |
||
13 | if (!isset($extras['environment-parameters'])) { |
||
14 | throw new \InvalidArgumentException('The parameter handler needs to be configured through the extra.environment-parameters setting.'); |
||
15 | } |
||
16 | $configs = $extras['environment-parameters']; |
||
17 | if (!is_array($configs)) { |
||
18 | throw new \InvalidArgumentException('The extra.environment-parameters setting must be an array or a configuration object.'); |
||
19 | } |
||
20 | |||
21 | $fs = new Filesystem(); |
||
22 | $fileHandler = new FileHandler($fs, $event->getArguments()); |
||
23 | |||
24 | if (!isset($configs['build-folder'])) { |
||
25 | $configs['build-folder'] = 'build'; |
||
26 | } |
||
27 | $fileHandler->initDirectory($configs['build-folder']); |
||
28 | |||
29 | $fileProcessor = new FileProcessor($fs, $event->getIO(), $fileHandler); |
||
30 | $fileProcessor->process($configs); |
||
31 | |||
32 | $incenteevProcessor = new IncenteevParametersProcessor($fileHandler); |
||
33 | $incenteevProcessor->process($configs, $event); |
||
34 | } |
||
35 | } |
||
36 |