| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 20 | protected function assessSafeness(array $strings): void |
||
| 21 | { |
||
| 22 | $str = implode('', $strings); |
||
| 23 | foreach (['AsURL', 'InCSS', 'InJS'] as $context) |
||
| 24 | { |
||
| 25 | $callback = ContextSafeness::class . '::getDisallowedCharacters' . $context; |
||
| 26 | foreach ($callback() as $char) |
||
| 27 | { |
||
| 28 | if (strpos($str, $char) !== false) |
||
| 29 | { |
||
| 30 | continue 2; |
||
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 34 | $methodName = 'markAsSafe' . $context; |
||
| 35 | $this->$methodName(); |
||
| 36 | } |
||
| 38 | } |