Completed
Pull Request — master (#70)
by
unknown
05:22
created

PluginNumberFormat::compile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 5
1
<?php
2
3
namespace Dwoo\Plugins\Functions;
4
5
use Dwoo\Compiler;
6
use Dwoo\ICompilable;
7
use Dwoo\Plugin;
8
9
/**
10
 * Formats a float using the number_format function, see {@link http://php.net/number-format} for details
11
 */
12
class PluginNumberFormat extends Plugin implements ICompilable
13
{
14
    /**
15
     * @param Compiler $compiler
16
     * @param float    $value
17
     * @param int      $decimals
18
     * @param string   $dec_point
19
     * @param string   $thousands_sep
20
     *
21
     * @return string
22
     */
23
    public static function compile(Compiler $compiler, $value, $decimals = 0, $dec_point = ".",  $thousands_sep = ",")
0 ignored issues
show
Unused Code introduced by
The parameter $compiler is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
24
    {
25
        return 'number_format(' . $value . ',' . $decimals . ',' . $dec_point . ',' . $thousands_sep . ')';
26
    }
27
}
28