![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/inventory.corals.io/vendor/php-http/message/src/Formatter/ |
<?php namespace Http\Message\Formatter; use Http\Message\Formatter; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; /** * Normalize a request or a response into a string or an array. * * @author Joel Wurtz <[email protected]> * @author Márk Sági-Kazár <[email protected]> */ class SimpleFormatter implements Formatter { /** * {@inheritdoc} */ public function formatRequest(RequestInterface $request) { return sprintf( '%s %s %s', $request->getMethod(), $request->getUri()->__toString(), $request->getProtocolVersion() ); } /** * {@inheritdoc} */ public function formatResponse(ResponseInterface $response) { return sprintf( '%s %s %s', $response->getStatusCode(), $response->getReasonPhrase(), $response->getProtocolVersion() ); } /** * Formats a response in context of its request. * * @return string */ public function formatResponseForRequest(ResponseInterface $response, RequestInterface $request) { return $this->formatResponse($response); } }