1 | <?php |
||
28 | class EmailVerificationBroker implements EmailVerificationBrokerContract |
||
29 | { |
||
30 | /** |
||
31 | * The verification token repository. |
||
32 | * |
||
33 | * @var \Rinvex\Fort\Contracts\EmailVerificationTokenRepositoryContract |
||
34 | */ |
||
35 | protected $tokens; |
||
36 | |||
37 | /** |
||
38 | * The user provider implementation. |
||
39 | * |
||
40 | * @var \Illuminate\Contracts\Auth\UserProvider |
||
41 | */ |
||
42 | protected $users; |
||
43 | |||
44 | /** |
||
45 | * Create a new verification broker instance. |
||
46 | * |
||
47 | * @param \Rinvex\Fort\Contracts\EmailVerificationTokenRepositoryContract $tokens |
||
48 | * @param \Illuminate\Contracts\Auth\UserProvider $users |
||
49 | */ |
||
50 | public function __construct(EmailVerificationTokenRepositoryContract $tokens, UserProvider $users) |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function sendVerificationLink(array $credentials) |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function verify(array $credentials, Closure $callback) |
||
111 | |||
112 | /** |
||
113 | * Get the user for the given credentials. |
||
114 | * |
||
115 | * @param array $credentials |
||
116 | * |
||
117 | * @throws \UnexpectedValueException |
||
118 | * |
||
119 | * @return \Rinvex\Fort\Contracts\CanVerifyEmailContract |
||
120 | */ |
||
121 | public function getUser(array $credentials) |
||
133 | |||
134 | /** |
||
135 | * Create a new email verification token for the given user. |
||
136 | * |
||
137 | * @param \Rinvex\Fort\Contracts\CanVerifyEmailContract $user |
||
138 | * |
||
139 | * @return string |
||
140 | */ |
||
141 | public function createToken(CanVerifyEmailContract $user) |
||
145 | |||
146 | /** |
||
147 | * Delete email verification tokens of the given user. |
||
148 | * |
||
149 | * @param \Rinvex\Fort\Contracts\CanVerifyEmailContract $user |
||
150 | * |
||
151 | * @return void |
||
152 | */ |
||
153 | public function deleteToken(CanVerifyEmailContract $user) |
||
157 | |||
158 | /** |
||
159 | * Validate the given verification token. |
||
160 | * |
||
161 | * @param \Rinvex\Fort\Contracts\CanVerifyEmailContract $user |
||
162 | * @param string $token |
||
163 | * |
||
164 | * @return bool |
||
165 | */ |
||
166 | public function tokenExists(CanVerifyEmailContract $user, $token) |
||
170 | |||
171 | /** |
||
172 | * Get the verification token repository implementation. |
||
173 | * |
||
174 | * @return \Rinvex\Fort\Contracts\EmailVerificationTokenRepositoryContract |
||
175 | */ |
||
176 | public function getRepository() |
||
180 | |||
181 | /** |
||
182 | * Validate an email verification for the given credentials. |
||
183 | * |
||
184 | * @param array $credentials |
||
185 | * |
||
186 | * @return \Rinvex\Fort\Contracts\CanVerifyEmailContract|string |
||
187 | */ |
||
188 | protected function validateVerification(array $credentials) |
||
200 | } |
||
201 |
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: