Code Duplication    Length = 4-4 lines in 6 locations

controller/acp/cat.php 6 locations

@@ 145-148 (lines=4) @@
142
     */
143
    public function action_delete()
144
    {
145
        if (!$this->cat_id) {
146
            trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING);
147
        }
148
149
        $this->cat_data = $this->_get_cat_info($this->cat_id);
150
151
        $subcats_id = [];
@@ 220-223 (lines=4) @@
217
     */
218
    public function action_move()
219
    {
220
        if (!$this->cat_id) {
221
            trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING);
222
        }
223
224
        $sql = 'SELECT cat_id, cat_name, parent_id, left_id, right_id
225
			FROM '.DIR_CAT_TABLE.'
226
			WHERE cat_id = '.(int) $this->cat_id;
@@ 231-234 (lines=4) @@
228
        $row = $this->db->sql_fetchrow($result);
229
        $this->db->sql_freeresult($result);
230
231
        if (!$row) {
232
            trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING);
233
        }
234
235
        try {
236
            $move_cat_name = $this->nestedset_category->{$this->action}($this->cat_id);
237
        } catch (\Exception $e) {
@@ 283-286 (lines=4) @@
280
     */
281
    public function action_sync()
282
    {
283
        if (!$this->cat_id) {
284
            trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING);
285
        }
286
287
        @set_time_limit(0);
288
289
        $sql = 'SELECT cat_name, cat_links
@@ 296-299 (lines=4) @@
293
        $row = $this->db->sql_fetchrow($result);
294
        $this->db->sql_freeresult($result);
295
296
        if (!$row) {
297
            trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING);
298
        }
299
300
        $sql = 'SELECT MIN(link_id) as min_link_id, MAX(link_id) as max_link_id
301
			FROM '.DIR_LINK_TABLE.'
302
			WHERE link_cat = '.(int) $this->cat_id.'
@@ 372-375 (lines=4) @@
369
        $row = $this->db->sql_fetchrow($result);
370
        $this->db->sql_freeresult($result);
371
372
        if (!$row) {
373
            trigger_error($this->user->lang['DIR_NO_CAT'].adm_back_link($this->u_action.'&parent_id='.$this->parent_id), E_USER_WARNING);
374
        }
375
376
        $this->_sync_dir_cat($this->cat_id);
377
378
        $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DIR_CAT_SYNC', time(), [$row['cat_name']]);