Passed
Push — master ( 81ba93...c6c854 )
by Michael
03:30
created

blocks/faqs_random_faq.php (1 issue)

Labels
Severity
1
<?php
2
3
/**
4
 * Module: SmartFAQ
5
 * Author: The SmartFactory <www.smartfactory.ca>
6
 * Licence: GNU
7
 */
8
9
use XoopsModules\Smartfaq\Constants;
10
11
// defined('XOOPS_ROOT_PATH') || die('Restricted access');
12
13
/**
14
 * @return array
15
 */
16
function b_faqs_random_faq_show()
17
{
18
    //    require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
19
20
    $block = [];
21
22
    // Creating the faq handler object
23
    /** @var \XoopsModules\Smartfaq\FaqHandler $faqHandler */
24
    $faqHandler = \XoopsModules\Smartfaq\Helper::getInstance()->getHandler('Faq');
25
26
    // creating the FAQ object
27
    $faqsObj = $faqHandler->getRandomFaq('question', [Constants::SF_STATUS_PUBLISHED, Constants::SF_STATUS_NEW_ANSWER]);
0 ignored issues
show
array(XoopsModules\Smart...::SF_STATUS_NEW_ANSWER) of type array<integer,integer> is incompatible with the type string expected by parameter $status of XoopsModules\Smartfaq\FaqHandler::getRandomFaq(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

27
    $faqsObj = $faqHandler->getRandomFaq('question', /** @scrutinizer ignore-type */ [Constants::SF_STATUS_PUBLISHED, Constants::SF_STATUS_NEW_ANSWER]);
Loading history...
28
29
    if ($faqsObj) {
30
        $block['content']     = $faqsObj->question();
31
        $block['id']          = $faqsObj->faqid();
32
        $block['lang_answer'] = _MB_SF_ANSWERHERE;
33
    }
34
35
    return $block;
36
}
37