Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 3 | ||
Bugs | 1 | Features | 2 |
1 | <?php |
||
48 | 2 | public function upload($file) |
|
49 | { |
||
50 | 2 | if (false === file_exists($file)) |
|
51 | { |
||
52 | 1 | 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-glossary'), ['multipart' => $data]); |
|
62 | } |
||
63 | } |
||
64 |