1 | <?php |
||
21 | class Formatter implements MessageFormatter |
||
22 | { |
||
23 | /** |
||
24 | * @var MessageFormatter |
||
25 | */ |
||
26 | private $formatter; |
||
27 | |||
28 | /** |
||
29 | * @var CurlCommandFormatter |
||
30 | */ |
||
31 | private $curlFormatter; |
||
32 | |||
33 | /** |
||
34 | * @param MessageFormatter $formatter |
||
35 | * @param CurlCommandFormatter $curlFormatter |
||
36 | */ |
||
37 | 7 | public function __construct(MessageFormatter $formatter, CurlCommandFormatter $curlFormatter) |
|
42 | |||
43 | /** |
||
44 | * Formats an exception. |
||
45 | * |
||
46 | * @param Exception $exception |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | 3 | public function formatException(Exception $exception) |
|
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | 1 | public function formatRequest(RequestInterface $request) |
|
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | 1 | 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 | 1 | public function formatAsCurlCommand(RequestInterface $request) |
|
90 | } |
||
91 |