b_waiting_adslight()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 10
nc 2
nop 0
dl 0
loc 17
rs 9.9332
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
# Waiting Contents Extensible                                            #
4
# Plugin for module adslight                                             #
5
#                                                                        #
6
# iLuc - Frxoops                                                         #
7
#                                                                        #
8
#                                                                        #
9
# Last modified on 09.05.2010                                            #
10
11
/**
12
 * @return array
13
 */
14
function b_waiting_adslight()
15
{
16
    /** @var \XoopsMySQLDatabase $xoopsDB */
17
    $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
18
    $ret     = [];
19
    $block   = [];
20
21
    $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('adslight_listing') . " WHERE valid='No'");
22
    if ($result) {
23
        $block['adminlink'] = XOOPS_URL . '/modules/adslight/admin/validate_ads.php';
24
        [$block['pendingnum']] = $xoopsDB->fetchRow($result);
0 ignored issues
show
Bug introduced by
It seems like $result can also be of type true; however, parameter $result of XoopsMySQLDatabase::fetchRow() does only seem to accept mysqli_result, maybe add an additional type check? ( Ignorable by Annotation )

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

24
        [$block['pendingnum']] = $xoopsDB->fetchRow(/** @scrutinizer ignore-type */ $result);
Loading history...
25
        $block['lang_linkname'] = _PI_WAITING_WAITINGS;
26
    }
27
28
    $ret[] = $block;
29
30
    return $ret;
31
}
32