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

Commit 67765b9

Browse files
committed
1 parent 674dd2f commit 67765b9

10 files changed

+39
-39
lines changed

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
},
2222
"require": {
2323
"php": "^7.2",
24-
"chillerlan/php-traits": "^1.1",
25-
"chillerlan/php-httpinterface": "^1.1",
26-
"chillerlan/php-magic-apiclient": "^1.0",
24+
"chillerlan/php-traits": "^2.0",
25+
"chillerlan/php-httpinterface": "^2.0",
26+
"chillerlan/php-magic-apiclient": "^1.1",
2727
"psr/log": "^1.0",
2828
"psr/simple-cache": "^1.0"
2929
},
3030
"require-dev": {
31-
"chillerlan/php-database": "^2.0",
32-
"chillerlan/php-log": "^1.0",
31+
"chillerlan/php-database": "^2.1",
32+
"chillerlan/php-log": "^2.0",
3333
"phpunit/phpunit": "^7.3"
3434
},
3535
"autoload": {

src/Core/AccessToken.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace chillerlan\OAuth\Core;
1414

1515
use chillerlan\Traits\{
16-
Container, ContainerInterface, Crypto\MemzeroDestructorTrait
16+
ImmutableSettingsContainer, ImmutableSettingsInterface, Crypto\MemzeroDestructorTrait
1717
};
1818

1919
/**
@@ -31,8 +31,8 @@
3131
* @property int $expires
3232
* @property string $provider
3333
*/
34-
class AccessToken implements ContainerInterface{
35-
use MemzeroDestructorTrait, Container{
34+
class AccessToken implements ImmutableSettingsInterface{
35+
use MemzeroDestructorTrait, ImmutableSettingsContainer{
3636
__construct as constructContainer;
3737
}
3838

@@ -96,9 +96,9 @@ class AccessToken implements ContainerInterface{
9696
/**
9797
* AccessToken constructor.
9898
*
99-
* @param array|null $properties
99+
* @param iterable|null $properties
100100
*/
101-
public function __construct(array $properties = null){
101+
public function __construct(iterable $properties = null){
102102
$this->constructContainer($properties);
103103

104104
$this->setExpiry($this->expires);
@@ -112,7 +112,7 @@ public function __construct(array $properties = null){
112112
*
113113
* @return void
114114
*/
115-
public function __set(string $property, $value){
115+
public function __set(string $property, $value):void{
116116

117117
if(property_exists($this, $property)){
118118
$property === 'expires'

src/Core/OAuth2Provider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use chillerlan\OAuth\{
1919
Storage\OAuthStorageInterface
2020
};
21-
use chillerlan\Traits\ContainerInterface;
21+
use chillerlan\Traits\ImmutableSettingsInterface;
2222
use Psr\Log\LoggerInterface;
2323

2424
/**
@@ -58,11 +58,11 @@ abstract class OAuth2Provider extends OAuthProvider implements OAuth2Interface{
5858
*
5959
* @param \chillerlan\HTTP\HTTPClientInterface $http
6060
* @param \chillerlan\OAuth\Storage\OAuthStorageInterface $storage
61-
* @param \chillerlan\Traits\ContainerInterface $options
61+
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
6262
* @param \Psr\Log\LoggerInterface|null $logger
6363
* @param array $scopes
6464
*/
65-
public function __construct(HTTPClientInterface $http, OAuthStorageInterface $storage, ContainerInterface $options, LoggerInterface $logger = null, array $scopes = null){
65+
public function __construct(HTTPClientInterface $http, OAuthStorageInterface $storage, ImmutableSettingsInterface $options, LoggerInterface $logger = null, array $scopes = null){
6666
parent::__construct($http, $storage, $options, $logger);
6767

6868
if($scopes !== null){

src/Core/OAuthProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use chillerlan\MagicAPI\ApiClientInterface;
1919
use chillerlan\OAuth\Storage\OAuthStorageInterface;
2020
use chillerlan\Traits\{
21-
ClassLoader, ContainerInterface, Magic
21+
ClassLoader, ImmutableSettingsInterface, Magic
2222
};
2323
use Psr\Log\{
2424
LoggerAwareInterface, LoggerAwareTrait, LoggerInterface, NullLogger
@@ -87,10 +87,10 @@ abstract class OAuthProvider implements OAuthInterface, LoggerAwareInterface{
8787
*
8888
* @param \chillerlan\HTTP\HTTPClientInterface $http
8989
* @param \chillerlan\OAuth\Storage\OAuthStorageInterface $storage
90-
* @param \chillerlan\Traits\ContainerInterface $options
90+
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
9191
* @param \Psr\Log\LoggerInterface|null $logger
9292
*/
93-
public function __construct(HTTPClientInterface $http, OAuthStorageInterface $storage, ContainerInterface $options, LoggerInterface $logger = null){
93+
public function __construct(HTTPClientInterface $http, OAuthStorageInterface $storage, ImmutableSettingsInterface $options, LoggerInterface $logger = null){
9494
$this->setHTTPClient($http);
9595

9696
$this->storage = $storage;

src/OAuthOptions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use chillerlan\HTTP\HTTPOptionsTrait;
1616
use chillerlan\Traits\{
17-
Container, ContainerInterface, Crypto\MemzeroDestructorTrait
17+
ImmutableSettingsContainer, ImmutableSettingsInterface, Crypto\MemzeroDestructorTrait
1818
};
1919

2020
/**
@@ -55,17 +55,17 @@
5555
* @property string $ca_info
5656
* @property int $max_redirects
5757
*/
58-
class OAuthOptions implements ContainerInterface{
59-
use OAuthOptionsTrait, HTTPOptionsTrait, MemzeroDestructorTrait, Container{
58+
class OAuthOptions implements ImmutableSettingsInterface{
59+
use OAuthOptionsTrait, HTTPOptionsTrait, MemzeroDestructorTrait, ImmutableSettingsContainer{
6060
__construct as protected containerConstruct;
6161
}
6262

6363
/**
6464
* OAuthOptions constructor.
6565
*
66-
* @param array|null $properties
66+
* @param iterable|null $properties
6767
*/
68-
public function __construct(array $properties = null){
68+
public function __construct(iterable $properties = null){
6969
// enable encryption by default if possible...
7070
$this->useEncryption = extension_loaded('sodium');
7171

src/Storage/DBStorage.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use chillerlan\Database\Database;
1616
use chillerlan\OAuth\Core\AccessToken;
17-
use chillerlan\Traits\ContainerInterface;
17+
use chillerlan\Traits\ImmutableSettingsInterface;
1818

1919
class DBStorage extends OAuthStorageAbstract{
2020

@@ -26,12 +26,12 @@ class DBStorage extends OAuthStorageAbstract{
2626
/**
2727
* DBStorage constructor.
2828
*
29-
* @param \chillerlan\Traits\ContainerInterface $options
29+
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
3030
* @param \chillerlan\Database\Database $db
3131
*
3232
* @throws \chillerlan\OAuth\Storage\OAuthStorageException
3333
*/
34-
public function __construct(ContainerInterface $options, Database $db){
34+
public function __construct(ImmutableSettingsInterface $options, Database $db){
3535
parent::__construct($options);
3636

3737
if(!$this->options->dbTokenTable || !$this->options->dbProviderTable){

src/Storage/OAuthStorageAbstract.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use chillerlan\OAuth\{
1616
Core\AccessToken, OAuthOptions
1717
};
18-
use chillerlan\Traits\ContainerInterface;
18+
use chillerlan\Traits\ImmutableSettingsInterface;
1919
use Psr\Log\{
2020
LoggerAwareInterface, LoggerAwareTrait, LoggerInterface, NullLogger
2121
};
@@ -31,10 +31,10 @@ abstract class OAuthStorageAbstract implements OAuthStorageInterface, LoggerAwar
3131
/**
3232
* OAuthStorageAbstract constructor.
3333
*
34-
* @param \chillerlan\Traits\ContainerInterface|null $options
34+
* @param \chillerlan\Traits\ImmutableSettingsInterface|null $options
3535
* @param \Psr\Log\LoggerInterface|null $logger
3636
*/
37-
public function __construct(ContainerInterface $options = null, LoggerInterface $logger = null){
37+
public function __construct(ImmutableSettingsInterface $options = null, LoggerInterface $logger = null){
3838
$this->options = $options ?? new OAuthOptions;
3939
$this->logger = $logger ?? new NullLogger;
4040
}

src/Storage/SessionStorage.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace chillerlan\OAuth\Storage;
1414

1515
use chillerlan\OAuth\Core\AccessToken;
16-
use chillerlan\Traits\ContainerInterface;
16+
use chillerlan\Traits\ImmutableSettingsInterface;
1717

1818
class SessionStorage extends OAuthStorageAbstract{
1919

@@ -35,9 +35,9 @@ class SessionStorage extends OAuthStorageAbstract{
3535
/**
3636
* Session constructor.
3737
*
38-
* @param \chillerlan\Traits\ContainerInterface|null $options
38+
* @param \chillerlan\Traits\ImmutableSettingsInterface|null $options
3939
*/
40-
public function __construct(ContainerInterface $options = null){
40+
public function __construct(ImmutableSettingsInterface $options = null){
4141
parent::__construct($options);
4242

4343
$this->sessionVar = $this->options->sessionTokenVar;

tests/Core/APITestAbstract.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Core\AccessToken, Core\OAuthInterface, OAuthOptions, Storage\MemoryStorage, Storage\OAuthStorageInterface
2020
};
2121
use chillerlan\OAuthTest\OAuthTestAbstract;
22-
use chillerlan\Traits\ContainerInterface;
22+
use chillerlan\Traits\ImmutableSettingsInterface;
2323
use Psr\Log\LoggerInterface;
2424

2525
abstract class APITestAbstract extends OAuthTestAbstract{
@@ -106,25 +106,25 @@ protected function setUp(){
106106
/**
107107
* @param \chillerlan\HTTP\HTTPClientInterface $http
108108
* @param \chillerlan\OAuth\Storage\OAuthStorageInterface $storage
109-
* @param \chillerlan\Traits\ContainerInterface $options
109+
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
110110
* @param \Psr\Log\LoggerInterface $logger
111111
*
112112
* @return \chillerlan\OAuth\Core\OAuthInterface
113113
*/
114-
protected function initProvider(HTTPClientInterface $http, OAuthStorageInterface $storage, ContainerInterface $options, LoggerInterface $logger){
114+
protected function initProvider(HTTPClientInterface $http, OAuthStorageInterface $storage, ImmutableSettingsInterface $options, LoggerInterface $logger){
115115
return new $this->FQCN($http, $storage, $options, $logger);
116116
}
117117

118118
/**
119-
* @param \chillerlan\Traits\ContainerInterface $options
119+
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
120120
*
121121
* @return \chillerlan\HTTP\HTTPClientInterface
122122
*/
123-
protected function initHttp(ContainerInterface $options):HTTPClientInterface{
123+
protected function initHttp(ImmutableSettingsInterface $options):HTTPClientInterface{
124124
return new class($options) extends HTTPClientAbstract{
125125
protected $client;
126126

127-
public function __construct(ContainerInterface $options){
127+
public function __construct(ImmutableSettingsInterface $options){
128128
parent::__construct($options);
129129
$this->client = new CurlClient($this->options);
130130
}

tests/Core/OAuth2APITestAbstract.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use chillerlan\OAuth\{
1717
Core\OAuth2Interface, Storage\OAuthStorageInterface
1818
};
19-
use chillerlan\Traits\ContainerInterface;
19+
use chillerlan\Traits\ImmutableSettingsInterface;
2020
use Psr\Log\LoggerInterface;
2121

2222
/**
@@ -31,7 +31,7 @@ abstract class OAuth2APITestAbstract extends APITestAbstract{
3131
/**
3232
* @inheritdoc
3333
*/
34-
protected function initProvider(HTTPClientInterface $http, OAuthStorageInterface $storage, ContainerInterface $options, LoggerInterface $logger){
34+
protected function initProvider(HTTPClientInterface $http, OAuthStorageInterface $storage, ImmutableSettingsInterface $options, LoggerInterface $logger){
3535
return new $this->FQCN($http, $storage, $options, $logger, $this->scopes);
3636
}
3737

0 commit comments

Comments
 (0)