Skip to content

Commit c550995

Browse files
authored
Merge pull request #27 from sunrise-php/release/v1.4.1
v1.4.1
2 parents e83e412 + afef733 commit c550995

File tree

13 files changed

+54
-76
lines changed

13 files changed

+54
-76
lines changed

.circleci/config.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,40 @@ jobs:
1010
steps:
1111
- checkout
1212
- run: php -v
13-
- run: composer install --no-interaction --prefer-source --no-suggest
14-
- run: php vendor/bin/phpunit --colors=always
13+
- run: composer install --no-interaction --no-suggest --prefer-source
14+
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
1515
php72:
1616
docker:
1717
- image: circleci/php:7.2-cli-node-browsers
1818
steps:
1919
- checkout
2020
- run: php -v
21-
- run: composer install --no-interaction --prefer-source --no-suggest
22-
- run: php vendor/bin/phpunit --colors=always
21+
- run: composer install --no-interaction --no-suggest --prefer-source
22+
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
2323
php73:
2424
docker:
2525
- image: circleci/php:7.3-cli-node-browsers
2626
steps:
2727
- checkout
2828
- run: php -v
29-
- run: composer install --no-interaction --prefer-source --no-suggest
30-
- run: php vendor/bin/phpunit --colors=always
29+
- run: composer install --no-interaction --no-suggest --prefer-source
30+
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
3131
php74:
3232
docker:
3333
- image: circleci/php:7.4-cli-node-browsers
3434
steps:
3535
- checkout
3636
- run: php -v
37-
- run: composer install --no-interaction --prefer-source --no-suggest
38-
- run: php vendor/bin/phpunit --colors=always
37+
- run: composer install --no-interaction --no-suggest --prefer-source
38+
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
3939
php80:
4040
docker:
4141
- image: circleci/php:8.0-cli-node-browsers
4242
steps:
4343
- checkout
4444
- run: php -v
45-
- run: composer install --no-interaction --prefer-source --no-suggest
46-
- run: php vendor/bin/phpunit --colors=always
45+
- run: composer install --no-interaction --no-suggest --prefer-source
46+
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
4747
workflows:
4848
version: 2
4949
build:

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,5 @@ indent_size = 4
1111
trim_trailing_whitespace = true
1212
insert_final_newline = true
1313

14-
[*.md]
15-
trim_trailing_whitespace = false
16-
1714
[*.yml]
1815
indent_size = 2

.gitignore

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
.php_cs.cache
2-
.phpunit.result.cache
3-
composer.lock
4-
coverage.xml
5-
phpbench.json
6-
phpcs.xml
7-
phpunit.xml
8-
vendor/
1+
/.php_cs.cache
2+
/.phpunit.result.cache
3+
/composer.lock
4+
/coverage.xml
5+
/phpbench.json
6+
/phpcs.xml
7+
/phpunit.xml
8+
/vendor/

.scrutinizer.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
build:
2+
environment:
3+
php:
4+
version: '8.0'
25
nodes:
36
analysis:
47
tests:
@@ -7,7 +10,7 @@ build:
710
coverage:
811
tests:
912
override:
10-
- command: php vendor/bin/phpunit --coverage-clover coverage.xml
13+
- command: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-clover coverage.xml
1114
coverage:
1215
file: coverage.xml
1316
format: clover

.travis.yml

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

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
## HTTP cURL client for PHP 7.1+ (incl. PHP 8) based on PSR-18
1+
# HTTP cURL client for PHP 7.1+ (incl. PHP 8) based on PSR-18
22

