Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

@@ 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_message') {
499
            $edited_message = $update->getEditedMessage();
500
501
            if (self::insertEditedMessageRequest($edited_message)) {
502
                $chat_id                 = $edited_message->getChat()->getId();
503
                $edited_message_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_message_local_id
513
                );
514
            }
515
        } elseif ($update_type === 'channel_post') {
516
            $channel_post = $update->getChannelPost();
517
518
            if (self::insertMessageRequest($channel_post)) {
@@ 524-541 (lines=18) @@
521
522
                return self::insertTelegramUpdate($update_id, $chat_id, $message_id, null, null, null, null);
523
            }
524
        } elseif ($update_type === 'edited_channel_post') {
525
            $edited_channel_post = $update->getEditedChannelPost();
526
527
            if (self::insertEditedMessageRequest($edited_channel_post)) {
528
                $chat_id                      = $edited_channel_post->getChat()->getId();
529
                $edited_channel_post_local_id = self::$pdo->lastInsertId();
530
531
                return self::insertTelegramUpdate(
532
                    $update_id,
533
                    $chat_id,
534
                    null,
535
                    null,
536
                    null,
537
                    null,
538
                    $edited_channel_post_local_id
539
                );
540
            }
541
        } elseif ($update_type === 'inline_query') {
542
            $inline_query = $update->getInlineQuery();
543
544
            if (self::insertInlineQueryRequest($inline_query)) {