1 | <?php |
||
16 | class EmailVerificationBroker implements EmailVerificationBrokerContract |
||
17 | { |
||
18 | /** |
||
19 | * The application key. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $key; |
||
24 | |||
25 | /** |
||
26 | * The user provider implementation. |
||
27 | * |
||
28 | * @var \Illuminate\Contracts\Auth\UserProvider |
||
29 | */ |
||
30 | protected $users; |
||
31 | |||
32 | /** |
||
33 | * The number of minutes that the reset token should be considered valid. |
||
34 | * |
||
35 | * @var int |
||
36 | */ |
||
37 | protected $expiration; |
||
38 | |||
39 | /** |
||
40 | * Create a new verification broker instance. |
||
41 | * |
||
42 | * @param \Illuminate\Contracts\Auth\UserProvider $users |
||
43 | * @param string $key |
||
44 | * @param int $expiration |
||
45 | */ |
||
46 | public function __construct(UserProvider $users, $key, $expiration) |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | public function sendVerificationLink(array $credentials): string |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function verify(array $credentials, Closure $callback) |
||
96 | |||
97 | /** |
||
98 | * Get the user for the given credentials. |
||
99 | * |
||
100 | * @param array $credentials |
||
101 | * |
||
102 | * @throws \UnexpectedValueException |
||
103 | * |
||
104 | * @return \Rinvex\Auth\Contracts\CanVerifyEmailContract|null |
||
105 | */ |
||
106 | public function getUser(array $credentials): ?CanVerifyEmailContract |
||
116 | |||
117 | /** |
||
118 | * Create a new email verification token for the given user. |
||
119 | * |
||
120 | * @param \Rinvex\Auth\Contracts\CanVerifyEmailContract $user |
||
121 | * @param int $expiration |
||
122 | * |
||
123 | * @return string |
||
124 | */ |
||
125 | public function createToken(CanVerifyEmailContract $user, $expiration): string |
||
131 | |||
132 | /** |
||
133 | * Validate the given email verification token. |
||
134 | * |
||
135 | * @param \Rinvex\Auth\Contracts\CanVerifyEmailContract $user |
||
136 | * @param array $credentials |
||
137 | * |
||
138 | * @return bool |
||
139 | */ |
||
140 | public function validateToken(CanVerifyEmailContract $user, array $credentials): bool |
||
146 | |||
147 | /** |
||
148 | * Validate the given expiration timestamp. |
||
149 | * |
||
150 | * @param int $expiration |
||
151 | * |
||
152 | * @return bool |
||
153 | */ |
||
154 | public function validateTimestamp($expiration): bool |
||
158 | |||
159 | /** |
||
160 | * Return the application key. |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | public function getKey(): string |
||
172 | |||
173 | /** |
||
174 | * Returns the payload string containing. |
||
175 | * |
||
176 | * @param \Rinvex\Auth\Contracts\CanVerifyEmailContract $user |
||
177 | * @param string $email |
||
178 | * @param int $expiration |
||
179 | * |
||
180 | * @return string |
||
181 | */ |
||
182 | protected function buildPayload(CanVerifyEmailContract $user, $email, $expiration): string |
||
191 | |||
192 | /** |
||
193 | * Validate an email verification for the given credentials. |
||
194 | * |
||
195 | * @param array $credentials |
||
196 | * |
||
197 | * @return \Rinvex\Auth\Contracts\CanVerifyEmailContract|string |
||
198 | */ |
||
199 | protected function validateVerification(array $credentials) |
||
215 | } |
||
216 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: