1 | <?php namespace Arcanedev\Socialite\OAuth\Two; |
||
12 | class FacebookProvider extends AbstractProvider |
||
13 | { |
||
14 | /* ------------------------------------------------------------------------------------------------ |
||
15 | | Properties |
||
16 | | ------------------------------------------------------------------------------------------------ |
||
17 | */ |
||
18 | /** |
||
19 | * The base Facebook Graph URL. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $graphUrl = 'https://graph.facebook.com'; |
||
24 | |||
25 | /** |
||
26 | * The Graph API version for the request. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $version = 'v2.8'; |
||
31 | |||
32 | /** |
||
33 | * The user fields being requested. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | protected $fields = ['name', 'email', 'gender', 'verified', 'link']; |
||
38 | |||
39 | /** |
||
40 | * The scopes being requested. |
||
41 | * |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $scopes = ['email']; |
||
45 | |||
46 | /** |
||
47 | * Display the dialog in a popup view. |
||
48 | * |
||
49 | * @var bool |
||
50 | */ |
||
51 | protected $popup = false; |
||
52 | |||
53 | /** |
||
54 | * Re-request a declined permission. |
||
55 | * |
||
56 | * @var bool |
||
57 | */ |
||
58 | protected $reRequest = false; |
||
59 | |||
60 | /* ------------------------------------------------------------------------------------------------ |
||
61 | | Main Functions |
||
62 | | ------------------------------------------------------------------------------------------------ |
||
63 | */ |
||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | protected function getAuthUrl($state) |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | 6 | protected function getTokenUrl() |
|
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | 6 | public function getAccessTokenResponse($code) |
|
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | protected function getUserByToken($token) |
||
115 | |||
116 | /** |
||
117 | * {@inheritdoc} |
||
118 | */ |
||
119 | 6 | protected function mapUserToObject(array $user) |
|
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | protected function getCodeFields($state = null) |
||
151 | |||
152 | /** |
||
153 | * Set the user fields to request from Facebook. |
||
154 | * |
||
155 | * @param array $fields |
||
156 | * |
||
157 | * @return self |
||
158 | */ |
||
159 | public function fields(array $fields) |
||
165 | |||
166 | /** |
||
167 | * Set the dialog to be displayed as a popup. |
||
168 | * |
||
169 | * @return self |
||
170 | */ |
||
171 | public function asPopup() |
||
177 | |||
178 | /** |
||
179 | * Re-request permissions which were previously declined. |
||
180 | * |
||
181 | * @return self |
||
182 | */ |
||
183 | public function reRequest() |
||
188 | } |
||
189 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.