1 | <?php |
||
14 | class TokenManager implements TokenManagerInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var TokenFactoryInterface |
||
18 | */ |
||
19 | private $factory; |
||
20 | |||
21 | /** |
||
22 | * @var TokenRepositoryInterface |
||
23 | */ |
||
24 | private $repository; |
||
25 | |||
26 | /** |
||
27 | * @var InformationGuesserInterface |
||
28 | */ |
||
29 | private $informationGuesser; |
||
30 | |||
31 | /** |
||
32 | * @var UserManagerInterface |
||
33 | */ |
||
34 | private $userManager; |
||
35 | |||
36 | /** |
||
37 | * @param TokenFactoryInterface $factory |
||
38 | * @param TokenRepositoryInterface $repository |
||
39 | * @param InformationGuesserInterface $informationGuesser |
||
40 | * @param UserManagerInterface $userManager |
||
41 | */ |
||
42 | 4 | public function __construct( |
|
53 | |||
54 | /** |
||
55 | * @inheritdoc |
||
56 | */ |
||
57 | 1 | public function get($purpose, $value) |
|
61 | |||
62 | /** |
||
63 | * @inheritdoc |
||
64 | */ |
||
65 | 1 | public function create($purpose, $user, array $payload = []) |
|
75 | |||
76 | /** |
||
77 | * @inheritdoc |
||
78 | */ |
||
79 | 1 | public function setUsed(Token $token, DateTime $at = null) |
|
89 | |||
90 | /** |
||
91 | * @inheritDoc |
||
92 | */ |
||
93 | 1 | public function consume(Token $token, DateTime $at = null) |
|
99 | |||
100 | /** |
||
101 | * @inheritdoc |
||
102 | */ |
||
103 | 1 | public function getUser(Token $token) |
|
107 | } |
||
108 |
If you suppress an error, we recommend checking for the error condition explicitly: