| Total Complexity | 12 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 4 | abstract class AbstractResponse |
||
| 5 | { |
||
| 6 | protected $endpoint; |
||
| 7 | protected $data; |
||
| 8 | protected $method; |
||
| 9 | protected $response; // \WebServCo\Framework\Http\Response |
||
| 10 | protected $status; |
||
| 11 | |||
| 12 | public function __construct($endpoint, $method, \WebServCo\Framework\Http\Response $response) |
||
| 13 | { |
||
| 14 | $this->endpoint = $endpoint; |
||
| 15 | $this->method = $method; |
||
| 16 | $this->response = $response; |
||
| 17 | $this->status = $this->response->getStatus(); |
||
| 18 | $this->data = $this->processResponseData(); |
||
| 19 | } |
||
| 20 | |||
| 21 | public function getData() |
||
| 22 | { |
||
| 23 | return $this->data; |
||
| 24 | } |
||
| 25 | |||
| 26 | public function getEndpoint() |
||
| 27 | { |
||
| 28 | return $this->endpoint; |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getMethod() |
||
| 32 | { |
||
| 33 | return $this->method; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getStatus() |
||
| 39 | } |
||
| 40 | |||
| 41 | protected function processResponseData() |
||
| 70 | } |
||
| 71 | } |
||
| 72 | } |
||
| 73 |