| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function handle(CreateAccessToken $command): void |
||
| 32 | { |
||
| 33 | $accessToken = $this->accessTokenRepository->find($command->getAccessTokenId()); |
||
| 34 | if (!$accessToken) { |
||
| 35 | throw new \InvalidArgumentException(\sprintf('The access token with ID "%s" does not exist.', $command->getAccessTokenId()->getValue())); |
||
| 36 | } |
||
| 37 | |||
| 38 | $accessToken->markAsRevoked(); |
||
| 39 | $this->accessTokenRepository->save($accessToken); |
||
| 40 | $event = new AccessTokenRevokedEvent($command->getAccessTokenId()); |
||
| 41 | $this->eventBus->handle($event); |
||
| 42 | } |
||
| 43 | } |
||
| 44 |