-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathFormatter.php
35 lines (31 loc) · 1012 Bytes
/
Formatter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace Http\Message;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Formats a request and/or a response as a string.
*
* @author Márk Sági-Kazár <[email protected]>
*
* The formatResponseForRequest method will be added to this interface in the next major version, replacing the formatRequest method.
* Meanwhile, callers SHOULD check the formatter for the existence of formatResponseForRequest and call that if available.
*
* @method string formatResponseForRequest(ResponseInterface $response, RequestInterface $request) Formats a response in context of its request.
*/
interface Formatter
{
/**
* Formats a request.
*
* @return string
*/
public function formatRequest(RequestInterface $request);
/**
* @deprecated since 1.13, use formatResponseForRequest() instead
*
* Formats a response.
*
* @return string
*/
public function formatResponse(ResponseInterface $response);
}