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

PluginNumberFormat   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A compile() 0 4 1
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