1 | <?php |
||
23 | class Bot |
||
24 | { |
||
25 | /** |
||
26 | * @var mixed |
||
27 | */ |
||
28 | private $state; |
||
29 | /** |
||
30 | * @var BaseConfig |
||
31 | */ |
||
32 | private $config; |
||
33 | |||
34 | /** |
||
35 | * Bot constructor. |
||
36 | * @param null|string $token |
||
37 | * @param array $options |
||
38 | * @throws TelegramCoreException |
||
39 | */ |
||
40 | 3 | public function __construct($token = null, $options = []) |
|
51 | |||
52 | /** |
||
53 | * @return mixed |
||
54 | */ |
||
55 | 1 | public function getState() |
|
59 | |||
60 | public function message() |
||
64 | |||
65 | /** |
||
66 | * @return User |
||
67 | */ |
||
68 | 1 | public function getMe() |
|
74 | |||
75 | 1 | public function send($method, $params = []) |
|
82 | |||
83 | public function setConfig(BaseConfig $config) |
||
87 | } |
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: