Conditions | 3 |
Paths | 2 |
Total Lines | 7 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
36 | 1 | public function uploadImage(string $path, string $type = 'icon') |
|
37 | { |
||
38 | 1 | if (!file_exists($path) || !is_readable($path)) { |
|
39 | 1 | throw new InvalidArgumentException(sprintf('File does not exist, or the file is unreadable: "%s"', $path)); |
|
40 | } |
||
41 | |||
42 | 1 | return $this->httpUpload('shakearound/material/add', ['media' => $path], [], ['type' => strtolower($type)]); |
|
43 | } |
||
45 |