@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | // make sure you have them enabled on your app page at |
15 | 15 | // https://developers.eveonline.com/applications/ |
16 | 16 | $options = [ |
17 | - 'scope' => ['publicData','characterLocationRead'] // array or string |
|
17 | + 'scope' => ['publicData', 'characterLocationRead'] // array or string |
|
18 | 18 | ]; |
19 | 19 | |
20 | 20 | // If we don't have an authorization code then get one |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | |
33 | 33 | } else { |
34 | 34 | // In this example we use php native $_SESSION as data store |
35 | - if(!isset($_SESSION['token'])) |
|
35 | + if (!isset($_SESSION['token'])) |
|
36 | 36 | { |
37 | 37 | // Try to get an access token (using the authorization code grant) |
38 | 38 | $_SESSION['token'] = $provider->getAccessToken('authorization_code', [ |
39 | 39 | 'code' => $_GET['code'] |
40 | 40 | ]); |
41 | 41 | |
42 | - }elseif($_SESSION['token']->hasExpired()){ |
|
42 | + }elseif ($_SESSION['token']->hasExpired()) { |
|
43 | 43 | // This is how you refresh your access token once you have it |
44 | 44 | $new_token = $provider->getAccessToken('refresh_token', [ |
45 | 45 | 'refresh_token' => $_SESSION['token']->getRefreshToken() |
@@ -39,7 +39,7 @@ |
||
39 | 39 | 'code' => $_GET['code'] |
40 | 40 | ]); |
41 | 41 | |
42 | - }elseif($_SESSION['token']->hasExpired()){ |
|
42 | + } elseif($_SESSION['token']->hasExpired()){ |
|
43 | 43 | // This is how you refresh your access token once you have it |
44 | 44 | $new_token = $provider->getAccessToken('refresh_token', [ |
45 | 45 | 'refresh_token' => $_SESSION['token']->getRefreshToken() |
@@ -156,7 +156,7 @@ |
||
156 | 156 | /** |
157 | 157 | * Internal helper function to safe read from an array |
158 | 158 | * @param mixed $array |
159 | - * @param string|int $key |
|
159 | + * @param string $key |
|
160 | 160 | * @return null |
161 | 161 | */ |
162 | 162 | private function safeRead($array, $key) |
@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | namespace Evelabs\OAuth2\Client\Provider; |
4 | 4 | |
5 | -use Psr\Http\Message\ResponseInterface; |
|
6 | -use League\OAuth2\Client\Token\AccessToken; |
|
7 | -use League\OAuth2\Client\Provider\AbstractProvider; |
|
8 | -use League\OAuth2\Client\Tool\BearerAuthorizationTrait; |
|
9 | -use League\OAuth2\Client\Provider\ResourceOwnerInterface; |
|
10 | 5 | use Doctrine\Instantiator\Exception\UnexpectedValueException; |
6 | +use League\OAuth2\Client\Provider\AbstractProvider; |
|
11 | 7 | use League\OAuth2\Client\Provider\Exception\IdentityProviderException; |
8 | +use League\OAuth2\Client\Provider\ResourceOwnerInterface; |
|
9 | +use League\OAuth2\Client\Token\AccessToken; |
|
10 | +use League\OAuth2\Client\Tool\BearerAuthorizationTrait; |
|
11 | +use Psr\Http\Message\ResponseInterface; |
|
12 | 12 | |
13 | 13 | class EveOnline extends AbstractProvider |
14 | 14 | { |