Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 14 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
47 | View Code Duplication | public function execute() |
|
|
|||
48 | { |
||
49 | $message = $this->getMessage(); |
||
50 | |||
51 | $chat_id = $message->getChat()->getId(); |
||
52 | $text = 'Hi there!' . PHP_EOL . 'Type /help to see all commands!'; |
||
53 | |||
54 | $data = [ |
||
55 | 'chat_id' => $chat_id, |
||
56 | 'text' => $text, |
||
57 | ]; |
||
58 | |||
59 | return Request::sendMessage($data); |
||
60 | } |
||
61 | } |
||
62 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.