Conditions | 4 |
Paths | 2 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
10 | public function __construct($files = [], ContainerInterface $container = null) |
||
11 | 5 | { |
|
12 | 5 | $filesArray = []; |
|
13 | 3 | if (is_array($files) && !empty($files)) { |
|
14 | 3 | foreach ($files as $key => $file) { |
|
15 | 3 | $filesArray[$key] = new File($file, $container); |
|
|
|||
16 | 3 | } |
|
17 | 5 | } |
|
18 | 5 | parent::__construct($filesArray); |
|
19 | } |
||
20 | 1 | ||
59 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):