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