Skip to content

Commit d571551

Browse files
committed
:octocat:
1 parent ef9533b commit d571551

File tree

1 file changed

+32
-13
lines changed

1 file changed

+32
-13
lines changed

README.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,18 @@ Profit!
5454

5555
## API
5656

57-
### [PSR-7](https://www.php-fig.org/psr/psr-7/) Message helpers
58-
These static methods can be found in the `chillerlan\HTTP\Psr7` namespace, along with implementations for each of the PSR-7 interfaces:
57+
### [PSR-7](https://www.php-fig.org/psr/psr-7/) Message interfaces & helpers
58+
PSR-7 interface | class/signature
59+
----------------|----------------
60+
`RequestInterface` | `Request(string $method, $uri, array $headers = null, $body = null, string $version = null)`
61+
`ServerRequestInterface` | `ServerRequest(string $method, $uri, array $headers = null, $body = null, string $version = null, array $serverParams = null)`
62+
`ResponseInterface` | `Response(int $status = null, array $headers = null, $body = null, string $version = null, string $reason = null)`
63+
`StreamInterface` | `Stream($stream)`
64+
`StreamInterface` | `MultipartStream(array $elements = null, string $boundary = null)`
65+
`UploadedFileInterface` | `UploadedFile($file, int $size, int $error = UPLOAD_ERR_OK, string $filename = null, string $mediaType = null)`
66+
`UriInterface` | `Uri(string $uri = null)`
67+
68+
These static helper methods can be found in the `chillerlan\HTTP\Psr7` namespace:
5969

6070
function | description
6171
---------|------------
@@ -75,13 +85,13 @@ function | description
7585
### [PSR-15](https://www.php-fig.org/psr/psr-15/) Request handlers and middleware
7686
These classes can be found in the `chillerlan\HTTP\Psr15` namespace:
7787

78-
class | PSR-15 type | description
79-
------|-------------|------------
80-
`EmptyResponseHandler` | `RequestHandlerInterface` |
81-
`QueueRunner` | `RequestHandlerInterface` | utilized by `QueueRequestHandler`
82-
`QueueRequestHandler` | `RequestHandlerInterface`, `MiddlewareInterface` |
83-
`PriorityQueueRequestHandler` | `RequestHandlerInterface`, `MiddlewareInterface` | extends `QueueRequestHandler`
84-
`PriorityMiddleware` | `MiddlewareInterface` | implements `PriorityMiddlewareInterface`
88+
PSR-15 interface | class/signature
89+
-----------------|----------------
90+
`RequestHandlerInterface` | `EmptyResponseHandler(ResponseFactoryInterface $responseFactory, int $status)`
91+
`RequestHandlerInterface` | `QueueRunner(array $middlewareStack, RequestHandlerInterface $fallbackHandler)`
92+
`RequestHandlerInterface`, `MiddlewareInterface` | `QueueRequestHandler(iterable $middlewareStack = null, RequestHandlerInterface $fallbackHandler = null)`
93+
`RequestHandlerInterface`, `MiddlewareInterface` | `PriorityQueueRequestHandler(iterable $middlewareStack = null, RequestHandlerInterface $fallbackHandler = null)`
94+
`MiddlewareInterface` | `PriorityMiddleware(MiddlewareInterface $middleware, int $priority = null)`
8595

8696
#### QueueRequestHandler example
8797

@@ -105,8 +115,17 @@ $response = $handler->handle($serverRequestInterface);
105115
```
106116
The `PriorityQueueRequestHandler` works similar, with the difference that it also accepts `PriorityMiddlewareInterface` in the middleware stack, which allows you to specify a priority to control the order of execution.
107117

108-
### [PSR-17](https://www.php-fig.org/psr/psr-17/) Factory helpers
109-
These static methods can be found in the `chillerlan\HTTP\Psr17` namespace, along with implementations for each of the PSR-17 interfaces:
118+
### [PSR-17](https://www.php-fig.org/psr/psr-17/) Factories & helpers
119+
PSR-17 interface | class/signature
120+
-----------------|----------------
121+
`RequestFactoryInterface` | `RequestFactory()`
122+
`ResponseFactoryInterface` | `ResponseFactory()`
123+
`ServerRequestFactoryInterface` | `ServerRequestFactory()`
124+
`StreamFactoryInterface` | `StreamFactory()`
125+
`UploadedFileFactoryInterface` | `UploadedFileFactory()`
126+
`UriFactoryInterface` | `UriFactory()`
127+
128+
These static methods can be found in the `chillerlan\HTTP\Psr17` namespace:
110129

111130
function | description
112131
---------|------------
@@ -118,8 +137,8 @@ function | description
118137
### [PSR-18](https://www.php-fig.org/psr/psr-18/) HTTP Clients
119138
These classes can be found in the `chillerlan\HTTP\Psr18` namespace:
120139

121-
class | description
122-
------|------------
140+
class/signature | description
141+
----------------|------------
123142
`CurlClient` | a native cURL client
124143
`StreamClient` | a client that uses PHP's stream methods (still requires cURL)
125144
`URLExtractor` | a client that resolves shortened links (such as `t.co` or `goo.gl`) and returns the response for the last (deepest) URL

0 commit comments

Comments
 (0)