Code Duplication    Length = 22-23 lines in 2 locations

src/Comment/HTMLForm/CreateForm.php 1 location

@@ 19-40 (lines=22) @@
16
     *
17
     * @param Anax\DI\DIInterface $di a service container
18
     */
19
    public function __construct(DIInterface $di)
20
    {
21
        parent::__construct($di);
22
        $this->form->create(
23
            [
24
                "id" => __CLASS__,
25
                "legend" => "Details of the item",
26
            ],
27
            [
28
                "text" => [
29
                    "type" => "textarea",
30
                    "validation" => ["not_empty"],
31
                ],
32
33
                "submit" => [
34
                    "type" => "submit",
35
                    "value" => "Add comment",
36
                    "callback" => [$this, "callbackSubmit"]
37
                ],
38
            ]
39
        );
40
    }
41
42
43

src/Comment/HTMLForm/DeleteForm.php 1 location

@@ 19-41 (lines=23) @@
16
     *
17
     * @param Anax\DI\DIInterface $di a service container
18
     */
19
    public function __construct(DIInterface $di, $userId)
20
    {
21
        parent::__construct($di);
22
        $this->form->create(
23
            [
24
                "id" => __CLASS__,
25
                "legend" => "Delete an item",
26
            ],
27
            [
28
                "select" => [
29
                    "type"        => "select",
30
                    "label"       => "Select item to delete:",
31
                    "options"     => $this->getAllItems($userId),
32
                ],
33
34
                "submit" => [
35
                    "type" => "submit",
36
                    "value" => "Delete item",
37
                    "callback" => [$this, "callbackSubmit"]
38
                ],
39
            ]
40
        );
41
    }
42
43
44