Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function __invoke(EditSettings $command): void |
||
30 | { |
||
31 | $settingsToUpdate = $this->repository->findOneByUuid($command->uuid()); |
||
32 | |||
33 | if (null === $settingsToUpdate) { |
||
34 | throw new \DomainException('Settings provided does not exist!'); |
||
35 | } |
||
36 | |||
37 | $settings = $settingsToUpdate |
||
38 | ->changeCurrency($command->currency()->getValue()) |
||
39 | ->changeLocale($command->locale()->getValue()) |
||
40 | ; |
||
41 | |||
42 | $this->repository->add($settings); |
||
43 | } |
||
45 |