| Total Complexity | 6 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class telegram extends request { |
||
| 11 | public function __call (string $name, array $arguments) { |
||
| 12 | if (!isset($arguments[1]) && isset($arguments[0]) && is_array($arguments[0])) { |
||
| 13 | return request::$name(...$arguments[0]); |
||
| 14 | } |
||
| 15 | else { |
||
| 16 | return request::$name(...$arguments); |
||
| 17 | } |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * download telegram file with file_id to destination location |
||
| 22 | * |
||
| 23 | * It has 20MB download limit(same as telegram) |
||
| 24 | * |
||
| 25 | * e.g. => tools::downloadFile('test.mp4'); |
||
| 26 | * |
||
| 27 | * e.g. => tools::downloadFile('test.mp4','file_id_asdadadadadadad); |
||
| 28 | * |
||
| 29 | * @param string|null $destination destination for save the file |
||
| 30 | * @param string|null $file_id file_id for download, if not set, will generate by request::catchFields method |
||
| 31 | * |
||
| 32 | * @return bool |
||
| 33 | */ |
||
| 34 | public static function downloadFile(string|null $destination = null, string|null $file_id = null): bool { |
||
| 42 | } |
||
| 43 | } |
||
| 44 | } |