Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

@@ 485-502 (lines=18) @@
482
483
                return self::insertTelegramUpdate($update_id, $chat_id, $message_id, null, null, null, null);
484
            }
485
        } elseif ($update_type === 'edited_message') {
486
            $edited_message = $update->getEditedMessage();
487
488
            if (self::insertEditedMessageRequest($edited_message)) {
489
                $chat_id                 = $edited_message->getChat()->getId();
490
                $edited_message_local_id = self::$pdo->lastInsertId();
491
492
                return self::insertTelegramUpdate(
493
                    $update_id,
494
                    $chat_id,
495
                    null,
496
                    null,
497
                    null,
498
                    null,
499
                    $edited_message_local_id
500
                );
501
            }
502
        } elseif ($update_type === 'channel_post') {
503
            $channel_post = $update->getChannelPost();
504
505
            if (self::insertMessageRequest($channel_post)) {
@@ 511-528 (lines=18) @@
508
509
                return self::insertTelegramUpdate($update_id, $chat_id, $message_id, null, null, null, null);
510
            }
511
        } elseif ($update_type === 'edited_channel_post') {
512
            $edited_channel_post = $update->getEditedChannelPost();
513
514
            if (self::insertEditedMessageRequest($edited_channel_post)) {
515
                $chat_id                      = $edited_channel_post->getChat()->getId();
516
                $edited_channel_post_local_id = self::$pdo->lastInsertId();
517
518
                return self::insertTelegramUpdate(
519
                    $update_id,
520
                    $chat_id,
521
                    null,
522
                    null,
523
                    null,
524
                    null,
525
                    $edited_channel_post_local_id
526
                );
527
            }
528
        } elseif ($update_type === 'inline_query') {
529
            $inline_query = $update->getInlineQuery();
530
531
            if (self::insertInlineQueryRequest($inline_query)) {