Code Duplication    Length = 13-13 lines in 2 locations

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

src/Commands/AdminCommands/CleanupCommand.php 1 location

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