@@ -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 | |
@@ -12,4 +12,4 @@ |
||
| 12 | 12 | |
| 13 | 13 | use Exception; |
| 14 | 14 | |
| 15 | -class ApiClientException extends Exception{} |
|
| 15 | +class ApiClientException extends Exception {} |
|
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | use chillerlan\Settings\SettingsContainerAbstract; |
| 14 | 14 | |
| 15 | -abstract class EndpointMap extends SettingsContainerAbstract implements EndpointMapInterface{ |
|
| 15 | +abstract class EndpointMap extends SettingsContainerAbstract implements EndpointMapInterface { |
|
| 16 | 16 | |
| 17 | 17 | protected string $API_BASE = ''; |
| 18 | 18 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | use Psr\Http\Message\ResponseInterface; |
| 14 | 14 | |
| 15 | -interface ApiClientInterface{ |
|
| 15 | +interface ApiClientInterface { |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Implements the Magic API client |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | /** |
| 16 | 16 | * @property string $API_BASE |
| 17 | 17 | */ |
| 18 | -interface EndpointMapInterface extends SettingsContainerInterface{ |
|
| 18 | +interface EndpointMapInterface extends SettingsContainerInterface { |
|
| 19 | 19 | |
| 20 | 20 | } |
@@ -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 |