@@ -12,4 +12,4 @@ |
||
12 | 12 | |
13 | 13 | namespace chillerlan\OAuth; |
14 | 14 | |
15 | -class OAuthException extends \Exception{} |
|
15 | +class OAuthException extends \Exception {} |
@@ -14,4 +14,4 @@ |
||
14 | 14 | |
15 | 15 | use chillerlan\OAuth\OAuthException; |
16 | 16 | |
17 | -class ProviderException extends OAuthException{} |
|
17 | +class ProviderException extends OAuthException {} |
@@ -14,4 +14,4 @@ |
||
14 | 14 | |
15 | 15 | use chillerlan\OAuth\OAuthException; |
16 | 16 | |
17 | -class OAuthStorageException extends OAuthException{} |
|
17 | +class OAuthStorageException extends OAuthException {} |
@@ -105,14 +105,11 @@ |
||
105 | 105 | |
106 | 106 | if($expires === 0 || $expires === $this::EOL_NEVER_EXPIRES){ |
107 | 107 | $this->expires = $this::EOL_NEVER_EXPIRES; |
108 | - } |
|
109 | - elseif($expires > $now){ |
|
108 | + } elseif($expires > $now){ |
|
110 | 109 | $this->expires = $expires; |
111 | - } |
|
112 | - elseif($expires > 0 && $expires < $this::EXPIRY_MAX){ |
|
110 | + } elseif($expires > 0 && $expires < $this::EXPIRY_MAX){ |
|
113 | 111 | $this->expires = $now + $expires; |
114 | - } |
|
115 | - else{ |
|
112 | + } else{ |
|
116 | 113 | $this->expires = $this::EOL_UNKNOWN; |
117 | 114 | } |
118 | 115 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @property int $expires |
28 | 28 | * @property string $provider |
29 | 29 | */ |
30 | -final class AccessToken extends SettingsContainerAbstract{ |
|
30 | +final class AccessToken extends SettingsContainerAbstract { |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * Denotes an unknown end of life time. |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @param iterable|null $properties |
82 | 82 | */ |
83 | - public function __construct(iterable $properties = null){ |
|
83 | + public function __construct(iterable $properties = null) { |
|
84 | 84 | parent::__construct($properties); |
85 | 85 | |
86 | 86 | $this->setExpiry($this->expires); |
@@ -103,16 +103,16 @@ discard block |
||
103 | 103 | public function setExpiry(int $expires = null):AccessToken{ |
104 | 104 | $now = time(); |
105 | 105 | |
106 | - if($expires === 0 || $expires === $this::EOL_NEVER_EXPIRES){ |
|
106 | + if ($expires === 0 || $expires === $this::EOL_NEVER_EXPIRES) { |
|
107 | 107 | $this->expires = $this::EOL_NEVER_EXPIRES; |
108 | 108 | } |
109 | - elseif($expires > $now){ |
|
109 | + elseif ($expires > $now) { |
|
110 | 110 | $this->expires = $expires; |
111 | 111 | } |
112 | - elseif($expires > 0 && $expires < $this::EXPIRY_MAX){ |
|
112 | + elseif ($expires > 0 && $expires < $this::EXPIRY_MAX) { |
|
113 | 113 | $this->expires = $now + $expires; |
114 | 114 | } |
115 | - else{ |
|
115 | + else { |
|
116 | 116 | $this->expires = $this::EOL_UNKNOWN; |
117 | 117 | } |
118 | 118 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | /** |
14 | 14 | * The settings for the OAuth provider |
15 | 15 | */ |
16 | -trait OAuthOptionsTrait{ |
|
16 | +trait OAuthOptionsTrait { |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * The application key (or id) given by your provider |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * |
16 | 16 | * @link https://tools.ietf.org/html/rfc6749#section-10.4 |
17 | 17 | */ |
18 | -interface TokenRefresh{ |
|
18 | +interface TokenRefresh { |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Tries to refresh an existing AccessToken with an associated refresh token and returns a fresh AccessToken. |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * |
16 | 16 | * @link https://tools.ietf.org/html/rfc6749#section-4.4 |
17 | 17 | */ |
18 | -interface ClientCredentials{ |
|
18 | +interface ClientCredentials { |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Obtains an OAuth2 client credentials token and returns an AccessToken |
@@ -13,7 +13,7 @@ |
||
13 | 13 | /** |
14 | 14 | * Specifies the basic methods for an OAuth1 provider. |
15 | 15 | */ |
16 | -interface OAuth1Interface extends OAuthInterface{ |
|
16 | +interface OAuth1Interface extends OAuthInterface { |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Obtains an OAuth1 request token and returns an AccessToken object for use in the authentication request. |
@@ -15,7 +15,7 @@ |
||
15 | 15 | /** |
16 | 16 | * Specifies the basic methods for an OAuth2 provider. |
17 | 17 | */ |
18 | -interface OAuth2Interface extends OAuthInterface{ |
|
18 | +interface OAuth2Interface extends OAuthInterface { |
|
19 | 19 | |
20 | 20 | const AUTH_METHOD_HEADER = 1; |
21 | 21 | const AUTH_METHOD_QUERY = 2; |