Passed
Pull Request — master (#29)
by Michael
02:36
created

tagBar()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 3
b 0
f 0
nc 1
nop 3
dl 0
loc 11
rs 10
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
 * XOOPS tag management module
14
 *
15
 * @copyright      {@link https://sourceforge.net/projects/xoops/ The XOOPS Project}
16
 * @license        {@link https://www.fsf.org/copyleft/gpl.html GNU public license}
17
 * @author         Taiwen Jiang <[email protected]>
18
 * @since          1.00
19
 */
20
21
use XoopsModules\Tag\{
22
    Tagbar
23
};
24
25
(defined('XOOPS_ROOT_PATH') && ($GLOBALS['xoopsModule'] instanceof \XoopsModule)) || exit('Restricted access');
26
27
/**
28
 * Display tag list
29
 *
30
 * @param int|array $tags  array of tag string
31
 *                         OR
32
 * @param int       $catid
33
 * @param int       $modid
34
 */
35
function tagBar($tags, $catid = 0, $modid = 0): array
36
{
37
    $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
38
    trigger_error(__FUNCTION__ . " is deprecated, called from {$trace[0]['file']} line {$trace[0]['line']}");
39
    $GLOBALS['xoopsLogger']->addDeprecated(
40
        'Tag Module: ' . __FUNCTION__ . " function  is deprecated since Tag 2.3.5, please use 'Tag\Tagbar' class instead." . " Called from {$trace[0]['file']}line {$trace[0]['line']}"
41
    );
42
43
    $tagbar = new Tagbar();
44
45
    return $tagbar->getTagbar($tags, $catid, $modid);
46
}
47