Skip to content

Commit dfb8553

Browse files
committed
:octocat: dependency update
1 parent b992750 commit dfb8553

9 files changed

+22
-114
lines changed

composer.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
},
2424
"require": {
2525
"php": "^7.0.3",
26-
"chillerlan/php-traits": "^1.1",
26+
"chillerlan/php-traits": "^2.0",
2727
"psr/log": "^1.0"
2828
},
2929
"require-dev": {
30-
"chillerlan/php-curl": "^1.0",
3130
"guzzlehttp/guzzle": "^6.3",
3231
"phpunit/phpunit": "^6.5"
3332
},

src/CurlClient.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace chillerlan\HTTP;
1414

15-
use chillerlan\Traits\ContainerInterface;
15+
use chillerlan\Traits\ImmutableSettingsInterface;
1616

1717
/**
1818
* @property resource $http
@@ -27,11 +27,11 @@ class CurlClient extends HTTPClientAbstract{
2727
/**
2828
* CurlClient constructor.
2929
*
30-
* @param \chillerlan\Traits\ContainerInterface $options
30+
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
3131
*
3232
* @throws \chillerlan\HTTP\HTTPClientException
3333
*/
34-
public function __construct(ContainerInterface $options){
34+
public function __construct(ImmutableSettingsInterface $options){
3535
parent::__construct($options);
3636

3737
if(!isset($this->options->ca_info) || !is_file($this->options->ca_info)){

src/GuzzleClient.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace chillerlan\HTTP;
1414

15-
use chillerlan\Traits\ContainerInterface;
15+
use chillerlan\Traits\ImmutableSettingsInterface;
1616
use GuzzleHttp\Client;
1717
use Psr\Http\Message\StreamInterface;
1818

@@ -24,10 +24,10 @@ class GuzzleClient extends HTTPClientAbstract{
2424
/**
2525
* GuzzleClient constructor.
2626
*
27-
* @param \chillerlan\Traits\ContainerInterface $options
27+
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
2828
* @param \GuzzleHttp\Client|null $http
2929
*/
30-
public function __construct(ContainerInterface $options, Client $http = null){
30+
public function __construct(ImmutableSettingsInterface $options, Client $http = null){
3131
parent::__construct($options);
3232

3333
if($http instanceof Client){

src/HTTPClientAbstract.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace chillerlan\HTTP;
1414

15-
use chillerlan\Traits\ContainerInterface;
15+
use chillerlan\Traits\ImmutableSettingsInterface;
1616
use Psr\Log\{
1717
LoggerAwareInterface, LoggerAwareTrait, LoggerInterface, NullLogger
1818
};
@@ -26,7 +26,7 @@ abstract class HTTPClientAbstract implements HTTPClientInterface, LoggerAwareInt
2626
protected $http;
2727

2828
/**
29-
* @var \chillerlan\Traits\ContainerInterface|mixed
29+
* @var \chillerlan\Traits\ImmutableSettingsInterface|mixed
3030
*/
3131
protected $options;
3232

@@ -38,7 +38,7 @@ abstract class HTTPClientAbstract implements HTTPClientInterface, LoggerAwareInt
3838
protected $requestHeaders;
3939

4040
/** @inheritdoc */
41-
public function __construct(ContainerInterface $options, LoggerInterface $logger = null){
41+
public function __construct(ImmutableSettingsInterface $options, LoggerInterface $logger = null){
4242
$this->options = $options;
4343
$this->logger = $logger ?? new NullLogger;
4444
}

src/HTTPResponse.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
namespace chillerlan\HTTP;
1414

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

19-
class HTTPResponse implements HTTPResponseInterface, ContainerInterface{
20-
use Container{
19+
class HTTPResponse implements HTTPResponseInterface, ImmutableSettingsInterface{
20+
use ImmutableSettingsContainer{
2121
__get as containerGet;
2222
}
2323

src/StreamClient.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212

1313
namespace chillerlan\HTTP;
1414

15-
use chillerlan\Traits\ContainerInterface;
15+
use chillerlan\Traits\ImmutableSettingsInterface;
1616

1717
class StreamClient extends HTTPClientAbstract{
1818

1919
/**
2020
* StreamClient constructor.
2121
*
22-
* @param \chillerlan\Traits\ContainerInterface $options
22+
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
2323
*
2424
* @throws \chillerlan\HTTP\HTTPClientException
2525
*/
26-
public function __construct(ContainerInterface $options){
26+
public function __construct(ImmutableSettingsInterface $options){
2727
parent::__construct($options);
2828

2929
if(!isset($this->options->ca_info) || !is_file($this->options->ca_info)){

src/TinyCurlClient.php

-64
This file was deleted.

tests/HTTPClientTestAbstract.php

+6-8
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212

1313
namespace chillerlan\HTTPTest;
1414

15-
use chillerlan\HTTP\HTTPClientInterface;
16-
use chillerlan\HTTP\HTTPOptionsTrait;
17-
use chillerlan\Traits\Container;
18-
use chillerlan\Traits\ContainerInterface;
15+
use chillerlan\HTTP\{HTTPClientInterface, HTTPOptionsTrait};
16+
use chillerlan\Traits\{ImmutableSettingsContainer, ImmutableSettingsInterface};
1917
use PHPUnit\Framework\TestCase;
2018

2119
abstract class HTTPClientTestAbstract extends TestCase{
@@ -29,7 +27,7 @@ abstract class HTTPClientTestAbstract extends TestCase{
2927
protected $http;
3028

3129
/**
32-
* @var \chillerlan\Traits\ContainerInterface
30+
* @var \chillerlan\Traits\ImmutableSettingsInterface
3331
*/
3432
protected $options;
3533

@@ -40,9 +38,9 @@ protected function setUp(){
4038
]);
4139
}
4240

43-
protected function getOptions(array $arr = null):ContainerInterface{
44-
return new class($arr ?? []) implements ContainerInterface{
45-
use Container, HTTPOptionsTrait;
41+
protected function getOptions(array $arr = null):ImmutableSettingsInterface{
42+
return new class($arr ?? []) implements ImmutableSettingsInterface{
43+
use ImmutableSettingsContainer, HTTPOptionsTrait;
4644
};
4745
}
4846

tests/TinyCurlClientTest.php

-25
This file was deleted.

0 commit comments

Comments
 (0)