| Conditions | 3 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function __invoke(EditOrganizationCommand $command) |
||
| 33 | { |
||
| 34 | $organization = $this->repository->organizationOfId( |
||
| 35 | OrganizationId::generate( |
||
| 36 | $command->id() |
||
| 37 | ) |
||
| 38 | ); |
||
| 39 | if (null === $organization) { |
||
| 40 | throw new OrganizationDoesNotExistException(); |
||
| 41 | } |
||
| 42 | $organization->edit( |
||
| 43 | new OrganizationName( |
||
| 44 | $command->name() |
||
| 45 | ), |
||
| 46 | new Slug( |
||
| 47 | null === $command->slug() ? $command->name() : $command->slug() |
||
| 48 | ) |
||
| 49 | ); |
||
| 50 | $this->repository->persist($organization); |
||
| 51 | } |
||
| 52 | } |
||
| 53 |