Conditions | 3 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
7 | public static function parseParenthesis(string $string): array |
||
8 | { |
||
9 | if (str_contains($string, '(') && str_contains($string, ')')) { |
||
10 | preg_match('/(.*)(\((.*)\))/', $string, $match); |
||
11 | } |
||
12 | |||
13 | return [ |
||
14 | 'left' => $match[1] ?? $string, |
||
15 | 'inside' => $match[3] ?? '', |
||
16 | ]; |
||
17 | } |
||
18 | } |
||
19 |