Conditions | 4 |
Paths | 8 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
19 | 50 | private function handleValue(string $value): string |
|
20 | { |
||
21 | 50 | if (preg_match('/#+/', $value)) { |
|
22 | 6 | $this->quote = '"'; |
|
23 | } |
||
24 | 50 | if (preg_match('/^["\']+/', $value)) { |
|
25 | 24 | $this->quote = null; |
|
26 | } |
||
27 | 50 | return $this->quote !== null ? sprintf('%2$s%1$s%2$s', $value, $this->quote) : $value; |
|
28 | } |
||
42 |