news_com_update()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 10
rs 10
cc 2
nc 2
nop 2
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      {@link https://xoops.org/ XOOPS Project}
14
 * @license        {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later}
15
 * @author         XOOPS Development Team
16
 * @param mixed $story_id
17
 * @param mixed $total_num
18
 */
19
20
// comment callback functions
21
22
// require_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
23
use XoopsModules\News\NewsStory;
24
25
/**
26
 * @param $story_id
27
 * @param $total_num
28
 *
29
 * @return bool
30
 */
31
function news_com_update($story_id, $total_num)
32
{
33
    $story_id  = (int)$story_id;
34
    $total_num = (int)$total_num;
35
    $article   = new NewsStory($story_id);
36
    if (!$article->updateComments($total_num)) {
37
        return false;
38
    }
39
40
    return true;
41
}
42
43
/**
44
 * @param $comment
45
 */
46
function news_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

46
function news_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...
47
{
48
    // notification mail here
49
}
50