| Conditions | 7 |
| Paths | 5 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | public static function wrap($parameters, $defaults = []) |
||
| 7 | { |
||
| 8 | if(!is_array($parameters)) { |
||
| 9 | return $parameters; |
||
| 10 | } |
||
| 11 | |||
| 12 | foreach($defaults as $key => $value) { |
||
| 13 | if(is_numeric($key) && !isset($parameters[$value])) { |
||
| 14 | $parameters[$value] = null; |
||
| 15 | } else if(!is_numeric($key) && !isset($parameters[$key])) { |
||
| 16 | $parameters[$key] = $value; |
||
| 17 | } |
||
| 18 | } |
||
| 19 | return $parameters; |
||
| 20 | } |
||
| 22 |