| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function import(string $projectKey, string $ext, string $body, array $params) |
||
|
|
|||
| 35 | { |
||
| 36 | $params['key'] = $projectKey; |
||
| 37 | $response = $this->httpPostRaw(sprintf('/api/import/%s?%s', $ext, http_build_query($params)), $body); |
||
| 38 | |||
| 39 | if (!$this->hydrator) { |
||
| 40 | return $response; |
||
| 41 | } |
||
| 42 | |||
| 43 | if ($response->getStatusCode() !== 200 && $response->getStatusCode() !== 201) { |
||
| 44 | $this->handleErrors($response); |
||
| 45 | } |
||
| 46 | |||
| 47 | return $this->hydrator->hydrate($response, Imported::class); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |