Passed
Push — master ( c41a18...3e0550 )
by Goffy
30s queued 12s
created

UserlogPlugin   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A item() 0 10 3
1
<?php
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
 * @package         newbb class plugin
21
 * @since           4.31
22
 * @author          irmtfan ([email protected])
23
 * @author          XOOPS Project <www.xoops.org> <www.xoops.ir>
24
 */
25
26
use Xmf\Request;
27
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...
28
29
 /**
30
 * Class UserlogPlugin
31
 * @package XoopsModules\Xoopspoll\Plugin
32
 */
33
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...
34
{
35
    /**
36
     * @param string $subscribe_from Name of the script
37
     *
38
     * 'name' => 'thread';
39
     * 'title' => _MI_NEWBB_THREAD_NOTIFY;
40
     * 'description' => _MI_NEWBB_THREAD_NOTIFYDSC;
41
     * 'subscribe_from' => 'viewtopic.php';
42
     * 'item_name' => 'topic_id';
43
     * 'allow_bookmark' => 1;
44
     *
45
     * @return array|bool $item["item_name"] name of the item, $item["item_id"] id of the item
46
     */
47
    public function item($subscribe_from)
48
    {
49
        $poll_id = Request::getInt('poll_id', 0);
50
        switch ($subscribe_from) {
51
            case 'index.php':
52
            case 'pollresults.php':
53
                return ['item_name' => 'poll_id', 'item_id' => $poll_id];
54
        }
55
56
        return false;
57
    }
58
}
59