Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
47 | 2 | public function execute() |
|
48 | { |
||
49 | 2 | $message = $this->getMessage(); |
|
50 | 2 | $chat_id = $message->getChat()->getId(); |
|
51 | 2 | $text = trim($message->getText(true)); |
|
52 | |||
53 | 2 | if ($text === '') { |
|
54 | 1 | $text = 'Command usage: ' . $this->getUsage(); |
|
55 | } |
||
56 | |||
57 | $data = [ |
||
58 | 2 | 'chat_id' => $chat_id, |
|
59 | 2 | 'text' => $text, |
|
60 | ]; |
||
61 | |||
62 | 2 | return Request::sendMessage($data); |
|
63 | } |
||
64 | } |
||
65 |