Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

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