Code Duplication    Length = 10-10 lines in 2 locations

src/DB.php 2 locations

@@ 506-515 (lines=10) @@
503
        if ($update_type === 'message') {
504
            $message = $update->getMessage();
505
506
            if (self::insertMessageRequest($message)) {
507
                $message_id = $message->getMessageId();
508
                $chat_id = $message->getChat()->getId();
509
510
                return self::insertTelegramUpdate(
511
                    $update_id,
512
                    $chat_id,
513
                    $message_id
514
                );
515
            }
516
        } else if ($update_type === 'edited_message') {
517
            $edited_message = $update->getEditedMessage();
518
@@ 536-545 (lines=10) @@
533
        } else if ($update_type === 'channel_post') {
534
            $channel_post = $update->getChannelPost();
535
536
            if (self::insertMessageRequest($channel_post)) {
537
                $message_id = $channel_post->getMessageId();
538
                $chat_id = $channel_post->getChat()->getId();
539
540
                return self::insertTelegramUpdate(
541
                    $update_id,
542
                    $chat_id,
543
                    $message_id
544
                );
545
            }
546
        } else if ($update_type === 'edited_channel_post') {
547
            $edited_channel_post = $update->getEditedChannelPost();
548