1 | <?php |
||
21 | class Formatter implements MessageFormatter |
||
22 | { |
||
23 | /** |
||
24 | * @var MessageFormatter |
||
25 | */ |
||
26 | private $formatter; |
||
27 | |||
28 | /** |
||
29 | 6 | * @var CurlCommandFormatter |
|
30 | */ |
||
31 | 6 | private $curlFormatter; |
|
32 | 6 | ||
33 | /** |
||
34 | * @param MessageFormatter $formatter |
||
35 | * @param CurlCommandFormatter $curlFormatter |
||
36 | */ |
||
37 | public function __construct(MessageFormatter $formatter, CurlCommandFormatter $curlFormatter) |
||
42 | |||
43 | 3 | /** |
|
44 | 1 | * Formats an exception. |
|
45 | * |
||
46 | * @param Exception $exception |
||
47 | 2 | * |
|
48 | 1 | * @return string |
|
49 | */ |
||
50 | public function formatException(Exception $exception) |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | 1 | */ |
|
66 | public function formatRequest(RequestInterface $request) |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function formatResponse(ResponseInterface $response) |
||
78 | |||
79 | /** |
||
80 | * Format a RequestInterface as a cURL command. |
||
81 | * |
||
82 | * @param RequestInterface $request |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | public function formatAsCurlCommand(RequestInterface $request) |
||
90 | } |
||
91 |