Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

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