ConverterResultObject   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 10
c 1
b 0
f 0
dl 0
loc 60
ccs 16
cts 16
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getCurrency() 0 3 1
A setCurrency() 0 3 1
A setAmount() 0 3 1
A getAmount() 0 3 1
A __construct() 0 4 1
A toString() 0 3 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