ConverterResultObject::getCurrency()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Sarnado\Converter\Objects;
4
5
6
7
use Sarnado\Converter\Checkers\TypeValidator;
8
9
/**
10
 * Class ConverterResultObject
11
 */
12
class ConverterResultObject
13
{
14
    /**
15
     * @var string
16
     */
17
    private $amount;
18
    /**
19
     * @var string
20
     */
21
    private $currency;
22
23
    /**
24
     * ConverterResultObject constructor.
25
     * @param string $amount
26
     * @param string $currency
27
     */
28 54
    public function __construct(string $amount, string $currency)
29
    {
30 54
        $this->setAmount($amount);
31 54
        $this->setCurrency($currency);
32 54
    }
33
34
    /**
35
     * @return string
36
     */
37 54
    public function getAmount(): string
38
    {
39 54
        return $this->amount;
40
    }
41
42
    /**
43
     * @param string $amount
44
     */
45 54
    public function setAmount(string $amount)
46
    {
47 54
        $this->amount = $amount;
48 54
    }
49
50
    /**
51
     * @return string
52
     */
53 54
    public function getCurrency(): string
54
    {
55 54
        return $this->currency;
56
    }
57
58
    /**
59
     * @param string $currency
60
     */
61 54
    public function setCurrency(string $currency)
62
    {
63 54
        $this->currency = $currency;
64 54
    }
65
66
    /**
67
     * @return string
68
     */
69 27
    public function toString(): string
70
    {
71 27
        return $this->amount . ' ' . $this->currency;
72
    }
73
}
74