src/Exception/PingException.php
public function getResponse()
    {
        $response = new Response();

        $message = new Message();
        $message->setData(['message' => $this->getMessage()]);

        if (!empty($this->getPrivateKey())) {
            $message->setCertificate($this->getCertificate());
            $message->sign($this->getPrivateKey());
        }

        $response->getBody()->write(json_encode($message));

        return $response
            ->withStatus($this->getCode())
            ->withAddedHeader('Content-Type', 'application/json');
    }
public function getResponse()
    {
        $response = new Response();

        $message = new Message();
        $message->setData(['message' => $this->getMessage()]);

        if (!empty($this->getPrivateKey())) {
            $message->setCertificate($this->getCertificate());
            $message->sign($this->getPrivateKey());
        }

        $response->getBody()->write(json_encode($message));

        return $response
            ->withStatus($this->getCode())
            ->withAddedHeader('Content-Type', 'application/json');
    }
public function getResponse ( ) { $ response = new Response ( ) ; $ message = new Message ( ) ; $ message -> setData ( [ 'message' => $ this -> getMessage ( ) ] ) ; if ( ! empty ( $ this -> getPrivateKey ( ) ) ) { $ message -> setCertificate ( $ this -> getCertificate ( ) ) ; $ message -> sign ( $ this -> getPrivateKey ( ) ) ; } $ response -> getBody ( ) -> write ( json_encode ( $ message ) ) ; return $ response -> withStatus ( $ this -> getCode ( ) ) -> withAddedHeader ( 'Content-Type' , 'application/json' ) ; }
Returns a ResponseInterface method

@return \Psr\Http\Message\ResponseInterface
Returns a ResponseInterface method