| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 285 | public static function filter(string $html, string $filter): string |
|
| 34 | { |
||
| 35 | switch ($filter) { |
||
| 36 | 285 | case self::STRIP: |
|
| 37 | 12 | return ''; |
|
| 38 | 273 | case self::ESCAPE: |
|
| 39 | 12 | return \htmlspecialchars($html, \ENT_NOQUOTES); |
|
| 40 | 261 | case self::ALLOW: |
|
| 41 | 258 | return $html; |
|
| 42 | default: |
||
| 43 | 3 | throw new \InvalidArgumentException(sprintf('Invalid filter provided: "%s"', $filter)); |
|
| 44 | } |
||
| 45 | } |
||
| 46 | } |
||
| 47 |