b_waiting_publisher()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 11
nc 2
nop 0
dl 0
loc 18
rs 9.9
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
# Waiting Contents Extensible                                            #
4
# Plugin for module publisher                                            #
5
#                                                                        #
6
# Author                                                                 #
7
# flying.tux     -   [email protected]                                #
8
# Modif Grom - Frxoops                                                   #
9
#                                                                        #
10
# Last modified on 21.04.2013                                            #
11
12
/**
13
 * @return array
14
 */
15
function b_waiting_publisher()
16
{
17
    /** @var \XoopsMySQLDatabase $xoopsDB */
18
    $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
19
    $ret     = [];
20
21
    // publisher submitted
22
    $block  = [];
23
    $sql    = 'SELECT COUNT(*) FROM ' . $xoopsDB->prefix('publisher_items') . ' WHERE status=1';
24
    $result = $xoopsDB->query($sql);
25
    if ($result) {
26
        $block['adminlink'] = XOOPS_URL . '/modules/publisher/admin/item.php';
27
        [$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

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