UserlogPlugin::item()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 6
nc 3
nop 1
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace XoopsModules\Xoopspoll\Plugin;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
*/
14
15
/**
16
 *  userlog module
17
 *
18
 * @copyright       XOOPS Project (https://xoops.org)
19
 * @license         GNU GPL 2 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
20
 * @since           4.31
21
 * @author          irmtfan ([email protected])
22
 * @author          XOOPS Project <www.xoops.org> <www.xoops.ir>
23
 */
24
25
use Xmf\Request;
26
use XoopsModules\Userlog;
0 ignored issues
show
Bug introduced by
The type XoopsModules\Userlog was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
27
28
/**
29
 * Class UserlogPlugin
30
 */
31
class UserlogPlugin extends Userlog\Plugin\PluginAbstract implements Userlog\Plugin\PluginInterface
0 ignored issues
show
Bug introduced by
The type XoopsModules\Userlog\Plugin\PluginInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
Bug introduced by
The type XoopsModules\Userlog\Plugin\PluginAbstract was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
32
{
33
    /**
34
     * @param string $subscribe_from Name of the script
35
     *
36
     * 'name' => 'thread';
37
     * 'title' => _MI_NEWBB_THREAD_NOTIFY;
38
     * 'description' => _MI_NEWBB_THREAD_NOTIFYDSC;
39
     * 'subscribe_from' => 'viewtopic.php';
40
     * 'item_name' => 'topic_id';
41
     * 'allow_bookmark' => 1;
42
     *
43
     * @return array|bool $item["item_name"] name of the item, $item["item_id"] id of the item
44
     */
45
    public function item(string $subscribe_from)
46
    {
47
        $poll_id = Request::getInt('poll_id', 0);
48
        switch ($subscribe_from) {
49
            case 'index.php':
50
            case 'pollresults.php':
51
                return ['item_name' => 'poll_id', 'item_id' => $poll_id];
52
        }
53
54
        return false;
55
    }
56
}
57