| Conditions | 4 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 57 | 3 | public function get($path, array $options = []) |
|
| 58 | { |
||
| 59 | 3 | if ($this->app_client) { |
|
| 60 | 3 | $options['headers'] = array_merge( |
|
| 61 | 3 | ['User-Agent' => $this->app_client], |
|
| 62 | 3 | isset($options['headers']) ? $options['headers'] : [] |
|
| 63 | ); |
||
| 64 | } |
||
| 65 | |||
| 66 | try { |
||
| 67 | 3 | $response = $this->client->request('GET', $this->host.$path, $options); |
|
| 68 | 1 | } catch (\Exception $e) { |
|
| 69 | 1 | throw $this->detector->wrap($e); |
|
| 70 | } |
||
| 71 | |||
| 72 | 2 | return $this->detector->detect($response); |
|
| 73 | } |
||
| 75 |