Skip to content

Commit 3831408

Browse files
committed
Merge branch 'develop'
2 parents d03c356 + 8b96dde commit 3831408

File tree

11 files changed

+49
-13
lines changed

11 files changed

+49
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [0.2] - 2021-06-23
8+
### Changed
9+
- Using stable dependency versions
10+
711
## [0.1] - 2021-06-23
812
Initial version.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# RebelCode - WP HTTP Client
22

3-
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/rebelcode/wp-http/Continuous%20Integration)
4-
![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/rebelcode/wp-http)
5-
![Packagist Version](https://img.shields.io/packagist/v/rebelcode/wp-http)
6-
![Packagist License](https://img.shields.io/packagist/l/rebelcode/wp-http)
3+
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/rebelcode/wp-http/Continuous%20Integration)][github-ci]
4+
[![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/rebelcode/wp-http)][packagist]
5+
[![Packagist Version](https://img.shields.io/packagist/v/rebelcode/wp-http)][packagist]
6+
[![Packagist License](https://img.shields.io/packagist/l/rebelcode/wp-http)][packagist]
77

88
A WordPress HTTP client that complies with the [PSR-7 HTTP Message][psr7] and [PSR-18 HTTP client][psr18] standards.
99

@@ -163,6 +163,8 @@ $stack = new HandlerStack($baseHandler, [
163163
]);
164164
```
165165

166+
[github-ci]: https://github.com/RebelCode/wp-http/actions/workflows/continuous-integration.yml
167+
[packagist]: https://packagist.org/packages/rebelcode/wp-http
166168
[psr7]: https://www.php-fig.org/psr/psr-7/
167169
[psr18]: https://www.php-fig.org/psr/psr-18/
168170
[guzzle]: https://github.com/guzzle/guzzle

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"require": {
1818
"php": ">=7.1",
1919
"psr/http-client": "^1.0",
20-
"rebelcode/psr7": "dev-master"
20+
"rebelcode/psr7": "^1.0"
2121
},
2222
"require-dev": {
2323
"phpunit/phpunit": "^7.0 | ^8.0 | ^9.0",

composer.lock

Lines changed: 4 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Exception/BadResponseException.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@
1616
*/
1717
class BadResponseException extends ResponseException
1818
{
19+
/**
20+
* Creates a bad response exception instance based on the status code of a response.
21+
*
22+
* @param RequestInterface $request The request that was dispatched to retrieve the response.
23+
* @param ResponseInterface $response The response.
24+
* @param Throwable|null $previous Optional previous exception.
25+
*
26+
* @return BadResponseException An appropriately created exception:
27+
* - a {@link ClientErrorException} for 4xx responses
28+
* - a {@link ServerErrorException} for 5xx responses
29+
* - a {@link BadResponseException} for other failed responses
30+
*/
1931
public static function create(
2032
RequestInterface $request,
2133
ResponseInterface $response,
@@ -54,7 +66,11 @@ public static function create(
5466
}
5567

5668
/**
57-
* Obfuscates URI if there is a username and a password present
69+
* Obfuscates URI if there is a username and a password present.
70+
*
71+
* @param UriInterface $uri The URI to obfuscate.
72+
*
73+
* @return UriInterface The obfuscated URI.
5874
*/
5975
protected static function obfuscateUri(UriInterface $uri): UriInterface
6076
{

src/Exception/RequestException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use Psr\Http\Message\RequestInterface;
88
use Throwable;
99

10+
/**
11+
* An exception that is thrown in relation to a request.
12+
*/
1013
class RequestException extends HttpException
1114
{
1215
/** @var RequestInterface */

src/Exception/ResponseException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Psr\Http\Message\ResponseInterface;
99
use Throwable;
1010

11+
/**
12+
* An exception that is thrown in relation to a request its corresponding response.
13+
*/
1114
class ResponseException extends RequestException
1215
{
1316
/** @var ResponseInterface */

src/HandlerInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use Psr\Http\Message\RequestInterface;
88
use Psr\Http\Message\ResponseInterface;
99

10+
/**
11+
* Interface for an object that can handle a request and provide a response for it.
12+
*/
1013
interface HandlerInterface
1114
{
1215
/**

src/HandlerStack.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
use RebelCode\WordPress\Http\Middleware\PrepareBody;
1111

1212
/**
13+
* A handler implementation that composes a base handler and a set of middleware handlers.
14+
*
1315
* @psalm-type MiddlewareFactory = callable(HandlerInterface): Middleware
1416
* @psalm-import-type WpHandlerOptions from WpHandler
1517
*/

src/WpClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
use RebelCode\Psr7\UriResolver;
1313

1414
/**
15+
* The PSR-18 client implementation.
16+
*
1517
* @psalm-import-type WpHandlerOptions from WpHandler
1618
*/
1719
class WpClient implements ClientInterface

0 commit comments

Comments
 (0)