Conditions | 4 |
Paths | 4 |
Total Lines | 24 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | public static function buildParameters(Event $event) |
||
10 | { |
||
11 | $extras = $event->getComposer()->getPackage()->getExtra(); |
||
12 | if (!isset($extras['build-parameters'])) { |
||
13 | throw new \InvalidArgumentException('The parameter handler needs to be configured through the extra.build-parameters setting.'); |
||
14 | } |
||
15 | $configs = $extras['build-parameters']; |
||
16 | if (!is_array($configs)) { |
||
17 | throw new \InvalidArgumentException('The extra.build-parameters setting must be an array or a configuration object.'); |
||
18 | } |
||
19 | |||
20 | $fileHandler = new FileHandler($event->getIO()); |
||
|
|||
21 | |||
22 | if (!isset($configs['build-folder'])) { |
||
23 | $configs['build-folder'] = 'build'; |
||
24 | } |
||
25 | $fileHandler->initDirectory($configs['build-folder']); |
||
26 | |||
27 | $fileProcessor = new FileProcessor($event->getIO(), $fileHandler); |
||
28 | $fileProcessor->process($configs, $event); |
||
29 | |||
30 | $incenteevProcessor = new IncenteevParametersProcessor($event->getIO(), $fileHandler); |
||
31 | $incenteevProcessor->process($configs, $event); |
||
32 | } |
||
33 | } |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.