Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

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