Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

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