Passed
Push — master ( d9aeb1...e3a3e2 )
by Richard
05:40 queued 11s
created

smarty_function_year()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
/**
3
 * XOOPS year Smarty plug-in -- returns the current year
4
 *
5
 * @copyright   XOOPS Project (http://xoops.org)
6
 * @license     GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
7
 * @author      Richard Griffith <[email protected]>
8
 */
9
10
/**
11
 * Insert the current year
12
 *
13
 * @param $params
14
 * @param $smarty
15
 * @return null
16
 */
17
function smarty_function_year($params, &$smarty)
0 ignored issues
show
Unused Code introduced by
The parameter $smarty 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

17
function smarty_function_year($params, /** @scrutinizer ignore-unused */ &$smarty)

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...
Unused Code introduced by
The parameter $params 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

17
function smarty_function_year(/** @scrutinizer ignore-unused */ $params, &$smarty)

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...
18
{
19
    $time = new DateTime();
20
    echo $time->format('Y');
21
}
22