| Total Complexity | 4 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class DatabaseTokenRepository implements TokenRepositoryContract |
||
| 14 | { |
||
| 15 | public function retrieveByCipherText(string $cipherText): ?OtpToken |
||
| 16 | { |
||
| 17 | $result = DB::table('otp_tokens')->where('cipher_text', $cipherText)->first(); |
||
| 18 | |||
| 19 | return $result ? $this->createOtpToken($result) : null; |
||
| 20 | } |
||
| 21 | |||
| 22 | public function persist(OtpToken $token): bool |
||
| 29 | ); |
||
| 30 | } |
||
| 31 | |||
| 32 | private function createOtpToken(object $result): OtpToken |
||
| 44 |