public function send(ResponseInterface $response): ResponseInterface
    {
        $response->getBody()->write(json_encode($this->toArray()));
        return $response->withHeader('Content-Type', self::MIME_TYPE_JSON);
    }
public function send(ResponseInterface $response): ResponseInterface
    {
        $response->getBody()->write(json_encode($this->toArray()));
        return $response->withHeader('Content-Type', self::MIME_TYPE_JSON);
    }
public function send ( ResponseInterface $ response ) : ResponseInterface { $ response -> getBody ( ) -> write ( json_encode ( $ this -> toArray ( ) ) ) ; return $ response -> withHeader ( 'Content-Type' , self :: MIME_TYPE_JSON ) ; }
Adds this problem detail to a PSR-7 HTTP response.

@param ResponseInterface $response The HTTP response
@return ResponseInterface The new response
Adds this problem detail to a PSR - 7 HTTP response .