Conditions | 4 |
Paths | 5 |
Total Lines | 25 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
14 | public function dump(MessageInterface $message, array $headers): void |
||
15 | { |
||
16 | if (!$this->supports($message)) { |
||
17 | throw new UnsupportedMessage($message, RequestInterface::class); |
||
18 | } |
||
19 | |||
20 | // mandatory, clearing the line |
||
21 | // todo : check how to clear without this echo... |
||
22 | echo "\n"; |
||
23 | |||
24 | $dump = [ |
||
25 | 'Request' => "{$message->getMethod()} {$message->getUri()}", |
||
2 ignored issues
–
show
|
|||
26 | ]; |
||
27 | |||
28 | foreach ($headers as $header) { |
||
29 | $dump["Request {$header}"] = $message->getHeaderLine($header); |
||
30 | } |
||
31 | |||
32 | $body = (string) $message->getBody(); |
||
33 | |||
34 | if (!empty($body)) { |
||
35 | $dump['Request Body'] = $body; |
||
36 | } |
||
37 | |||
38 | SfDumper::dump($dump); |
||
39 | } |
||
48 |