1 | <?php |
||
7 | class FormConstructor |
||
8 | { |
||
9 | /** |
||
10 | * @param TelegramMethods $method |
||
11 | * @return mixed |
||
12 | */ |
||
13 | private function constructFormData(TelegramMethods $method): array |
||
33 | |||
34 | /** |
||
35 | * Can perform any special checks needed to be performed before sending the actual request to Telegram |
||
36 | * |
||
37 | * This will return an array with data that will be different in each case (for now). This can be changed in the |
||
38 | * future. |
||
39 | * |
||
40 | * @param TelegramMethods $method |
||
41 | * @return array |
||
42 | */ |
||
43 | private function checkSpecialConditions(TelegramMethods $method): array |
||
66 | |||
67 | /** |
||
68 | * Builds up a multipart form-like array for Guzzle |
||
69 | * |
||
70 | * @param array $data The original object in array form |
||
71 | * @param string $fileKeyName A file handler will be sent instead of a string, state here which field it is |
||
72 | * @param resource $stream The actual file handler |
||
73 | * @return array Returns the actual formdata to be sent |
||
74 | */ |
||
75 | private function buildMultipartFormData(array $data, string $fileKeyName, $stream): array |
||
99 | } |
||
100 |