Code Duplication    Length = 16-16 lines in 2 locations

src/Comment/CommentController.php 2 locations

@@ 60-75 (lines=16) @@
57
        }
58
    }
59
60
    public function questionAction(int $questionId): object
61
    {
62
        $page = $this->di->get("page");
63
        $form = new CreateForm($this->di, $questionId, "");
64
        $question = new Question();
65
        $question->setDb($this->di->get("dbqb"));
66
        $form->check();
67
        $text = $question->findById($questionId)->question;
68
        $data = [
69
            "form" => $form->getHTML(),
70
            "text" => $text,
71
            "title" => "create comment",
72
        ];
73
        $page->add("forum/create_comment", $data);
74
        return $page->render($data);
75
    }
76
77
78
    public function answerAction(int $answerId): object
@@ 78-93 (lines=16) @@
75
    }
76
77
78
    public function answerAction(int $answerId): object
79
    {
80
        $page = $this->di->get("page");
81
        $form = new CreateForm($this->di, "", $answerId);
82
        $answer = new Answer();
83
        $answer->setDb($this->di->get("dbqb"));
84
        $form->check();
85
        $text = $answer->findById($answerId)->answer;
86
        $data = [
87
            "form" => $form->getHTML(),
88
            "text" => $text,
89
            "title" => "create comment",
90
        ];
91
        $page->add("forum/create_comment", $data);
92
        return $page->render($data);
93
    }
94
}
95