Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

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