1 | <?php |
||
10 | class FormConstructor |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $formType = ''; |
||
16 | |||
17 | /** |
||
18 | * @param TelegramMethods $method |
||
19 | * @return mixed |
||
20 | */ |
||
21 | public function constructFormData(TelegramMethods $method): array |
||
41 | |||
42 | /** |
||
43 | * Can perform any special checks needed to be performed before sending the actual request to Telegram |
||
44 | * |
||
45 | * This will return an array with data that will be different in each case (for now). This can be changed in the |
||
46 | * future. |
||
47 | * |
||
48 | * @param TelegramMethods $method |
||
49 | * @return array |
||
50 | */ |
||
51 | public function checkSpecialConditions(TelegramMethods $method): array |
||
72 | |||
73 | /** |
||
74 | * Builds up a multipart form-like array for Guzzle |
||
75 | * |
||
76 | * @param array $data The original object in array form |
||
77 | * @param string $fileKeyName A file handler will be sent instead of a string, state here which field it is |
||
78 | * @param resource $stream The actual file handler |
||
79 | * @return array Returns the actual formdata to be sent |
||
80 | */ |
||
81 | 2 | public function buildMultipartFormData(array $data, string $fileKeyName, $stream): array |
|
105 | } |
||
106 |