for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Abstract Response
*/
namespace IBM\Watson\Common\Message;
*
* This abstract class implements ResponseInterface and defines a basic
* set of functions that all Watson Requests are intended to include.
* @see ResponseInterface
abstract class AbstractResponse implements ResponseInterface
{
* The embodied request object.
* @var RequestInterface
protected $request;
* The data contained in the response.
* @var mixed
protected $data;
* Create new Response object
* @param RequestInterface $request The initiating request
* @param mixed $data
public function __construct(RequestInterface $request, $data)
$this->request = $request;
$this->data = $data;
}
* Get the initiating request object.
* @return RequestInterface
public function getRequest()
return $this->request;
* Get the response data.
* @return mixed
public function getData()
return $this->data;
* Response message
* @return null|string A response message from the Watson service
public function getMessage()
return null;
* Response code
* @return null|string A response code from the Watson service
public function getCode()