| Total Complexity | 2 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | #[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)] |
||
| 29 | class UniqueUsername extends Constraint |
||
| 30 | { |
||
| 31 | final public const IS_UNIQUE_USERNAME_ERROR = 'ea62740a-4d9b-4a25-9a56-46fb4c3d5fea'; |
||
| 32 | final public const MESSAGE = 'This username is already taken.'; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * {@inheritdoc} |
||
| 36 | * |
||
| 37 | * @psalm-var array<string, string> |
||
| 38 | */ |
||
| 39 | protected const ERROR_NAMES = [ |
||
| 40 | self::IS_UNIQUE_USERNAME_ERROR => 'IS_UNIQUE_USERNAME_ERROR', |
||
| 41 | ]; |
||
| 42 | |||
| 43 | 39 | public function getTargets(): string |
|
| 54 |