1 | <?php |
||
13 | class SocialAuth |
||
14 | { |
||
15 | /** |
||
16 | * @var int |
||
17 | */ |
||
18 | private $type; |
||
19 | /** |
||
20 | * @var User |
||
21 | */ |
||
22 | private $user; |
||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | private $email; |
||
27 | /** |
||
28 | * @var bool |
||
29 | */ |
||
30 | private $isVerified = false; |
||
31 | /** |
||
32 | * @var bool |
||
33 | */ |
||
34 | private $isExist = false; |
||
35 | /** |
||
36 | * @var ClientInterface |
||
37 | */ |
||
38 | private $client; |
||
39 | |||
40 | public function __construct(ClientInterface $client) |
||
45 | |||
46 | /** |
||
47 | * @SuppressWarnings(PHPMD.ElseExpression) |
||
48 | */ |
||
49 | public function execute() |
||
78 | |||
79 | public function user() |
||
83 | |||
84 | public function email() |
||
88 | |||
89 | public function isExist() |
||
93 | |||
94 | public function isVerified() |
||
98 | |||
99 | /** |
||
100 | * Find user by provider |
||
101 | * |
||
102 | * @return app\models\User|null |
||
103 | */ |
||
104 | private function findUserByProvider() |
||
117 | |||
118 | /** |
||
119 | * Parse provider |
||
120 | * |
||
121 | * @return array |
||
122 | */ |
||
123 | private function parseProvider() |
||
145 | |||
146 | /** |
||
147 | * Parse profile |
||
148 | * |
||
149 | * @return array |
||
150 | */ |
||
151 | private function parseProfile() |
||
171 | |||
172 | /** |
||
173 | * Prepare provider attributes for facebook |
||
174 | * |
||
175 | * @param array $profile |
||
176 | * @param array $token |
||
177 | * @return array |
||
178 | */ |
||
179 | private function parseProviderFacebook($profile, $token) |
||
188 | |||
189 | /** |
||
190 | * Prepare provider attributes for vkontakte |
||
191 | * |
||
192 | * @param array $profile |
||
193 | * @param array $token |
||
194 | * @return array |
||
195 | */ |
||
196 | private function parseProviderVkontakte($profile, $token) |
||
205 | |||
206 | /** |
||
207 | * Prepare provider attributes for twitter |
||
208 | * |
||
209 | * @param array $profile |
||
210 | * @param array $token |
||
211 | * @return array |
||
212 | */ |
||
213 | private function parseProviderTwitter($profile, $token) |
||
222 | |||
223 | /** |
||
224 | * Prepare profile attributes for facebook |
||
225 | * |
||
226 | * @param array $profile |
||
227 | * @return array |
||
228 | */ |
||
229 | private function parseProfileFacebook($profile) |
||
237 | |||
238 | /** |
||
239 | * Prepare profile attributes for vkontakte |
||
240 | * |
||
241 | * @param array $profile |
||
242 | * @return array |
||
243 | */ |
||
244 | private function parseProfileVkontakte($profile) |
||
255 | |||
256 | /** |
||
257 | * Prepare profile attributes for twitter |
||
258 | * |
||
259 | * @param array $profile |
||
260 | * @return array |
||
261 | */ |
||
262 | private function parseProfileTwitter($profile) |
||
270 | } |
||
271 |
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: