Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

@@ 504-521 (lines=18) @@
501
502
                return self::insertTelegramUpdate($update_id, $chat_id, $message_id, null, null, null, null);
503
            }
504
        } elseif ($update_type === 'edited_message') {
505
            $edited_message = $update->getEditedMessage();
506
507
            if (self::insertEditedMessageRequest($edited_message)) {
508
                $chat_id                 = $edited_message->getChat()->getId();
509
                $edited_message_local_id = self::$pdo->lastInsertId();
510
511
                return self::insertTelegramUpdate(
512
                    $update_id,
513
                    $chat_id,
514
                    null,
515
                    null,
516
                    null,
517
                    null,
518
                    $edited_message_local_id
519
                );
520
            }
521
        } elseif ($update_type === 'channel_post') {
522
            $channel_post = $update->getChannelPost();
523
524
            if (self::insertMessageRequest($channel_post)) {
@@ 530-547 (lines=18) @@
527
528
                return self::insertTelegramUpdate($update_id, $chat_id, $message_id, null, null, null, null);
529
            }
530
        } elseif ($update_type === 'edited_channel_post') {
531
            $edited_channel_post = $update->getEditedChannelPost();
532
533
            if (self::insertEditedMessageRequest($edited_channel_post)) {
534
                $chat_id                      = $edited_channel_post->getChat()->getId();
535
                $edited_channel_post_local_id = self::$pdo->lastInsertId();
536
537
                return self::insertTelegramUpdate(
538
                    $update_id,
539
                    $chat_id,
540
                    null,
541
                    null,
542
                    null,
543
                    null,
544
                    $edited_channel_post_local_id
545
                );
546
            }
547
        } elseif ($update_type === 'inline_query') {
548
            $inline_query = $update->getInlineQuery();
549
550
            if (self::insertInlineQueryRequest($inline_query)) {