1 | <?php |
||
11 | class ServerResponse extends Entity |
||
12 | { |
||
13 | /** |
||
14 | * @var bool |
||
15 | */ |
||
16 | protected $ok; |
||
17 | |||
18 | /** |
||
19 | * @var null |
||
20 | */ |
||
21 | protected $result; |
||
22 | |||
23 | /** |
||
24 | * @var null |
||
25 | */ |
||
26 | protected $error_code; |
||
27 | |||
28 | /** |
||
29 | * @var null |
||
30 | */ |
||
31 | protected $description; |
||
32 | |||
33 | /** |
||
34 | * ServerResponse constructor. |
||
35 | * |
||
36 | * @param array $data |
||
37 | * @param $bot_name |
||
38 | * |
||
39 | * @throws \Longman\TelegramBot\Exception\TelegramException |
||
40 | */ |
||
41 | 14 | public function __construct(array $data, $bot_name) |
|
108 | |||
109 | /** |
||
110 | * Check if array is associative |
||
111 | * |
||
112 | * @param array $array |
||
113 | * @return bool |
||
114 | */ |
||
115 | 11 | protected function isAssoc(array $array) |
|
119 | |||
120 | /** |
||
121 | * If response is ok |
||
122 | * |
||
123 | * @return bool |
||
124 | */ |
||
125 | 5 | public function isOk() |
|
129 | |||
130 | /** |
||
131 | * Get result |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | 14 | public function getResult() |
|
139 | |||
140 | /** |
||
141 | * Get error code |
||
142 | * |
||
143 | * @return string |
||
144 | */ |
||
145 | 5 | public function getErrorCode() |
|
149 | |||
150 | /** |
||
151 | * Get description |
||
152 | * |
||
153 | * @return null |
||
154 | */ |
||
155 | 5 | public function getDescription() |
|
159 | |||
160 | /** |
||
161 | * Print error |
||
162 | * |
||
163 | * @return string |
||
164 | */ |
||
165 | public function printError() |
||
169 | } |
||
170 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..