Completed
Push — master ( 3c8880...e2c218 )
by Dmitry
06:42 queued 02:46
created

FormatController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 18
ccs 0
cts 4
cp 0
rs 10
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A actionCurrency() 0 4 1
1
<?php
2
3
/*
4
 * HiPanel core package
5
 *
6
 * @link      https://hipanel.com/
7
 * @package   hipanel-core
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2014-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hipanel\controllers;
13
14
use Yii;
15
use yii\web\Controller;
16
17
/**
18
 * Class FormatController
19
 * Used to format values with Yii formatter.
20
 */
21
class FormatController extends Controller
22
{
23
    /**
24
     * Formats [[$value]] as currency.
25
     * See [[Formatter::asCurrency]] documentation.
26
     *
27
     * @param $value
28
     * @param null $currency
29
     * @param array $options
30
     * @param array $textOptions
31
     * @throws \yii\base\InvalidConfigException
32
     * @return string
33
     */
34
    public function actionCurrency($value, $currency = null, $options = [], $textOptions = [])
35
    {
36
        return Yii::$app->formatter->asCurrency($value, $currency, $options, $textOptions);
37
    }
38
}
39