Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

@@ 513-530 (lines=18) @@
510
                    $message_id
511
                );
512
            }
513
        } elseif ($update_type === 'edited_message') {
514
            $edited_message = $update->getEditedMessage();
515
516
            if (self::insertEditedMessageRequest($edited_message)) {
517
                $edited_message_local_id = self::$pdo->lastInsertId();
518
                $chat_id                 = $edited_message->getChat()->getId();
519
520
                return self::insertTelegramUpdate(
521
                    $update_id,
522
                    $chat_id,
523
                    null,
524
                    null,
525
                    null,
526
                    null,
527
                    $edited_message_local_id
528
                );
529
            }
530
        } elseif ($update_type === 'channel_post') {
531
            $channel_post = $update->getChannelPost();
532
533
            if (self::insertMessageRequest($channel_post)) {
@@ 543-560 (lines=18) @@
540
                    $message_id
541
                );
542
            }
543
        } elseif ($update_type === 'edited_channel_post') {
544
            $edited_channel_post = $update->getEditedChannelPost();
545
546
            if (self::insertEditedMessageRequest($edited_channel_post)) {
547
                $edited_channel_post_local_id = self::$pdo->lastInsertId();
548
                $chat_id                      = $edited_channel_post->getChat()->getId();
549
550
                return self::insertTelegramUpdate(
551
                    $update_id,
552
                    $chat_id,
553
                    null,
554
                    null,
555
                    null,
556
                    null,
557
                    $edited_channel_post_local_id
558
                );
559
            }
560
        } elseif ($update_type === 'inline_query') {
561
            $inline_query = $update->getInlineQuery();
562
563
            if (self::insertInlineQueryRequest($inline_query)) {