Code Duplication    Length = 13-13 lines in 2 locations

src/Commands/AdminCommands/CleanupCommand.php 1 location

@@ 350-362 (lines=13) @@
347
     *
348
     * @return \Longman\TelegramBot\Entities\ServerResponse
349
     */
350
    public function executeNoDb()
351
    {
352
        $message = $this->getMessage();
353
        $chat_id = $message->getChat()->getId();
354
355
        $data = [
356
            'chat_id'    => $chat_id,
357
            'parse_mode' => 'Markdown',
358
            'text'       => '*No database connection!*',
359
        ];
360
361
        return Request::sendMessage($data);
362
    }
363
364
    /**
365
     * Command execute method

src/Commands/Command.php 1 location

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