Skip to content

Commit

Permalink
Merge pull request #212 from phil-davis/build-status-badge
Browse files Browse the repository at this point in the history
[docs-only] Build status badge
  • Loading branch information
phil-davis authored Jun 27, 2023
2 parents 2e91463 + 866a5ab commit fcc83fa
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ The objects are extendable and easily mockable.

Build status
------------
![Build Status](https://github.com/sabre-io/http/actions/workflows/ci.yml/badge.svg)

| release | minimum PHP version |
|---------|---------------------|
| master | PHP 7.4 |
| 7.0 | PHP 7.4 |
| 6.0 | PHP 7.4 |
| 5.1 | PHP 7.1 |
| 4.2 | PHP 5.4 |
| 3.0 | PHP 5.4 |

| branch | status |
|--------|---------------------------------------------------------------------------------------------------------------|
| master | [![Build Status](https://travis-ci.org/sabre-io/http.svg?branch=master)](https://travis-ci.org/sabre-io/http) |
| 4.2 | [![Build Status](https://travis-ci.org/sabre-io/http.svg?branch=4.2)](https://travis-ci.org/sabre-io/http) |
| 3.0 | [![Build Status](https://travis-ci.org/sabre-io/http.svg?branch=3.0)](https://travis-ci.org/sabre-io/http) |

Installation
------------
Expand Down Expand Up @@ -123,7 +128,7 @@ Decorators
----------

It may be useful to extend the `Request` and `Response` objects in your
application, if you for example would like them to carry a bit more
application, if you, for example, would like them to carry a bit more
information about the current request.

For instance, you may want to add an `isLoggedIn` method to the Request
Expand All @@ -139,7 +144,7 @@ Simply extending Request and Response may pose some problems:
`Response` instances in your library or application, you make it harder to
work with other applications which also use `sabre/http`.

In short: it would be bad design. Instead, it's recommended to use the
In short, it would be bad design. Instead, it's recommended to use the
[decorator pattern][6] to add new behavior where you need it. `sabre/http`
provides helper classes to quickly do this.

Expand Down Expand Up @@ -172,7 +177,7 @@ all we need to do is:
$request = new MyRequest($request);
```

And that's it, we now have an `isLoggedIn` method, without having to mess
And that's it; we now have an `isLoggedIn` method, without having to mess
with the core instances.


Expand Down Expand Up @@ -200,14 +205,14 @@ $response = $client->send($request);
echo $response->getBodyAsString();
```

The client emits 3 event using [`sabre/event`][5]. `beforeRequest`,
The client emits 3 events using [`sabre/event`][5]. `beforeRequest`,
`afterRequest` and `error`.

```php
$client = new HTTP\Client();
$client->on('beforeRequest', function($request) {

// You could use beforeRequest to for example inject a few extra headers.
// You could use beforeRequest to, for example, inject a few extra headers
// into the Request object.

});
Expand Down Expand Up @@ -244,7 +249,7 @@ $client->on('error:401', function($request, $response, &$retry, $retryCount) {
### Asynchronous requests

The `Client` also supports doing asynchronous requests. This is especially handy
if you need to perform a number of requests, that are allowed to be executed
if you need to perform a number of requests that are allowed to be executed
in parallel.

The underlying system for this is simply [cURL's multi request handler][8],
Expand Down Expand Up @@ -321,8 +326,8 @@ $response = $client->send($subRequest);
Sapi::sendResponse($response);
```

The Request and Response API's
------------------------------
The Request and Response APIs
-----------------------------

### Request

Expand Down Expand Up @@ -444,8 +449,8 @@ function getPostData();
*
* This is equivalent to PHP's $_POST superglobal.
*
* This would not have been needed, if POST data was accessible as
* php://input, but unfortunately we need to special case it.
* This would not have been needed if POST data was accessible as
* php://input, but unfortunately we need to special-case it.
*
* @param array $postData
* @return void
Expand Down Expand Up @@ -603,7 +608,7 @@ function getStatus();
* Sets the HTTP status code.
*
* This can be either the full HTTP status code with human-readable string,
* for example: "403 I can't let you do that, Dave".
* for example, "403 I can't let you do that, Dave".
*
* Or just the code, in which case the appropriate default message will be
* added.
Expand Down

0 comments on commit fcc83fa

Please sign in to comment.