| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | final class ImagesEndpoint extends ResourceEndpoint |
||
| 19 | { |
||
| 20 | /** @use ListEndpointTrait<Image> */ |
||
| 21 | use ListEndpointTrait; |
||
| 22 | use GetEndpointTrait; |
||
| 23 | |||
| 24 | public function __construct(DigiSign $parent) |
||
| 25 | { |
||
| 26 | parent::__construct($parent, '/api/images', Image::class); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function upload(FileStream $image, bool $public = false): Image |
||
| 30 | { |
||
| 31 | $multipart = ['image' => $image, 'public' => ($public ? 'true' : 'false')]; |
||
| 32 | |||
| 33 | return $this->makeResource($this->postRequest('', ['multipart' => $multipart])); |
||
|
|
|||
| 34 | } |
||
| 35 | |||
| 36 | public function content(string $id): FileResponse |
||
| 39 | } |
||
| 40 | } |
||
| 41 |