Code Duplication    Length = 21-22 lines in 2 locations

src/Comments/CommController.php 2 locations

@@ 112-132 (lines=21) @@
109
     *
110
     * @return void
111
     */
112
    public function getPostDeleteItem($id)
113
    {
114
        $title      = "Ta bort ett inlägg";
115
        $sess = $this->getSess();
116
117
        if ($sess) {
118
            $form       = new DeleteCommForm($this->di, $id);
119
            $form->check();
120
121
            $data = [
122
                "form" => $form->getHTML(),
123
            ];
124
        } else {
125
            $data = [
126
                "form" => "Enbart för inloggade. Sorry!",
127
            ];
128
        }
129
130
        $crud = "comm/crud/delete";
131
        $this->toRender($title, $crud, $data);
132
    }
133
134
135
@@ 163-184 (lines=22) @@
160
     *
161
     * @return void
162
     */
163
    public function getPostUpdateItem($id)
164
    {
165
        $title      = "Uppdatera ditt inlägg";
166
167
        $sess = $this->getSess();
168
169
        if ($sess) {
170
            $form       = new UpdateCommForm($this->di, $id, $sess['id']);
171
            $form->check();
172
173
            $data = [
174
                "form" => $form->getHTML(),
175
            ];
176
        } else {
177
            $data = [
178
                "form" => "Enbart för inloggade. Sorry!",
179
            ];
180
        }
181
182
        $crud = "comm/crud/update";
183
        $this->toRender($title, $crud, $data);
184
    }
185
186
187
    /**