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

Commit 35535b3

Browse files
committed
:octocat: PSR-18
1 parent 978abed commit 35535b3

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"homepage": "https://github.com/chillerlan/php-oauth-core",
55
"license": "MIT",
66
"type": "library",
7-
"minimum-stability": "stable",
7+
"minimum-stability": "dev",
8+
"prefer-stable": true,
89
"keywords": [
910
"oauth", "oauth1", "oauth2", "client", "core"
1011
],

src/Core/OAuthProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use chillerlan\HTTP\MagicAPI\{ApiClientException, ApiClientInterface, EndpointMapInterface};
1717
use chillerlan\OAuth\Storage\OAuthStorageInterface;
1818
use chillerlan\Settings\SettingsContainerInterface;
19-
use Http\Client\HttpClient;
19+
use Psr\Http\Client\ClientInterface;
2020
use Psr\Http\Message\{RequestFactoryInterface, StreamFactoryInterface, StreamInterface, UriFactoryInterface};
2121
use Psr\Http\Message\ResponseInterface;
2222
use Psr\Log\{LoggerAwareInterface, LoggerAwareTrait, NullLogger};
@@ -33,7 +33,7 @@ abstract class OAuthProvider implements OAuthInterface, ApiClientInterface, Logg
3333
use LoggerAwareTrait;
3434

3535
/**
36-
* @var \Http\Client\HttpClient
36+
* @var \Psr\Http\Client\ClientInterface
3737
*/
3838
protected $http;
3939

@@ -115,13 +115,13 @@ abstract class OAuthProvider implements OAuthInterface, ApiClientInterface, Logg
115115
/**
116116
* OAuthProvider constructor.
117117
*
118-
* @param \Http\Client\HttpClient $http
118+
* @param \Psr\Http\Client\ClientInterface $http
119119
* @param \chillerlan\OAuth\Storage\OAuthStorageInterface $storage
120120
* @param \chillerlan\Settings\SettingsContainerInterface $options
121121
*
122122
* @throws \chillerlan\HTTP\MagicAPI\ApiClientException
123123
*/
124-
public function __construct(HttpClient $http, OAuthStorageInterface $storage, SettingsContainerInterface $options){
124+
public function __construct(ClientInterface $http, OAuthStorageInterface $storage, SettingsContainerInterface $options){
125125
$this->http = $http;
126126
$this->storage = $storage;
127127
$this->options = $options;

tests/API/APITestAbstract.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use chillerlan\Logger\{Log, LogOptionsTrait, Output\LogOutputAbstract};
1818
use chillerlan\OAuth\{OAuthOptions, Core\AccessToken, Core\OAuthInterface, Storage\MemoryStorage};
1919
use chillerlan\Settings\SettingsContainerInterface;
20-
use Http\Client\HttpClient;
20+
use Psr\Http\Client\ClientInterface;
2121
use PHPUnit\Framework\TestCase;
2222
use Psr\Http\Message\{RequestInterface, ResponseInterface};
2323
use Psr\Log\LoggerInterface;
@@ -125,11 +125,11 @@ protected function __log(string $level, string $message, array $context = null):
125125
/**
126126
* @param $options
127127
*
128-
* @return \Http\Client\HttpClient
128+
* @return \Psr\Http\Client\ClientInterface
129129
*/
130-
protected function initHttp($options, $logger):HttpClient{
131-
return new class($options, $logger) implements HttpClient{
132-
/** @var \Http\Client\HttpClient */
130+
protected function initHttp($options, $logger):ClientInterface{
131+
return new class($options, $logger) implements ClientInterface{
132+
/** @var \Psr\Http\Client\ClientInterface */
133133
protected $client;
134134
/** @var \chillerlan\Settings\SettingsContainerInterface */
135135
protected $options;

tests/Providers/ProviderTestAbstract.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use chillerlan\HTTP\{Psr17, Psr7\Response};
1616
use chillerlan\OAuth\Core\{AccessToken, OAuth1Interface, OAuth2Interface, OAuthInterface};
1717
use chillerlan\OAuth\{OAuthOptions, Storage\MemoryStorage};
18-
use Http\Client\HttpClient;
18+
use Psr\Http\Client\ClientInterface;
1919
use PHPUnit\Framework\TestCase;
2020
use Psr\Http\Message\{RequestInterface, ResponseInterface};
2121
use ReflectionClass, ReflectionMethod, ReflectionProperty;
@@ -70,8 +70,8 @@ protected function setUp(){
7070
$this->storage->storeAccessToken($this->provider->serviceName, new AccessToken(['accessToken' => 'foo']));
7171
}
7272

73-
protected function initHttp():HttpClient{
74-
return new class($this->reflection, $this->responses) implements HttpClient{
73+
protected function initHttp():ClientInterface{
74+
return new class($this->reflection, $this->responses) implements ClientInterface{
7575

7676
/** @var \ReflectionClass */
7777
protected $reflection;

0 commit comments

Comments
 (0)