Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public function handle(MarkAuthorizationCodeAsRevoked $command): void |
||
32 | { |
||
33 | $authorizationCode = $this->authorizationCodeRepository->find($command->getAuthorizationCodeId()); |
||
34 | if (!$authorizationCode) { |
||
35 | throw new \InvalidArgumentException(\sprintf('The authorization code with ID "%s" does not exist.', $command->getAuthorizationCodeId()->getValue())); |
||
36 | } |
||
37 | |||
38 | $authorizationCode->markAsRevoked(); |
||
39 | $this->authorizationCodeRepository->save($authorizationCode); |
||
40 | $event = new AuthorizationCodeMarkedAsRevokedEvent( |
||
41 | $command->getAuthorizationCodeId() |
||
42 | ); |
||
43 | $this->eventBus->handle($event); |
||
44 | } |
||
45 | } |
||
46 |