1 | <?php |
||
19 | class Request |
||
20 | { |
||
21 | const METHOD_GET = 'GET'; |
||
22 | |||
23 | const CONTENT_TYPE_MULTIPART = 'Content-Type:multipart/form-data'; |
||
24 | |||
25 | protected $ch; |
||
26 | |||
27 | /** |
||
28 | * @var Config $config Instance of configuration class |
||
29 | */ |
||
30 | protected $config; |
||
31 | |||
32 | /** |
||
33 | * Constructs the Request object. |
||
34 | * |
||
35 | * @param Config $config |
||
36 | */ |
||
37 | public function __construct(Config $config) |
||
41 | |||
42 | /** |
||
43 | * Destructs current object and closes CURL session. |
||
44 | */ |
||
45 | public function __destruct() |
||
51 | |||
52 | /** |
||
53 | * Executes the Request to Telegram's servers and returns Response object. |
||
54 | * |
||
55 | * @param AbstractMethod $method Teebot method's instance to get arguments from |
||
56 | * @param null|AbstractEntity $parent Parent entity that initiated the Request |
||
57 | * |
||
58 | * @return null|Response |
||
59 | */ |
||
60 | public function exec(AbstractMethod $method, $parent = null) |
||
67 | |||
68 | /** |
||
69 | * Prepares parameters that are required for sending and performs sending to Telegram's |
||
70 | * servers via CURL and returns the result from CURL. |
||
71 | * |
||
72 | * @param AbstractMethod $methodInstance |
||
73 | * |
||
74 | * @return mixed |
||
75 | */ |
||
76 | protected function sendRequest(AbstractMethod $methodInstance) |
||
111 | |||
112 | /** |
||
113 | * Creates the Response object from received data. |
||
114 | * |
||
115 | * @param string $receivedData Received data from Telegram's servers |
||
116 | * @param AbstractEntity $entityClass Entity that should be passed to Response constructor |
||
117 | * @param null|AbstractEntity $parent Parent entity |
||
118 | * |
||
119 | * @return null|Response |
||
120 | */ |
||
121 | public function createResponseFromData($receivedData, $entityClass, $parent = null) |
||
133 | |||
134 | /** |
||
135 | * Returns url for request to Telegram's bot API |
||
136 | * |
||
137 | * @param string $methodName The name of Telegram's method to query |
||
138 | * @param null|array $args Array of arguments to path to the method via GET string |
||
139 | * |
||
140 | * @return string |
||
141 | */ |
||
142 | protected function buildUrl($methodName, $args = null) |
||
158 | } |
||
159 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: