1 | <?php |
||
14 | class GitHub extends \SocialConnect\OAuth2\AbstractProvider |
||
15 | { |
||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $options = [ |
||
20 | /** |
||
21 | * GitHub store only unverified and public email inside User |
||
22 | * It's not possible to fetch user with email in GraphQL (new api) |
||
23 | * For now, there is only one way, additional request for it by user/email API entrypoint |
||
24 | * |
||
25 | * It's disabled by default in SocialConnect 1.x, but you can enable it from configuration :) |
||
26 | */ |
||
27 | 'fetch_emails' => false |
||
28 | ]; |
||
29 | |||
30 | 3 | public function getBaseUri() |
|
34 | |||
35 | 2 | public function getAuthorizeUri() |
|
39 | |||
40 | 2 | public function getRequestTokenUri() |
|
44 | |||
45 | 3 | public function getName() |
|
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | 2 | public function getIdentity(AccessTokenInterface $accessToken) |
|
98 | |||
99 | |||
100 | /** |
||
101 | * @param AccessTokenInterface $accessToken |
||
102 | * @return object |
||
103 | * @throws InvalidResponse |
||
104 | */ |
||
105 | public function getPrimaryEmail(AccessTokenInterface $accessToken) |
||
118 | |||
119 | /** |
||
120 | * @param AccessTokenInterface $accessToken |
||
121 | * @return array |
||
122 | * @throws InvalidResponse |
||
123 | */ |
||
124 | public function getEmails(AccessTokenInterface $accessToken) |
||
150 | } |
||
151 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.