b_waiting_extgallery()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 19
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 11
nc 2
nop 0
dl 0
loc 19
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_extgallery()
7
{
8
    /** @var \XoopsMySQLDatabase $xoopsDB */
9
    $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
10
    $ret     = [];
11
    $block   = [];
12
13
    // extcal events
14
    $sql    = 'SELECT COUNT(*) FROM ' . $xoopsDB->prefix('extgallery_publicphoto') . ' WHERE photo_approved=0';
15
    $result = $xoopsDB->query($sql);
16
    if ($result) {
17
        $block['adminlink'] = XOOPS_URL . '/modules/extgallery/admin/photo.php';
18
        [$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

18
        [$block['pendingnum']] = $xoopsDB->fetchRow(/** @scrutinizer ignore-type */ $result);
Loading history...
19
        $block['lang_linkname'] = _PI_WAITING_EVENTS;
20
    }
21
22
    $ret[] = $block;
23
24
    return $ret;
25
}
26