| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function __invoke(AddUserCommand $command) |
||
| 32 | { |
||
| 33 | $userId = UserId::generate($command->userId()); |
||
| 34 | $user = $this->repository->userOfId($userId); |
||
| 35 | if ($user instanceof User) { |
||
| 36 | throw new UserAlreadyExistsException($user->id()); |
||
| 37 | } |
||
| 38 | |||
| 39 | $this->repository->persist( |
||
| 40 | new User($userId) |
||
| 41 | ); |
||
| 42 | } |
||
| 43 | } |
||
| 44 |