| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function handle(ChangeClientParameter $command): void |
||
| 32 | { |
||
| 33 | $client = $this->clientRepository->find($command->getClientId()); |
||
| 34 | if (!$client) { |
||
| 35 | throw new \InvalidArgumentException(\sprintf('The client with ID "%s" does not exist.', $command->getClientId()->getValue())); |
||
| 36 | } |
||
| 37 | |||
| 38 | $client->setParameter( |
||
| 39 | $command->getParameter() |
||
| 40 | ); |
||
| 41 | $this->clientRepository->save($client); |
||
| 42 | $event = new ClientParameterChangedEvent( |
||
| 43 | $command->getClientId(), |
||
| 44 | $command->getParameter() |
||
| 45 | ); |
||
| 46 | $this->eventBus->handle($event); |
||
| 47 | } |
||
| 48 | } |
||
| 49 |