Code Duplication    Length = 13-13 lines in 2 locations

src/Commands/AdminCommands/CleanupCommand.php 1 location

@@ 331-343 (lines=13) @@
328
     *
329
     * @return \Longman\TelegramBot\Entities\ServerResponse
330
     */
331
    public function executeNoDb()
332
    {
333
        $message = $this->getMessage();
334
        $chat_id = $message->getChat()->getId();
335
336
        $data = [
337
            'chat_id'    => $chat_id,
338
            'parse_mode' => 'Markdown',
339
            'text'       => '*No database connection!*',
340
        ];
341
342
        return Request::sendMessage($data);
343
    }
344
345
    /**
346
     * Command execute method

src/Commands/Command.php 1 location

@@ 190-202 (lines=13) @@
187
     * @return \Longman\TelegramBot\Entities\ServerResponse
188
     * @throws \Longman\TelegramBot\Exception\TelegramException
189
     */
190
    public function executeNoDb()
191
    {
192
        //Preparing message
193
        $message = $this->getMessage();
194
        $chat_id = $message->getChat()->getId();
195
196
        $data = [
197
            'chat_id' => $chat_id,
198
            'text'    => 'Sorry no database connection, unable to execute "' . $this->name . '" command.',
199
        ];
200
201
        return Request::sendMessage($data);
202
    }
203
204
    /**
205
     * Get update object