| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | 8 | public function has(string $key): bool |
|
| 14 | { |
||
| 15 | 8 | $keyPath = explode('.', $key); |
|
| 16 | 8 | $firstKey = array_shift($keyPath); |
|
| 17 | |||
| 18 | 8 | if (!array_key_exists($firstKey, $this->arguments)) { |
|
| 19 | 8 | return false; |
|
| 20 | } |
||
| 21 | |||
| 22 | 8 | if (empty($keyPath)) { |
|
| 23 | 8 | return true; |
|
| 24 | } |
||
| 25 | |||
| 26 | 4 | $nextKey = implode('.', $keyPath); |
|
| 27 | |||
| 28 | 4 | return $this->arguments[$firstKey]->has($nextKey); |
|
| 29 | } |
||
| 30 | |||
| 66 |