Conditions | 4 |
Paths | 5 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
16 | public function dump(MessageInterface $message, array $headers): void |
||
17 | { |
||
18 | if (!$this->supports($message)) { |
||
19 | throw new UnsupportedMessage($message, RequestInterface::class); |
||
20 | } |
||
21 | |||
22 | echo "\n"; |
||
23 | |||
24 | printf(self::TEMPLATE, 'Request', "{$message->getMethod()} {$message->getUri()}"); |
||
2 ignored issues
–
show
|
|||
25 | |||
26 | foreach ($headers as $header) { |
||
27 | printf(self::TEMPLATE, "Request {$header}", $message->getHeaderLine($header)); |
||
28 | } |
||
29 | |||
30 | $body = (string) $message->getBody(); |
||
31 | |||
32 | if (!empty($body)) { |
||
33 | echo "\n{$body}"; |
||
34 | } |
||
35 | |||
36 | echo "\n"; |
||
37 | } |
||
44 |