Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit 8fcebbb

Browse files
committed
🚿
1 parent 8678d3b commit 8fcebbb

File tree

4 files changed

+17
-41
lines changed

4 files changed

+17
-41
lines changed

.scrutinizer.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Core/AccessToken.php

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,27 @@ final class AccessToken extends SettingsContainerAbstract{
4343
public const EOL_NEVER_EXPIRES = -9002;
4444

4545
/**
46-
* defines a maximum expiry period (1 year)
46+
* Defines a maximum expiry period (1 year)
4747
*/
4848
public const EXPIRY_MAX = (86400 * 365);
4949

5050
/**
51-
* the access token secret (OAuth1)
51+
* The access token secret (OAuth1)
5252
*/
5353
protected ?string $accessTokenSecret = null;
5454

5555
/**
56-
* the oauth access token
56+
* The oauth access token
5757
*/
5858
protected ?string $accessToken = null;
5959

6060
/**
61-
* an optional refresh token (OAuth2)
61+
* An optional refresh token (OAuth2)
6262
*/
6363
protected ?string $refreshToken = null;
6464

6565
/**
66-
* the token expiration date/time
66+
* The token expiration date/time
6767
* @todo: change to DateInterval?
6868
*/
6969
protected ?int $expires = self::EOL_UNKNOWN;
@@ -82,14 +82,12 @@ final class AccessToken extends SettingsContainerAbstract{
8282
protected array $scopes = [];
8383

8484
/**
85-
* the provider who issued this token
85+
* The provider who issued this token
8686
*/
8787
protected ?string $provider = null;
8888

8989
/**
9090
* AccessToken constructor.
91-
*
92-
* @param iterable|null $properties
9391
*/
9492
public function __construct(iterable $properties = null){
9593
parent::__construct($properties);
@@ -98,18 +96,14 @@ public function __construct(iterable $properties = null){
9896
}
9997

10098
/**
101-
* @param int|null $expires
102-
*
103-
* @return void
99+
* Expiry setter
104100
*/
105101
protected function set_expires(int $expires = null):void{
106102
$this->setExpiry($expires);
107103
}
108104

109105
/**
110-
* @param int|null $expires
111-
*
112-
* @return \chillerlan\OAuth\Core\AccessToken
106+
* Sets the expiration for this token
113107
*/
114108
public function setExpiry(int $expires = null):AccessToken{
115109
$now = time();
@@ -131,7 +125,7 @@ public function setExpiry(int $expires = null):AccessToken{
131125
}
132126

133127
/**
134-
* @return bool
128+
* Checks whether this token is expired
135129
*/
136130
public function isExpired():bool{
137131
return $this->expires !== $this::EOL_NEVER_EXPIRES && $this->expires !== $this::EOL_UNKNOWN && time() > $this->expires;

src/Core/OAuth2Provider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
namespace chillerlan\OAuth\Core;
1616

17-
use chillerlan\HTTP\Utils\MessageUtil;
18-
use chillerlan\HTTP\Utils\QueryUtil;
17+
use chillerlan\HTTP\Utils\{MessageUtil, QueryUtil};
1918
use Psr\Http\Message\{RequestInterface, ResponseInterface, UriInterface};
2019
use function array_merge;
2120
use function base64_encode;

src/Core/OAuthProvider.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ abstract class OAuthProvider implements OAuthInterface{
138138
* OAuthProvider constructor.
139139
*/
140140
public function __construct(
141-
ClientInterface $http,
141+
ClientInterface $http,
142142
OAuthOptions|SettingsContainerInterface $options,
143-
LoggerInterface $logger = null
143+
LoggerInterface $logger = null
144144
){
145145
$this->http = $http;
146146
$this->options = $options;
@@ -249,12 +249,12 @@ protected function createAccessToken():AccessToken{
249249
* @inheritDoc
250250
*/
251251
public function request(
252-
string $path,
253-
array $params = null,
254-
string $method = null,
252+
string $path,
253+
array $params = null,
254+
string $method = null,
255255
StreamInterface|array|string $body = null,
256-
array $headers = null,
257-
string $protocolVersion = null
256+
array $headers = null,
257+
string $protocolVersion = null
258258
):ResponseInterface{
259259
$request = $this->requestFactory->createRequest(($method ?? 'GET'), $this->getRequestURL($path, $params));
260260

0 commit comments

Comments
 (0)