Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
72 | 22 | private function validate(string $flag): void |
|
73 | { |
||
74 | 22 | if ($flag === '') { |
|
75 | 1 | throw new \InvalidArgumentException('Flag string is empty'); |
|
76 | } |
||
77 | |||
78 | 21 | if (isset(self::RFC_3501_FIXED[$flag])) { |
|
79 | 12 | return; |
|
80 | } |
||
81 | |||
82 | 10 | if ($flag[0] === '\\') { |
|
83 | 3 | $this->validateAtom(substr($flag, 1)); |
|
84 | } else { |
||
85 | 7 | $this->validateAtom($flag); |
|
86 | } |
||
87 | 6 | } |
|
88 | |||
100 | } |