Conditions | 4 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 4.8437 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | 1 | public function add($var, $type, $value = false) |
|
17 | { |
||
18 | 1 | $valueNext = $this->next[$var] ?? []; |
|
19 | |||
20 | 1 | if (!isset($valueNext[$type]) || !is_array($valueNext[$type])) { |
|
21 | 1 | $valueNext[$type] = [$value]; |
|
22 | } else { |
||
23 | if (is_array($value)) { |
||
24 | $valueNext[$type] = [$valueNext[$type], $value]; |
||
25 | } else { |
||
26 | $valueNext[$type][] = $value; |
||
27 | } |
||
28 | } |
||
29 | |||
30 | 1 | parent::add($var, $valueNext); |
|
31 | 1 | } |
|
33 |