Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public function uploadFile(string $file): array |
||
20 | { |
||
21 | $response = $this->client->request('POST', $this->url('uploads'), [ |
||
22 | RequestOptions::BODY => file_get_contents($file), |
||
23 | RequestOptions::HEADERS => [ |
||
24 | 'Content-Type' => 'application/octet-stream', |
||
25 | 'Authorization' => 'Bearer ' . $this->config['tokens']['management'], |
||
26 | ], |
||
27 | ]); |
||
28 | |||
29 | return $this->decodeResponse($response); |
||
30 | } |
||
32 |