@@ -7,10 +7,24 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | trait UploaderTrait |
| 9 | 9 | { |
| 10 | + /** |
|
| 11 | + * @param string $endpoint |
|
| 12 | + */ |
|
| 10 | 13 | abstract public function getAsync($endpoint, array $params = [], $return_response_object = false); |
| 14 | + |
|
| 15 | + /** |
|
| 16 | + * @param string $endpoint |
|
| 17 | + */ |
|
| 11 | 18 | abstract public function postAsync($endpoint, array $params = [], $return_response_object = false); |
| 19 | + |
|
| 20 | + /** |
|
| 21 | + * @param string $endpoint |
|
| 22 | + */ |
|
| 12 | 23 | abstract public function postMultipartAsync($endpoint, array $params = [], $return_response_object = false); |
| 13 | 24 | |
| 25 | + /** |
|
| 26 | + * @param integer $value |
|
| 27 | + */ |
|
| 14 | 28 | protected static function validateChunkSize($value) |
| 15 | 29 | { |
| 16 | 30 | if (false === $value = filter_var($value, FILTER_VALIDATE_INT)) { |
@@ -30,6 +44,9 @@ discard block |
||
| 30 | 44 | return $type; |
| 31 | 45 | } |
| 32 | 46 | |
| 47 | + /** |
|
| 48 | + * @param string $media_category |
|
| 49 | + */ |
|
| 33 | 50 | public function uploadAsync(\SplFileObject $file, $media_category = null, callable $on_progress = null, $chunk_size = 300000) |
| 34 | 51 | { |
| 35 | 52 | $chunk_size = static::validateChunkSize($chunk_size); |