| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 2 | public function __invoke(CreateIdentity $wished): void |
|
| 24 | { |
||
| 25 | 2 | $identities = $this->repository->matching( |
|
| 26 | 2 | new Email($wished->email()) |
|
| 27 | ); |
||
| 28 | |||
| 29 | 2 | if ($identities->size() > 0) { |
|
| 30 | 1 | throw new IdentityAlreadyExist($wished->email()); |
|
| 31 | } |
||
| 32 | |||
| 33 | 1 | $this->repository->add( |
|
| 34 | 1 | Identity::create( |
|
| 35 | 1 | $wished->identity(), |
|
| 36 | 1 | $wished->email(), |
|
| 37 | 1 | $wished->password() |
|
| 38 | ) |
||
| 42 |