| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 53 | 5 | public function setAttr(array $name, array &$context, $value): self |
|
| 54 | { |
||
| 55 | 5 | $current = array_shift($name); |
|
| 56 | |||
| 57 | 5 | if (count($name) === 0) { |
|
| 58 | 5 | $this->setValueToContext($current, $context, $value); |
|
| 59 | 5 | return $this; |
|
| 60 | } |
||
| 61 | |||
| 62 | 3 | if (!array_key_exists($current, $context) || !is_array($context[$current])) { |
|
| 63 | 2 | $context[$current] = []; |
|
| 64 | } |
||
| 65 | |||
| 66 | 3 | $this->setAttr($name, $context[$current], $value); |
|
| 67 | |||
| 68 | 3 | return $this; |
|
| 69 | } |
||
| 70 | |||
| 80 |