@@ -54,8 +54,18 @@ Profit!
54
54
55
55
## API
56
56
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:
59
69
60
70
function | description
61
71
---------|------------
@@ -75,13 +85,13 @@ function | description
75
85
### [ PSR-15] ( https://www.php-fig.org/psr/psr-15/ ) Request handlers and middleware
76
86
These classes can be found in the ` chillerlan\HTTP\Psr15 ` namespace:
77
87
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) `
85
95
86
96
#### QueueRequestHandler example
87
97
@@ -105,8 +115,17 @@ $response = $handler->handle($serverRequestInterface);
105
115
```
106
116
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.
107
117
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:
110
129
111
130
function | description
112
131
---------|------------
@@ -118,8 +137,8 @@ function | description
118
137
### [ PSR-18] ( https://www.php-fig.org/psr/psr-18/ ) HTTP Clients
119
138
These classes can be found in the ` chillerlan\HTTP\Psr18 ` namespace:
120
139
121
- class | description
122
- ------|------------
140
+ class/signature | description
141
+ ---------------- |------------
123
142
` CurlClient ` | a native cURL client
124
143
` StreamClient ` | a client that uses PHP's stream methods (still requires cURL)
125
144
` 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