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 | * 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 | * Send a password reset link to a user. |
||
55 | * |
||
56 | * @param array $credentials |
||
57 | * @param \Closure|null $callback |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | public function sendResetLink(array $credentials, Closure $callback = null) |
||
81 | |||
82 | /** |
||
83 | * Reset the password for the given token. |
||
84 | * |
||
85 | * @param array $credentials |
||
86 | * @param \Closure $callback |
||
87 | * |
||
88 | * @return mixed |
||
89 | */ |
||
90 | public function reset(array $credentials, Closure $callback) |
||
110 | |||
111 | /** |
||
112 | * Get the user for the given credentials. |
||
113 | * |
||
114 | * @param array $credentials |
||
115 | * |
||
116 | * @throws \UnexpectedValueException |
||
117 | * |
||
118 | * @return \Rinvex\Auth\Contracts\CanResetPasswordContract|null |
||
119 | */ |
||
120 | public function getUser(array $credentials): ?CanResetPasswordContract |
||
130 | |||
131 | /** |
||
132 | * Create a new password reset token for the given user. |
||
133 | * |
||
134 | * @param \Rinvex\Auth\Contracts\CanResetPasswordContract $user |
||
135 | * @param int $expiration |
||
136 | * |
||
137 | * @return string |
||
138 | */ |
||
139 | public function createToken(CanResetPasswordContract $user, $expiration): string |
||
145 | |||
146 | /** |
||
147 | * Validate the given password reset token. |
||
148 | * |
||
149 | * @param \Rinvex\Auth\Contracts\CanResetPasswordContract $user |
||
150 | * @param array $credentials |
||
151 | * |
||
152 | * @return bool |
||
153 | */ |
||
154 | public function validateToken(CanResetPasswordContract $user, array $credentials): bool |
||
160 | |||
161 | /** |
||
162 | * Validate the given expiration timestamp. |
||
163 | * |
||
164 | * @param int $expiration |
||
165 | * |
||
166 | * @return bool |
||
167 | */ |
||
168 | public function validateTimestamp($expiration): bool |
||
172 | |||
173 | /** |
||
174 | * Return the application key. |
||
175 | * |
||
176 | * @return string |
||
177 | */ |
||
178 | public function getKey(): string |
||
186 | |||
187 | /** |
||
188 | * Returns the payload string containing. |
||
189 | * |
||
190 | * @param \Rinvex\Auth\Contracts\CanResetPasswordContract $user |
||
191 | * @param string $email |
||
192 | * @param int $expiration |
||
193 | * |
||
194 | * @return string |
||
195 | */ |
||
196 | protected function buildPayload(CanResetPasswordContract $user, $email, $expiration): string |
||
205 | |||
206 | /** |
||
207 | * Validate a password reset for the given credentials. |
||
208 | * |
||
209 | * @param array $credentials |
||
210 | * |
||
211 | * @return \Illuminate\Contracts\Auth\CanResetPassword|string |
||
212 | */ |
||
213 | protected function validateReset(array $credentials) |
||
229 | } |
||
230 |
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: