Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

@@ 469-486 (lines=18) @@
466
467
                return self::insertTelegramUpdate($update_id, $chat_id, $message_id, null, null, null, null);
468
            }
469
        } elseif ($update_type === 'edited_message') {
470
            $edited_message = $update->getEditedMessage();
471
472
            if (self::insertEditedMessageRequest($edited_message)) {
473
                $chat_id                 = $edited_message->getChat()->getId();
474
                $edited_message_local_id = self::$pdo->lastInsertId();
475
476
                return self::insertTelegramUpdate(
477
                    $update_id,
478
                    $chat_id,
479
                    null,
480
                    null,
481
                    null,
482
                    null,
483
                    $edited_message_local_id
484
                );
485
            }
486
        } else if ($update_type === 'channel_post') {
487
            $channel_post = $update->getChannelPost();
488
489
            if (self::insertMessageRequest($channel_post)) {
@@ 495-512 (lines=18) @@
492
493
                return self::insertTelegramUpdate($update_id, $chat_id, $message_id, null, null, null, null);
494
            }
495
        } elseif ($update_type === 'edited_channel_post') {
496
            $edited_channel_post = $update->getEditedChannelPost();
497
498
            if (self::insertEditedMessageRequest($edited_channel_post)) {
499
                $chat_id                      = $edited_channel_post->getChat()->getId();
500
                $edited_channel_post_local_id = self::$pdo->lastInsertId();
501
502
                return self::insertTelegramUpdate(
503
                    $update_id,
504
                    $chat_id,
505
                    null,
506
                    null,
507
                    null,
508
                    null,
509
                    $edited_channel_post_local_id
510
                );
511
            }
512
        } elseif ($update_type === 'inline_query') {
513
            $inline_query = $update->getInlineQuery();
514
515
            if (self::insertInlineQueryRequest($inline_query)) {