| Total Complexity | 6 |
| Total Lines | 99 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class Rate |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Field, contains convertible currency alias |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | public $currencyFrom; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Field, contains reference currency alias |
||
| 23 | * |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | public $currencyTo; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Rate value |
||
| 30 | * |
||
| 31 | * @var float |
||
| 32 | */ |
||
| 33 | public $rate; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Date of rate |
||
| 37 | * |
||
| 38 | * @var \DateTime |
||
| 39 | */ |
||
| 40 | public $date; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Rate constructor. |
||
| 44 | * |
||
| 45 | * @param string $currencyFrom |
||
| 46 | * @param string $currencyTo |
||
| 47 | * @param \DateTime $date |
||
| 48 | * @param float $rate |
||
| 49 | */ |
||
| 50 | public function __construct(string $currencyFrom, string $currencyTo, \DateTime $date, float $rate) |
||
| 51 | { |
||
| 52 | $this->currencyFrom = $currencyFrom; |
||
| 53 | $this->currencyTo = $currencyTo; |
||
| 54 | $this->date = $date; |
||
| 55 | $this->rate = $rate; |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Getter for currencyFrom |
||
| 60 | * |
||
| 61 | * @return string |
||
| 62 | */ |
||
| 63 | public function getCurrencyFrom(): string |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Getter for currencyTo |
||
| 70 | * |
||
| 71 | * @return string |
||
| 72 | */ |
||
| 73 | public function getCurrencyTo(): string |
||
| 74 | { |
||
| 75 | return $this->currencyTo; |
||
| 76 | } |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Getter for rate |
||
| 80 | * |
||
| 81 | * @return float |
||
| 82 | */ |
||
| 83 | public function getRate(): float |
||
| 84 | { |
||
| 85 | return $this->rate; |
||
| 86 | } |
||
| 87 | |||
| 88 | /** |
||
| 89 | * Getter for date |
||
| 90 | * |
||
| 91 | * @return \DateTime |
||
| 92 | */ |
||
| 93 | public function getDate(): \DateTime |
||
| 94 | { |
||
| 95 | return $this->date; |
||
| 96 | } |
||
| 97 | |||
| 98 | /** |
||
| 99 | * toString magic method |
||
| 100 | * |
||
| 101 | * @return string |
||
| 102 | */ |
||
| 103 | public function __toString(): string |
||
| 111 | ); |
||
| 112 | } |
||
| 113 | } |
||
| 114 |