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 RequestInterface and defines a basic
* set of functions that all IBM Watson responses are intended to include.
*
* Requests of this class are usually created using the createRequest
* function of the client and then actioned using methods within this
* class or a class that extends this.
* @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;
* Constructor
* @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;
* Get response message
* @return null|string A response message from the API
public function getMessage()
return null;
* Response code
* @return null|string A response code from the API
public function getCode()