| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 1 | public function __invoke($collection, $default) |
|
|
|
|||
| 21 | { |
||
| 22 | 1 | $defaults = func_get_args(); |
|
| 23 | 1 | array_shift($defaults); // remove $collection |
|
| 24 | |||
| 25 | 1 | $collection = clone $collection; |
|
| 26 | |||
| 27 | 1 | foreach ($defaults as $default) { |
|
| 28 | 1 | foreach ($default as $key => $value) { |
|
| 29 | 1 | if (!isset($collection[$key])) { |
|
| 30 | 1 | $collection[$key] = $value; |
|
| 31 | } |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | 1 | return $collection; |
|
| 36 | } |
||
| 37 | } |
||
| 38 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.