1 | <?php |
||
14 | class AzineHybridAuth |
||
15 | { |
||
16 | /** |
||
17 | * ID of the sessionDataCookie. |
||
18 | */ |
||
19 | const cookieName = 'azine_hybridauth_session'; |
||
20 | |||
21 | /** |
||
22 | * @var ObjectManager |
||
23 | */ |
||
24 | private $objectManager; |
||
25 | |||
26 | /** |
||
27 | * @var UserInterface |
||
28 | */ |
||
29 | private $currentUser; |
||
30 | |||
31 | /** |
||
32 | * @var bool |
||
33 | */ |
||
34 | private $storeForUser; |
||
35 | |||
36 | /** |
||
37 | * @var bool |
||
38 | */ |
||
39 | private $storeAsCookie; |
||
40 | |||
41 | /** |
||
42 | * @var int |
||
43 | */ |
||
44 | private $expiresInDays; |
||
45 | |||
46 | /** |
||
47 | * Configured Instances of HybridAuth. |
||
48 | * |
||
49 | * @var array or HybridAuth |
||
50 | */ |
||
51 | private $instances = array(); |
||
52 | |||
53 | /** |
||
54 | * HybridAuth configuration. |
||
55 | * |
||
56 | * @var array |
||
57 | */ |
||
58 | private $config; |
||
59 | |||
60 | /** |
||
61 | * @param UrlGeneratorInterface $router |
||
62 | * @param TokenStorageInterface $tokenStorage |
||
63 | * @param ObjectManager $manager |
||
64 | * @param array $config |
||
65 | * @param bool $storeForUser |
||
66 | * @param $storeAsCookie |
||
67 | 2 | * @param $expiresInDays |
|
68 | 2 | */ |
|
69 | 2 | public function __construct(UrlGeneratorInterface $router, TokenStorageInterface $tokenStorage, ObjectManager $manager, $config, $storeForUser, $storeAsCookie, $expiresInDays) |
|
83 | |||
84 | /** |
||
85 | * Get a Hybrid_Auth instance initialised for the given provider. |
||
86 | * HybridAuthSessions will be restored from DB and/or cookies, according to the bundle configuration. |
||
87 | * |
||
88 | * @param $cookieSessionData |
||
89 | * @param $provider |
||
90 | * |
||
91 | * @return \Hybrid_Auth |
||
92 | */ |
||
93 | public function getInstance($cookieSessionData, $provider) |
||
140 | |||
141 | /** |
||
142 | * @param Request $request |
||
143 | * @param $provider |
||
144 | * @param $sessionData |
||
145 | * |
||
146 | * @return Cookie | null |
||
147 | */ |
||
148 | public function storeHybridAuthSessionData(Request $request, $provider, $sessionData) |
||
158 | |||
159 | /** |
||
160 | * Delete the HybridAuthSessionData entity from the database. |
||
161 | * |
||
162 | * @param $provider |
||
163 | */ |
||
164 | public function deleteSession($provider) |
||
174 | |||
175 | /** |
||
176 | * Save as HybridAuthSessionData entity to the database. |
||
177 | * Checks the bundle configuration before saving. |
||
178 | * |
||
179 | * @param $sessionData |
||
180 | * @param $provider |
||
181 | */ |
||
182 | private function saveAuthSessionData($sessionData, $provider) |
||
201 | |||
202 | public function getCookieName($provider) |
||
206 | |||
207 | /** |
||
208 | * Use this function to get access to a HybridAuthProvider. |
||
209 | * |
||
210 | * Calling this method will log the user in (make a roundtrip to the providers site and back to your site again) |
||
211 | * and call the page again that you came from. |
||
212 | * |
||
213 | * When logged (allready) it will return the hybridAuth provider. |
||
214 | * |
||
215 | * @param $authSessionData |
||
216 | * @param string $provider_id |
||
217 | * @param bool $require_login |
||
218 | * |
||
219 | * @return \Hybrid_Provider_Model |
||
220 | */ |
||
221 | public function getProvider($authSessionData, $provider_id, $require_login = true) |
||
230 | |||
231 | /** |
||
232 | * Check if the current user has allowed access to the given provider. |
||
233 | * |
||
234 | * @param Request $request |
||
235 | * @param string $provider_id |
||
236 | * |
||
237 | * @return bool true if access to the provider is granted for this app |
||
238 | */ |
||
239 | public function isConnected(Request $request, $provider_id) |
||
247 | |||
248 | /** |
||
249 | * Get the Xing Adapter. |
||
250 | * |
||
251 | * @return \Hybrid_Providers_XING |
||
252 | */ |
||
253 | public function getXing() |
||
257 | |||
258 | /** |
||
259 | * Get the Xing api (OAuthClient). |
||
260 | * |
||
261 | * @return \OAuth1Client |
||
262 | */ |
||
263 | public function getXingApi() |
||
267 | 2 | ||
268 | /** |
||
269 | 2 | * Get the LinkedIn Adapter. |
|
270 | * |
||
271 | 1 | * @return \Hybrid_Providers_LinkedIn |
|
272 | */ |
||
273 | public function getLinkedIn() |
||
277 | |||
278 | /** |
||
279 | * Get the LinkedIn api (LinkedIn PHP-client). |
||
280 | * |
||
281 | * @return \LinkedIn |
||
282 | */ |
||
283 | public function getLinkedInApi() |
||
287 | |||
288 | /** |
||
289 | * Get if auth token is expired. |
||
290 | * |
||
291 | * @param HybridAuthSessionData $data |
||
292 | * |
||
293 | * @return bool |
||
294 | */ |
||
295 | public function isExpiredSession(HybridAuthSessionData $data) |
||
303 | } |
||
304 |
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: