Currency::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 2
crap 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