Code Duplication    Length = 28-31 lines in 2 locations

src/Comment/HTMLForm/CreateCommentForm.php 1 location

@@ 20-47 (lines=28) @@
17
     *
18
     * @param Anax\DI\DIInterface $di a service container
19
     */
20
    public function __construct(DIInterface $di, $id)
21
    {
22
        parent::__construct($di);
23
24
        $this->form->create(
25
            [
26
                "id"     => __CLASS__,
27
                "legend" => "Create new comment",
28
                "class" => "createNewCommentForm"
29
            ],
30
            [
31
                    "text"    => [
32
                        "type"     => "textarea"
33
                    ],
34
35
                    "hidden" => [
36
                        "type"       => "hidden",
37
                        "value"      => $id,
38
                    ],
39
40
                    "submit" => [
41
                        "type"     => "submit",
42
                        "value"    => "Create comment",
43
                        "callback" => [$this, "callbackSubmit"],
44
                    ],
45
            ]
46
        );
47
    }
48
49
    /**
50
     * Callback for submit-button which should return true if it could

src/Comment/HTMLForm/CreatePostForm.php 1 location

@@ 22-52 (lines=31) @@
19
     *
20
     * @param Anax\DI\DIInterface $di a service container
21
     */
22
    public function __construct(DIInterface $di)
23
    {
24
        parent::__construct($di);
25
26
        $this->form->create(
27
            [
28
                "id"     => __CLASS__,
29
                "legend" => "Create Post",
30
                "class" => "createNewPostForm"
31
            ],
32
            [
33
                "title" => [
34
                    "type" => "text",
35
                ],
36
37
                "text" => [
38
                    "type" => "textarea",
39
                ],
40
41
                "tags" => [
42
                    "type"        => "text",
43
                ],
44
45
                "submit" => [
46
                    "type"     => "submit",
47
                    "value"    => "Create Post",
48
                    "callback" => [$this, "callbackSubmit"],
49
                ],
50
            ]
51
        );
52
    }
53
54
55
    /**