adslight_com_update()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php declare(strict_types=1);
2
3
/*
4
 * You may not change or alter any portion of this comment or credits
5
 * of supporting developers from this source code or any supporting source code
6
 * which is considered copyrighted (c) material of the original comment or credit authors.
7
 *
8
 * This program is distributed in the hope that it will be useful,
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 */
12
13
/**
14
 * @copyright    XOOPS Project (https://xoops.org)
15
 * @license      GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
16
 * @author       XOOPS Development Team
17
 * @author       Pascal Le Boustouller: original author ([email protected])
18
 * @author       Luc Bizet (www.frxoops.org)
19
 * @author       jlm69 (www.jlmzone.com)
20
 * @author       mamba (www.xoops.org)
21
 */
22
// comment callback functions
23
24
$moduleDirName = \basename(\dirname(__DIR__));
25
if (isset($usid)) {
26
    /**
27
     * @param $usid
28
     * @param $total_num
29
     */
30
    function adslight_com_update($usid, $total_num): void
31
    {
32
        /** @var \XoopsMySQLDatabase $xoopsDB */
33
        $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
34
        $sql     = 'UPDATE ' . $xoopsDB->prefix('adslight_listing') . " SET comments = {$total_num} WHERE usid = {$usid}";
35
        $xoopsDB->query($sql);
36
    }
37
38
    /**
39
     * @param $comment
40
     */
41
    function adslight_com_approve(&$comment): void
0 ignored issues
show
Unused Code introduced by
The parameter $comment is not used and could be removed. ( Ignorable by Annotation )

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

41
    function adslight_com_approve(/** @scrutinizer ignore-unused */ &$comment): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
42
    {
43
        // notification mail here
44
    }
45
}
46