| Conditions | 3 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | 40 | public function validate(mixed $value, Constraint $constraint): void |
|
| 36 | { |
||
| 37 | 40 | if ($value instanceof UserInterface |
|
| 38 | 40 | && !$this->repository->isEmailAvailable($value->getEmail(), $value->getId()) |
|
| 39 | ) { |
||
| 40 | 1 | $this->context |
|
| 41 | 1 | ->buildViolation(UniqueEmail::MESSAGE) |
|
| 42 | 1 | ->setCode(UniqueEmail::IS_UNIQUE_EMAIL_ERROR) |
|
| 43 | 1 | ->addViolation(); |
|
| 44 | } |
||
| 47 |