TokensRepository.php 433 Bytes
Newer Older
Jacob Priddy's avatar
Jacob Priddy committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php


namespace Source\Gateways\Tokens;


use Source\Entities\Token;
use Source\Exceptions\EntityNotFoundException;

interface TokensRepository {
    /**
     * @param Token  $token
     * @return Token
     * @throws EntityNotFoundException
     */
    public function create(Token $token): Token;

    /**
     * @param string $token
Jacob Priddy's avatar
Jacob Priddy committed
20
     * @return Token|null
Jacob Priddy's avatar
Jacob Priddy committed
21
     */
Jacob Priddy's avatar
Jacob Priddy committed
22
    public function findValidToken(string $token): ?Token;
Jacob Priddy's avatar
Jacob Priddy committed
23
}