Passed
Push — master ( f544e7...a87104 )
by Nicklas
02:21
created

CommentController::getPostQuestionAnswer()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 19
Code Lines 11

Duplication

Lines 9
Ratio 47.37 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 9
loc 19
ccs 0
cts 12
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 11
nc 2
nop 1
crap 6
1
<?php
2
3
namespace Nicklas\Comment;
4
5
use \Nicklas\Comment\HTMLForm\Comment\CreateQuestionForm;
6
use \Nicklas\Comment\HTMLForm\Comment\EditCommentForm;
7
8
use \Nicklas\Comment\Modules\Question;
9
10
/**
11
 * Extends the UserController, for comments
12
 */
13
class CommentController extends AdminController
14
{
15
16
17
    /**
18
     * Shows the post(question or answer) and create comment form
19
     *
20
     * @return void
21
     */
22 View Code Duplication
    public function getPostCreateComment($id)
0 ignored issues
show
Unused Code introduced by
The parameter $id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23
    {
24
        $question = new Question($this->di->get("db"));
25
26
        $views = [
27
            ["comment/question/view-all", ["questions" => $question->getQuestions()], "main"]
28
        ];
29
30
        $this->di->get("pageRenderComment")->renderPage([
31
            "views" => $views,
32
            "title" => "All questions"
33
        ]);
34
    }
35
}
36