| Total Complexity | 4 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class TokenBroker implements TokenBrokerInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var TokenRepositoryInterface |
||
| 12 | */ |
||
| 13 | protected $tokenRepository; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Create a new token broker instance. |
||
| 17 | * |
||
| 18 | * @param TokenRepositoryInterface $tokenRepository |
||
| 19 | */ |
||
| 20 | public function __construct(TokenRepositoryInterface $tokenRepository) |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * {@inheritdoc} |
||
| 27 | */ |
||
| 28 | public function sendToken(MustVerifyMobile $user): void |
||
| 29 | { |
||
| 30 | $user->sendMobileVerifierNotification( |
||
| 31 | $this->tokenRepository->create($user) |
||
| 32 | ); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * {@inheritdoc} |
||
| 37 | */ |
||
| 38 | public function verifyToken(MustVerifyMobile $user, $token): bool |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param MustVerifyMobile $user |
||
| 51 | * @param $token |
||
| 52 | * |
||
| 53 | * @return bool |
||
| 54 | */ |
||
| 55 | protected function tokenExists(MustVerifyMobile $user, $token): bool |
||
| 60 |