| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | protected function validValue(string $value): bool |
||
| 20 | { |
||
| 21 | $identifier = '(\w|-|{\w+})+'; |
||
| 22 | $scheme = '^' . $identifier . '://'; |
||
| 23 | $username = $identifier . '(:' . $identifier . ')?'; |
||
| 24 | $hostname = $identifier . '(\.' . $identifier . ')*'; |
||
| 25 | $path = '/(.|{\w+})*'; |
||
| 26 | $regex = '#' . $scheme . '(' . $username . '@)?' . $hostname . '(' . $path . ')*$#i'; |
||
| 27 | return preg_match($regex, $value) ? true : false; |
||
| 28 | } |
||
| 55 |