Code Duplication    Length = 13-13 lines in 2 locations

src/Commands/AdminCommands/CleanupCommand.php 1 location

@@ 336-348 (lines=13) @@
333
     *
334
     * @return \Longman\TelegramBot\Entities\ServerResponse
335
     */
336
    public function executeNoDb()
337
    {
338
        $message = $this->getMessage();
339
        $chat_id = $message->getChat()->getId();
340
341
        $data = [
342
            'chat_id'    => $chat_id,
343
            'parse_mode' => 'Markdown',
344
            'text'       => '*No database connection!*',
345
        ];
346
347
        return Request::sendMessage($data);
348
    }
349
350
    /**
351
     * 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