1 | <?php |
||
21 | class EventDispatcher |
||
|
|||
22 | { |
||
23 | /** |
||
24 | * @var EventDispatcherInterface |
||
25 | */ |
||
26 | private $eventDispatcher; |
||
27 | |||
28 | /** |
||
29 | * @param EventDispatcherInterface $eventDispatcher |
||
30 | */ |
||
31 | 7 | public function __construct(EventDispatcherInterface $eventDispatcher) |
|
32 | { |
||
33 | 7 | $this->eventDispatcher = $eventDispatcher; |
|
34 | 7 | } |
|
35 | |||
36 | /** |
||
37 | * @param string $purpose |
||
38 | * @param string $value |
||
39 | * @param array $payload |
||
40 | * |
||
41 | * @return CreateTokenEvent |
||
42 | */ |
||
43 | 1 | public function createToken($purpose, $value, array $payload) |
|
52 | |||
53 | /** |
||
54 | * @param Token $token |
||
55 | * |
||
56 | * @return TokenCreatedEvent |
||
57 | */ |
||
58 | 1 | public function tokenCreated(Token $token) |
|
67 | |||
68 | /** |
||
69 | * @param Token $token |
||
70 | * @param DateTime|null $at |
||
71 | * @param array $information |
||
72 | * |
||
73 | * @return ConsumeTokenEvent |
||
74 | */ |
||
75 | 1 | public function consumeToken(Token $token, DateTime $at = null, array $information = []) |
|
84 | |||
85 | /** |
||
86 | * @param Token $token |
||
87 | * |
||
88 | * @return TokenConsumedEvent |
||
89 | */ |
||
90 | 1 | public function tokenConsumed(Token $token) |
|
99 | |||
100 | /** |
||
101 | * @param Token $token |
||
102 | * |
||
103 | * @return TokenTotallyConsumedEvent |
||
104 | */ |
||
105 | 1 | public function tokenTotallyConsumed(Token $token) |
|
114 | |||
115 | /** |
||
116 | * @param string $purpose |
||
117 | * @param string $value |
||
118 | * |
||
119 | * @return TokenNotFoundEvent |
||
120 | */ |
||
121 | 1 | public function tokenNotFound($purpose, $value) |
|
130 | |||
131 | /** |
||
132 | * @param string $purpose |
||
133 | * @param string $value |
||
134 | * |
||
135 | * @return TokenExpiredEvent |
||
136 | */ |
||
137 | 1 | public function tokenExpired($purpose, $value) |
|
146 | |||
147 | /** |
||
148 | * @param string $purpose |
||
149 | * @param string $value |
||
150 | * |
||
151 | * @return TokenAlreadyConsumedEvent |
||
152 | */ |
||
153 | 1 | public function tokenAlreadyConsumed($purpose, $value) |
|
162 | |||
163 | /** |
||
164 | * @param Token $token |
||
165 | * |
||
166 | * @return TokenRetrievedEvent |
||
167 | */ |
||
168 | 1 | public function tokenRetrieved(Token $token) |
|
177 | } |
||
178 |