b_waiting_catads()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 11
nc 2
nop 0
dl 0
loc 16
rs 9.9
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
/**
4
 * @return array
5
 */
6
function b_waiting_catads()
7
{
8
    $ret      = [];
9
    $block    = [];
10
    $ads_hnd  = xoops_getModuleHandler('Ads', 'catads');
11
    $criteria = new \Criteria('waiting', '1', '=');
12
    $nbads    = $ads_hnd->getCount($criteria);
0 ignored issues
show
Bug introduced by
The method getCount() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of said class. However, the method does not exist in XoopsGroupHandler or XoopsConfigCategoryHandler or XoopsRankHandler or XoopsConfigOptionHandler or XoopsBlockHandler or XoopsImageSetHandler. Are you sure you never get one of those? ( Ignorable by Annotation )

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

12
    /** @scrutinizer ignore-call */ 
13
    $nbads    = $ads_hnd->getCount($criteria);
Loading history...
13
    if ($nbads > 0) {
14
        $block['adminlink']     = XOOPS_URL . '/modules/catads/admin/index.php?action=waiting';
15
        $block['pendingnum']    = $nbads;
16
        $block['lang_linkname'] = _PI_WAITING_WAITINGS;
17
    }
18
19
    $ret[] = $block;
20
21
    return $ret;
22
}
23