Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

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