Code Duplication    Length = 5-5 lines in 2 locations

blocks/xoopsfaq_rand.php 1 location

@@ 67-71 (lines=5) @@
64
            unset($catsToUse[$key]);
65
        }
66
    }
67
    if (!empty($catsToUse)) {
68
        $criteria->add(new \Criteria('contents_cid', '(' . implode(',', $catsToUse) . ')', 'IN'));
69
    } else {
70
        return $block;
71
    }
72
    $xpFaqObjArray = $contentsHandler->getAll($criteria);
73
    $faqCount      = (is_array($xpFaqObjArray) && !empty($xpFaqObjArray)) ? count($xpFaqObjArray) : 0;
74

blocks/xoopsfaq_recent.php 1 location

@@ 72-76 (lines=5) @@
69
            unset($catsToUse[$key]);
70
        }
71
    }
72
    if (!empty($catsToUse)) {
73
        $criteria->add(new \Criteria('contents_cid', '(' . implode(',', $catsToUse) . ')', 'IN'));
74
    } else {
75
        return $block;
76
    }
77
78
    $fieldsArray = ['contents_cid', 'contents_title', 'contents_contents'];
79
    $faqObjArray = $contentsHandler->getAll($criteria, $fieldsArray);