| Conditions | 5 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function getResponse($url, $method, array $headers = [], $requestData = null) |
||
| 33 | { |
||
| 34 | foreach ($headers as $key => $value) { |
||
| 35 | $this->curlBrowser->setRequestHeader($key, $value); |
||
| 36 | } |
||
| 37 | switch ($method) { |
||
| 38 | case Method::POST: |
||
| 39 | $this->curlBrowser->setRequestContentType(Document::CONTENT_TYPE); |
||
| 40 | $this->curlBrowser->setRequestData($requestData); |
||
| 41 | break; |
||
| 42 | case Method::GET: |
||
| 43 | case Method::HEAD: |
||
| 44 | break; |
||
| 45 | default: |
||
| 46 | throw new \WebServCo\Framework\Exceptions\NotImplementedException('Functionality not implemented'); |
||
| 47 | break; |
||
| 48 | } |
||
| 49 | $this->curlBrowser->setMethod($method); |
||
| 50 | return $this->curlBrowser->retrieve($url); |
||
| 51 | } |
||
| 53 |