Code Duplication    Length = 18-18 lines in 2 locations

src/DB.php 2 locations

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