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