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