1 | <?php |
||
14 | class AuthHandler |
||
15 | { |
||
16 | /** |
||
17 | * @var int |
||
18 | */ |
||
19 | private $type; |
||
20 | /** |
||
21 | * @var User |
||
22 | */ |
||
23 | private $user; |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $email; |
||
28 | /** |
||
29 | * @var bool |
||
30 | */ |
||
31 | private $verified = false; |
||
32 | /** |
||
33 | * @var bool |
||
34 | */ |
||
35 | private $exist = false; |
||
36 | /** |
||
37 | * @var ClientInterface |
||
38 | */ |
||
39 | private $client; |
||
40 | |||
41 | 8 | public function __construct(ClientInterface $client) |
|
46 | |||
47 | /** |
||
48 | * @SuppressWarnings(PHPMD.ElseExpression) |
||
49 | */ |
||
50 | 8 | public function handle() |
|
75 | |||
76 | 8 | public function getUser() |
|
80 | |||
81 | 8 | public function getEmail() |
|
85 | |||
86 | 8 | public function isExist() |
|
90 | |||
91 | 8 | public function isVerified() |
|
95 | |||
96 | /** |
||
97 | * Find user by provider |
||
98 | * |
||
99 | * @param string $token password reset token |
||
100 | * @return app\models\User|null |
||
101 | */ |
||
102 | 8 | private function findUserByProvider() |
|
115 | |||
116 | /** |
||
117 | * Parse provider |
||
118 | * |
||
119 | * @return array |
||
120 | */ |
||
121 | 8 | private function parseProvider() |
|
143 | |||
144 | /** |
||
145 | * Parse profile |
||
146 | * |
||
147 | * @return array |
||
148 | */ |
||
149 | 8 | private function parseProfile() |
|
169 | |||
170 | /** |
||
171 | * Prepare provider attributes for facebook |
||
172 | * |
||
173 | * @return array |
||
174 | */ |
||
175 | 1 | private function parseProviderFacebook($profile, $token) |
|
184 | |||
185 | /** |
||
186 | * Prepare provider attributes for vkontakte |
||
187 | * |
||
188 | * @return array |
||
189 | */ |
||
190 | 6 | private function parseProviderVkontakte($profile, $token) |
|
199 | |||
200 | /** |
||
201 | * Prepare provider attributes for twitter |
||
202 | * |
||
203 | * @return array |
||
204 | */ |
||
205 | 1 | private function parseProviderTwitter($profile, $token) |
|
214 | |||
215 | /** |
||
216 | * Prepare profile attributes for facebook |
||
217 | * |
||
218 | * @return array |
||
219 | */ |
||
220 | 1 | private function parseProfileFacebook($profile) |
|
228 | |||
229 | /** |
||
230 | * Prepare profile attributes for vkontakte |
||
231 | * |
||
232 | * @return array |
||
233 | */ |
||
234 | 6 | private function parseProfileVkontakte($profile) |
|
245 | |||
246 | /** |
||
247 | * Prepare profile attributes for twitter |
||
248 | * |
||
249 | * @param array $data Data from social network |
||
250 | * @return array |
||
251 | */ |
||
252 | 1 | private function parseProfileTwitter($profile) |
|
260 | } |
||
261 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: