| Total Complexity | 1 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class Username extends AbstractRule |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Check if the given value is a valid username |
||
| 18 | * |
||
| 19 | * Pattern for "valid" username |
||
| 20 | * - only alpha-numeric (a-z, A-Z, 0-9), underscore and minus |
||
| 21 | * - starts with an letter (alpha) |
||
| 22 | * - underscores and minus are not allowed at the beginning or end |
||
| 23 | * - multiple underscores and minus are not allowed (-- or _____) |
||
| 24 | * |
||
| 25 | * @credit <a href="https://github.com/Intervention/validation">Intervention/validation - \Intervention\Validation\Rules\Username</a> |
||
| 26 | * |
||
| 27 | * @param mixed $value |
||
| 28 | */ |
||
| 29 | public function check($value): bool |
||
| 34 |