Currency   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
c 0
b 0
f 0
dl 0
loc 14
rs 10
ccs 7
cts 7
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 4 1
A __construct() 0 4 1
1
<?php
2
3
namespace kalanis\kw_table\core\Table\Columns;
4
5
6
use kalanis\kw_connect\core\Interfaces\IRow;
7
8
9
/**
10
 * Class Currency
11
 * @package kalanis\kw_table\core\Table\Columns
12
 * Output format as simple currency
13
 * For more currency options use Sprintf
14
 */
15
class Currency extends AColumn
16
{
17
    protected string $currency = '';
18
19 3
    public function __construct(string $sourceName, string $currency)
20
    {
21 3
        $this->sourceName = $sourceName;
22 3
        $this->currency = $currency;
23 3
    }
24
25 3
    public function getValue(IRow $source)
26
    {
27 3
        $value = parent::getValue($source);
28 3
        return $value . ' ' . $this->currency;
29
    }
30
}
31