publisher_com_update()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 7
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11
12
/**
13
 * @copyright       XOOPS Project (https://xoops.org)
14
 * @license         https://www.fsf.org/copyleft/gpl.html GNU public license
15
 * @since           1.0
16
 * @author          trabis <[email protected]>
17
 *
18
 * @param $itemId
19
 * @param $totalNum
20
 */
21
function publisher_com_update($itemId, $totalNum): void
22
{
23
    global $xoopsModule;
24
    /** @var \XoopsMySQLDatabase $db */
25
    $db  = \XoopsDatabaseFactory::getDatabaseConnection();
26
    $sql = 'UPDATE ' . $db->prefix($xoopsModule->getVar('dirname', 'n') . '_items') . ' SET comments = ' . $totalNum . ' WHERE itemid = ' . $itemId;
27
    $db->query($sql);
28
}
29
30
/**
31
 * @param $comment
32
 */
33
function publisher_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

33
function publisher_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...
34
{
35
    // notification mail here
36
}
37