1 | <?php |
||
24 | class Bot |
||
25 | { |
||
26 | /** |
||
27 | * @var Bot |
||
28 | */ |
||
29 | private static $instance; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private $token; |
||
35 | |||
36 | /** |
||
37 | * Bot constructor. |
||
38 | * |
||
39 | * @param null|string $token |
||
40 | * @param array $options |
||
41 | * |
||
42 | * @throws TelegramCoreException |
||
43 | 3 | */ |
|
44 | public function __construct($token = null, $options = []) |
||
57 | |||
58 | /** |
||
59 | * @param string $method |
||
60 | * @param array $params |
||
61 | * |
||
62 | * @return array |
||
63 | 2 | */ |
|
64 | public function call($method, $params = []) |
||
73 | 1 | ||
74 | public function __call($name, $arguments) |
||
78 | 2 | ||
79 | private function prepareResponse(ResponseInterface $response) |
||
89 | |||
90 | 1 | private function buildResponse(array $response) |
|
94 | |||
95 | 1 | public function getMe() |
|
99 | |||
100 | /** |
||
101 | * @param MessageEntry $message |
||
102 | * @return Message |
||
103 | */ |
||
104 | public function sendMessage(MessageEntry $message): Message |
||
108 | |||
109 | public function sendTextMessage($to, $text) |
||
115 | |||
116 | public function testCall() |
||
130 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: