Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

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