Conditions | 4 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | 5 | public function __construct($files = array(), ContainerInterface $container = null) |
|
10 | { |
||
11 | 5 | $filesArray = array(); |
|
12 | 5 | if (is_array($files) && !empty($files)) { |
|
13 | 3 | foreach ($files as $key => $file) { |
|
14 | 3 | $filesArray[$key] = new File($file, $container); |
|
|
|||
15 | 3 | } |
|
16 | 3 | } |
|
17 | 5 | parent::__construct($filesArray); |
|
18 | 5 | } |
|
19 | |||
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):