| Conditions | 5 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function handleUpdate(Update $update) |
||
| 23 | { |
||
| 24 | $message = json_decode(json_encode($update->message), true); |
||
| 25 | |||
| 26 | switch ($message['text']) { |
||
| 27 | case "/about": |
||
| 28 | case "/about@{$this->config['bot_name']}": |
||
| 29 | $text = "I'm a Buktopuha Telegram Bot"; |
||
| 30 | break; |
||
| 31 | case "/help": |
||
| 32 | case "/help@{$this->config['bot_name']}": |
||
| 33 | default : |
||
|
|
|||
| 34 | $text = "Command List:\n"; |
||
| 35 | $text .= "/about - About this bot\n"; |
||
| 36 | $text .= "/help - show this help message\n"; |
||
| 37 | break; |
||
| 38 | } |
||
| 39 | |||
| 40 | $this->telegramBotApi->sendMessage($message['chat']['id'], $text); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
As per the PSR-2 coding standard, there must not be a space in front of the colon in the default statement.
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.