1 | <?php |
||
16 | class PasswordResetBroker implements PasswordResetBrokerContract |
||
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 | * The custom password validator callback. |
||
41 | * |
||
42 | * @var \Closure |
||
43 | */ |
||
44 | protected $passwordValidator; |
||
45 | |||
46 | /** |
||
47 | * Create a new verification broker instance. |
||
48 | * |
||
49 | * @param \Illuminate\Contracts\Auth\UserProvider $users |
||
50 | * @param string $key |
||
51 | * @param int $expiration |
||
52 | */ |
||
53 | public function __construct(UserProvider $users, $key, $expiration) |
||
59 | |||
60 | /** |
||
61 | * Send a password reset link to a user. |
||
62 | * |
||
63 | * @param array $credentials |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | public function sendResetLink(array $credentials) |
||
87 | |||
88 | /** |
||
89 | * Reset the password for the given token. |
||
90 | * |
||
91 | * @param array $credentials |
||
92 | * @param \Closure $callback |
||
93 | * |
||
94 | * @return mixed |
||
95 | */ |
||
96 | public function reset(array $credentials, Closure $callback) |
||
116 | |||
117 | /** |
||
118 | * Set a custom password validator. |
||
119 | * |
||
120 | * @param \Closure $callback |
||
121 | * |
||
122 | * @return void |
||
123 | */ |
||
124 | public function validator(Closure $callback) |
||
128 | |||
129 | /** |
||
130 | * Determine if the passwords match for the request. |
||
131 | * |
||
132 | * @param array $credentials |
||
133 | * |
||
134 | * @return bool |
||
135 | */ |
||
136 | public function validateNewPassword(array $credentials) |
||
151 | |||
152 | /** |
||
153 | * Determine if the passwords are valid for the request. |
||
154 | * |
||
155 | * @param array $credentials |
||
156 | * |
||
157 | * @return bool |
||
158 | */ |
||
159 | protected function validatePasswordWithDefaults(array $credentials) |
||
168 | |||
169 | /** |
||
170 | * Get the user for the given credentials. |
||
171 | * |
||
172 | * @param array $credentials |
||
173 | * |
||
174 | * @throws \UnexpectedValueException |
||
175 | * |
||
176 | * @return \Rinvex\Fort\Contracts\CanResetPasswordContract |
||
177 | */ |
||
178 | public function getUser(array $credentials) |
||
188 | |||
189 | /** |
||
190 | * Create a new password reset token for the given user. |
||
191 | * |
||
192 | * @param \Rinvex\Fort\Contracts\CanResetPasswordContract $user |
||
193 | * @param int $expiration |
||
194 | * |
||
195 | * @return string |
||
196 | */ |
||
197 | public function createToken(CanResetPasswordContract $user, $expiration) |
||
203 | |||
204 | /** |
||
205 | * Validate the given password reset token. |
||
206 | * |
||
207 | * @param \Rinvex\Fort\Contracts\CanResetPasswordContract $user |
||
208 | * @param array $credentials |
||
209 | * |
||
210 | * @return bool |
||
211 | */ |
||
212 | public function validateToken(CanResetPasswordContract $user, array $credentials) |
||
218 | |||
219 | /** |
||
220 | * Validate the given expiration timestamp. |
||
221 | * |
||
222 | * @param int $expiration |
||
223 | * |
||
224 | * @return bool |
||
225 | */ |
||
226 | public function validateTimestamp($expiration) |
||
230 | |||
231 | /** |
||
232 | * Return the application key. |
||
233 | * |
||
234 | * @return string |
||
235 | */ |
||
236 | public function getKey() |
||
244 | |||
245 | /** |
||
246 | * Returns the payload string containing. |
||
247 | * |
||
248 | * @param \Rinvex\Fort\Contracts\CanResetPasswordContract $user |
||
249 | * @param string $email |
||
250 | * @param int $expiration |
||
251 | * |
||
252 | * @return string |
||
253 | */ |
||
254 | protected function buildPayload(CanResetPasswordContract $user, $email, $expiration) |
||
263 | |||
264 | /** |
||
265 | * Validate a password reset for the given credentials. |
||
266 | * |
||
267 | * @param array $credentials |
||
268 | * |
||
269 | * @return \Illuminate\Contracts\Auth\CanResetPassword|string |
||
270 | */ |
||
271 | protected function validateReset(array $credentials) |
||
291 | } |
||
292 |
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: