Completed
Push — master ( 3d52a5...b51608 )
by Dmitry
04:01
created

ResourcePriceWidget   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 6 1
1
<?php
2
3
namespace hipanel\modules\finance\widgets;
4
5
use NumberFormatter;
6
use Yii;
7
use yii\base\Widget;
8
9
class ResourcePriceWidget extends Widget
10
{
11
    public $price;
12
    public $currency;
13
14
    public function run()
15
    {
16
        return Yii::$app->formatter->asCurrency($this->price, $this->currency, [
17
            NumberFormatter::MAX_FRACTION_DIGITS => 4
18
        ]);
19
    }
20
}
21