3-
[![Gitter](https://badges.gitter.im/sunrise-php/support.png)](https://gitter.im/sunrise-php/support)
43
[![Build Status](https://circleci.com/gh/sunrise-php/http-client-curl.svg?style=shield)](https://circleci.com/gh/sunrise-php/http-client-curl)
54
[![Code Coverage](https://scrutinizer-ci.com/g/sunrise-php/http-client-curl/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/sunrise-php/http-client-curl/?branch=master)
65
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/sunrise-php/http-client-curl/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/sunrise-php/http-client-curl/?branch=master)
7-
[![Total Downloads](https://poser.pugx.org/sunrise/http-client-curl/downloads)](https://packagist.org/packages/sunrise/http-client-curl)
8-
[![Latest Stable Version](https://poser.pugx.org/sunrise/http-client-curl/v/stable)](https://packagist.org/packages/sunrise/http-client-curl)
9-
[![License](https://poser.pugx.org/sunrise/http-client-curl/license)](https://packagist.org/packages/sunrise/http-client-curl)
6+
[![Total Downloads](https://poser.pugx.org/sunrise/http-client-curl/downloads?format=flat)](https://packagist.org/packages/sunrise/http-client-curl)
7+
[![Latest Stable Version](https://poser.pugx.org/sunrise/http-client-curl/v/stable?format=flat)](https://packagist.org/packages/sunrise/http-client-curl)
8+
[![License](https://poser.pugx.org/sunrise/http-client-curl/license?format=flat)](https://packagist.org/packages/sunrise/http-client-curl)
109

1110
---
1211

@@ -18,7 +17,7 @@ composer require sunrise/http-client-curl
1817

1918
## How to use?
2019

21-
### Sunrise HTTP Factory
20+
### Sunrise
2221

2322
```bash
2423
composer require sunrise/http-factory
@@ -33,7 +32,7 @@ $client = new Client(new ResponseFactory());
3332
$request = (new RequestFactory)->createRequest('GET', 'http://php.net/');
3433
$response = $client->sendRequest($request);
3534

36-
// just use PSR-7 Response object...
35+
// just use PSR-7 response...
3736
```
3837

3938
### Zend Diactoros
@@ -51,7 +50,7 @@ $client = new Client(new ResponseFactory());
5150
$request = (new RequestFactory)->createRequest('GET', 'http://php.net/');
5251
$response = $client->sendRequest($request);
5352

54-
// just use PSR-7 Response object...
53+
// just use PSR-7 response...
5554
```
5655

5756
### cURL options
@@ -70,14 +69,13 @@ $client = new Client(new ResponseFactory(), [
7069
$requests = [
7170
(new RequestFactory)->createRequest('GET', 'http://php.net/'),
7271
(new RequestFactory)->createRequest('GET', 'http://php.net/'),
73-
(new RequestFactory)->createRequest('GET', 'http://php.net/'),
7472
];
7573

7674
$client = new Client(new ResponseFactory());
7775
$responses = $client->sendRequests(...$request);
7876

7977
foreach ($responses as $response) {
80-
// just use PSR-7 Response object...
78+
// just use PSR-7 response...
8179
}
8280
```
8381

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@
5151
},
5252
"scripts": {
5353
"test": [
54-
"phpunit --colors=always --coverage-text",
55-
"phpcs"
54+
"phpcs",
55+
"XDEBUG_MODE=coverage phpunit --coverage-text"
56+
],
57+
"build": [
58+
"phpdoc -d src/ -t phpdoc/",
59+
"XDEBUG_MODE=coverage phpunit --coverage-html coverage/"
5660
]
5761
}
5862
}

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</include>
77
</coverage>
88
<testsuites>
9-
<testsuite name="Sunrise HTTP CURL Client Test Suite">
9+
<testsuite name="sunrise.http.curlClient.testSuite">
1010
<directory>./tests/</directory>
1111
</testsuite>
1212
</testsuites>

src/Client.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
use const CURLOPT_URL;
5757

5858
/**
59-
* HTTP Client based on cURL
59+
* HTTP client based on cURL
6060
*
6161
* @link http://php.net/manual/en/intro.curl.php
6262
* @link https://curl.haxx.se/libcurl/c/libcurl-errors.html
@@ -69,15 +69,11 @@ class Client implements ClientInterface
6969
{
7070

7171
/**
72-
* Response Factory
73-
*
7472
* @var ResponseFactoryInterface
7573
*/
7674
protected $responseFactory;
7775

7876
/**
79-
* cURL options
80-
*
8177
* @var array
8278
*/
8379
protected $curlOptions;
@@ -97,7 +93,7 @@ public function __construct(
9793
}
9894

9995
/**
100-
* {@inheritDoc}
96+
* {@inheritdoc}
10197
*/
10298
public function sendRequest(RequestInterface $request) : ResponseInterface
10399
{
@@ -139,7 +135,7 @@ public function sendRequests(RequestInterface ...$requests) : array
139135
}
140136

141137
do {
142-
curl_multi_exec($curlMultiHandle, $active);
138+
curl_multi_exec($curlMultiHandle, $active);
143139
} while ($active);
144140

145141
$responses = [];
@@ -155,7 +151,7 @@ public function sendRequests(RequestInterface ...$requests) : array
155151
}
156152

157153
/**
158-
* Creates CurlHandle using the given Request
154+
* Creates CurlHandle using the given request
159155
*
160156
* @param RequestInterface $request
161157
*
@@ -194,7 +190,7 @@ private function createCurlHandleFromRequest(RequestInterface $request)
194190
}
195191

196192
/**
197-
* Creates Response using the given CurlHandle
193+
* Creates response using the given CurlHandle
198194
*
199195
* @param resource $curlHandle
200196
*
@@ -225,7 +221,7 @@ private function createResponseFromCurlHandle($curlHandle) : ResponseInterface
225221
}
226222

227223
/**
228-
* Fills the given Response with the header fields using the given header
224+
* Fills the given response with the header fields using the given header
229225
*
230226
* @param ResponseInterface $response
231227
* @param string $header

src/Exception/ClientException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
/**
1515
* Import classes
1616
*/
17-
use RuntimeException;
1817
use Psr\Http\Client\ClientExceptionInterface;
18+
use RuntimeException;
1919

2020
/**
2121
* ClientException

0 commit comments

Comments
 (0)