Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

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