| Conditions | 1 |
| Paths | 1 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 1 |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 14 | 2 | public function format($text) |
|
| 15 | { |
||
| 16 | 2 | $replacement = implode('', [$this->guards[0], '$1', $this->guards[1]]); |
|
| 17 | 2 | $text = preg_replace('/<(.*)>/U', $replacement, $text); |
|
| 18 | 2 | $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8', false); |
|
| 19 | |||
| 20 | 2 | return str_replace($this->guards, ['<', '>'], $text); |
|
| 21 | } |
||
| 22 | } |
||
| 23 |