1 | <?php |
||
15 | class AzineHybridAuth { |
||
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 | * @var array or HybridAuth |
||
49 | */ |
||
50 | private $instances = array(); |
||
51 | |||
52 | /** |
||
53 | * HybridAuth configuration |
||
54 | * @var array |
||
55 | */ |
||
56 | private $config; |
||
57 | |||
58 | /** |
||
59 | * |
||
60 | * @param UrlGeneratorInterface $router |
||
61 | * @param UserInterface $user |
||
62 | * @param TokenStorageInterface $tokenStorage |
||
|
|||
63 | * @param ObjectManager $manager |
||
64 | * @param array $config |
||
65 | * @param bool $storeForUser |
||
66 | * @param $storeAsCookie |
||
67 | * @param $expiresInDays |
||
68 | */ |
||
69 | public function __construct(UrlGeneratorInterface $router, UserInterface $user, ObjectManager $manager, $config, $storeForUser, $storeAsCookie, $expiresInDays){ |
||
79 | |||
80 | |||
81 | /** |
||
82 | * Get a Hybrid_Auth instance initialised for the given provider. |
||
83 | * HybridAuthSessions will be restored from DB and/or cookies, according to the bundle configuration. |
||
84 | * |
||
85 | * @param $cookieSessionData |
||
86 | * @param $provider |
||
87 | * @return \Hybrid_Auth |
||
88 | */ |
||
89 | public function getInstance($cookieSessionData, $provider){ |
||
134 | |||
135 | /** |
||
136 | * @param Request $request |
||
137 | * @param $provider |
||
138 | * @param $sessionData |
||
139 | * @return Cookie | null |
||
140 | */ |
||
141 | public function storeHybridAuthSessionData(Request $request, $provider, $sessionData){ |
||
149 | |||
150 | /** |
||
151 | * Delete the HybridAuthSessionData entity from the database |
||
152 | * @param $provider |
||
153 | */ |
||
154 | public function deleteSession($provider){ |
||
163 | |||
164 | /** |
||
165 | * Save as HybridAuthSessionData entity to the database. |
||
166 | * Checks the bundle configuration before saving. |
||
167 | * @param $sessionData |
||
168 | * @param $provider |
||
169 | */ |
||
170 | private function saveAuthSessionData($sessionData, $provider){ |
||
188 | |||
189 | public function getCookieName($provider){ |
||
192 | |||
193 | /** |
||
194 | * Use this function to get access to a HybridAuthProvider. |
||
195 | * |
||
196 | * Calling this method will log the user in (make a roundtrip to the providers site and back to your site again) |
||
197 | * and call the page again that you came from. |
||
198 | * |
||
199 | * When logged (allready) it will return the hybridAuth provider. |
||
200 | * |
||
201 | * @param $authSessionData |
||
202 | * @param string $provider_id |
||
203 | * @param boolean $require_login |
||
204 | * @return \Hybrid_Provider_Model |
||
205 | */ |
||
206 | public function getProvider($authSessionData, $provider_id, $require_login = true){ |
||
213 | |||
214 | /** |
||
215 | * Check if the current user has allowed access to the given provider |
||
216 | * @param Request $request |
||
217 | * @param string $provider_id |
||
218 | * @return bool true if access to the provider is granted for this app. |
||
219 | */ |
||
220 | public function isConnected(Request $request, $provider_id){ |
||
226 | |||
227 | /** |
||
228 | * Get the Xing Adapter |
||
229 | * @return \Hybrid_Providers_XING |
||
230 | */ |
||
231 | public function getXing(){ |
||
234 | |||
235 | /** |
||
236 | * Get the Xing api (OAuthClient) |
||
237 | * |
||
238 | * @return \OAuth1Client |
||
239 | */ |
||
240 | public function getXingApi(){ |
||
243 | |||
244 | /** |
||
245 | * Get the LinkedIn Adapter |
||
246 | * |
||
247 | * @return \Hybrid_Providers_LinkedIn |
||
248 | */ |
||
249 | public function getLinkedIn(){ |
||
252 | |||
253 | /** |
||
254 | * Get the LinkedIn api (LinkedIn PHP-client) |
||
255 | * |
||
256 | * @return \LinkedIn |
||
257 | */ |
||
258 | public function getLinkedInApi(){ |
||
261 | |||
262 | /** |
||
263 | * Get if auth token is expired |
||
264 | * @param HybridAuthSessionData $data |
||
265 | * |
||
266 | * @return boolean |
||
267 | */ |
||
268 | public function isExpiredSession(HybridAuthSessionData $data) |
||
277 | |||
278 | } |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.