Total Complexity | 9 |
Total Lines | 103 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class Conversion |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | private $fromCurrency; |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $toCurrency; |
||
15 | /** |
||
16 | * @var \DateTimeInterface|null |
||
17 | */ |
||
18 | private $date = null; |
||
19 | /** |
||
20 | * @var int|float |
||
21 | */ |
||
22 | private $amount; |
||
23 | /** |
||
24 | * @var int |
||
25 | */ |
||
26 | private $timestamp; |
||
27 | /** |
||
28 | * @var float |
||
29 | */ |
||
30 | private $quote; |
||
31 | /** |
||
32 | * @var float |
||
33 | */ |
||
34 | private $result; |
||
35 | |||
36 | /** |
||
37 | * Conversion constructor. |
||
38 | * |
||
39 | * @param array $data |
||
40 | * |
||
41 | * @throws \Exception |
||
42 | */ |
||
43 | public function __construct(array $data) |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | public function fromCurrency(): string |
||
58 | { |
||
59 | return $this->fromCurrency; |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return string |
||
64 | */ |
||
65 | public function toCurrency(): string |
||
66 | { |
||
67 | return $this->toCurrency; |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * @return \DateTimeInterface|null |
||
72 | */ |
||
73 | public function date(): ?\DateTimeInterface |
||
74 | { |
||
75 | return $this->date; |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * @return float|int |
||
80 | */ |
||
81 | public function amount() |
||
82 | { |
||
83 | return $this->amount; |
||
84 | } |
||
85 | |||
86 | /** |
||
87 | * @return int |
||
88 | */ |
||
89 | public function timestamp(): int |
||
90 | { |
||
91 | return $this->timestamp; |
||
92 | } |
||
93 | |||
94 | /** |
||
95 | * @return float |
||
96 | */ |
||
97 | public function quote(): float |
||
98 | { |
||
99 | return $this->quote; |
||
100 | } |
||
101 | |||
102 | /** |
||
103 | * @return float |
||
104 | */ |
||
105 | public function result(): float |
||
108 | } |
||
109 | } |
||
110 |