| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 4 | ||
| Bugs | 1 | Features | 2 |
| 1 | <?php |
||
| 48 | 1 | public function upload($file) |
|
| 49 | { |
||
| 50 | 1 | if (false === file_exists($file)) |
|
| 51 | { |
||
| 52 | throw new \UnexpectedValueException('File not found for upload'); |
||
| 53 | } |
||
| 54 | |||
| 55 | $data = [[ |
||
| 56 | 1 | 'name' => 'file', |
|
| 57 | 1 | 'contents' => fopen($file, 'r') |
|
| 58 | ]]; |
||
| 59 | |||
| 60 | 1 | return $this->getHttpClient() |
|
| 61 | 1 | ->post($this->getBasePath('upload-tm'), ['multipart' => $data]); |
|
| 62 | } |
||
| 63 | } |
||
| 64 |