| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 2 | public function isUserExistsByUsername(string $username, UserRepository $repository) |
|
| 21 | { |
||
| 22 | 2 | $isUserExists = $repository->isUserExists([ |
|
| 23 | 2 | 'username' => $username, |
|
| 24 | ]); |
||
| 25 | |||
| 26 | 2 | if ($isUserExists === true) { |
|
| 27 | 1 | return new JsonResponse(); |
|
| 28 | } |
||
| 29 | |||
| 30 | 1 | return new JsonResponse([], 404); |
|
| 31 | } |
||
| 32 | |||
| 53 | } |