src/HTTPServer.php
protected function buildResponse(APIResponse $APIResponse, ResponseInterface $response): ResponseInterface
    {
        $response = $response->withStatus(200, "200 OK");
        $response = $response->withAddedHeader("Content-Type", $APIResponse->getMIMEType());
        $response = $response->withAddedHeader("Content-Length", $APIResponse->getAsDataStream()->getSize());
        $this->logger->debug("Responding to request successfully");
        return $response->withBody($APIResponse->getAsDataStream());
    }
protected function buildResponse(APIResponse $APIResponse, ResponseInterface $response): ResponseInterface
    {
        $response = $response->withStatus(200, "200 OK");
        $response = $response->withAddedHeader("Content-Type", $APIResponse->getMIMEType());
        $response = $response->withAddedHeader("Content-Length", $APIResponse->getAsDataStream()->getSize());
        $this->logger->debug("Responding to request successfully");
        return $response->withBody($APIResponse->getAsDataStream());
    }
protected function buildResponse ( APIResponse $ APIResponse , ResponseInterface $ response ) : ResponseInterface { $ response = $ response -> withStatus ( 200 , "200 OK" ) ; $ response = $ response -> withAddedHeader ( "Content-Type" , $ APIResponse -> getMIMEType ( ) ) ; $ response = $ response -> withAddedHeader ( "Content-Length" , $ APIResponse -> getAsDataStream ( ) -> getSize ( ) ) ; $ this -> logger -> debug ( "Responding to request successfully" ) ; return $ response -> withBody ( $ APIResponse -> getAsDataStream ( ) ) ; }
Takes an APIResponse and builds a PSR-7 Response
@param APIResponse $APIResponse
@param ResponseInterface $response
@return ResponseInterface
Takes an APIResponse and builds a PSR - 7 Response