Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
13 | 36 | public static function controlCodes(string $in): string |
|
14 | { |
||
15 | 36 | $str = preg_replace(self::REG_EXP, '', $in); |
|
16 | 36 | if (PREG_NO_ERROR !== $error = preg_last_error()) { |
|
17 | // @codeCoverageIgnoreStart |
||
18 | throw new \RuntimeException('Failed to apply regex. Code: ' . $error, $error); |
||
19 | // @codeCoverageIgnoreEnd |
||
20 | } |
||
21 | 36 | return (string)$str; |
|
22 | } |
||
24 |