| Total Complexity | 11 |
| Total Lines | 123 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class Card |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var int |
||
| 14 | */ |
||
| 15 | protected $number; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | protected $holder; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var int |
||
| 24 | */ |
||
| 25 | protected $expiryMonth; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var int |
||
| 29 | */ |
||
| 30 | protected $expiryYear; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var int |
||
| 34 | */ |
||
| 35 | protected $cvv; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Card constructor. |
||
| 39 | * |
||
| 40 | * @param int $number |
||
| 41 | * @param string $holder |
||
| 42 | * @param int $expiryMonth |
||
| 43 | * @param int $expiryYear |
||
| 44 | * @param int $cvv |
||
| 45 | */ |
||
| 46 | public function __construct(int $number, string $holder, int $expiryMonth, int $expiryYear, int $cvv) |
||
| 47 | { |
||
| 48 | $this->setNumber($number); |
||
| 49 | $this->setHolder($holder); |
||
| 50 | $this->setExpiryMonth($expiryMonth); |
||
| 51 | $this->setExpiryYear($expiryYear); |
||
| 52 | $this->setCvv($cvv); |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | public function getNumber(): string |
||
| 59 | { |
||
| 60 | return $this->number; |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @param int $number |
||
| 65 | */ |
||
| 66 | public function setNumber(int $number): void |
||
| 67 | { |
||
| 68 | $this->number = $number; |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @return string |
||
| 73 | */ |
||
| 74 | public function getHolder(): string |
||
| 75 | { |
||
| 76 | return $this->holder; |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @param string $holder |
||
| 81 | */ |
||
| 82 | public function setHolder(string $holder): void |
||
| 83 | { |
||
| 84 | $this->holder = $holder; |
||
| 85 | } |
||
| 86 | |||
| 87 | /** |
||
| 88 | * @return int |
||
| 89 | */ |
||
| 90 | public function getExpiryMonth(): int |
||
| 93 | } |
||
| 94 | |||
| 95 | /** |
||
| 96 | * @param int $expiryMonth |
||
| 97 | */ |
||
| 98 | public function setExpiryMonth(int $expiryMonth): void |
||
| 101 | } |
||
| 102 | |||
| 103 | /** |
||
| 104 | * @return mixed |
||
| 105 | */ |
||
| 106 | public function getExpiryYear(): int |
||
| 107 | { |
||
| 108 | return $this->expiryYear; |
||
| 109 | } |
||
| 110 | |||
| 111 | /** |
||
| 112 | * @param int $expiryYear |
||
| 113 | */ |
||
| 114 | public function setExpiryYear(int $expiryYear): void |
||
| 115 | { |
||
| 116 | $this->expiryYear = $expiryYear; |
||
| 117 | } |
||
| 118 | |||
| 119 | /** |
||
| 120 | * @return int |
||
| 121 | */ |
||
| 122 | public function getCvv(): int |
||
| 123 | { |
||
| 124 | return $this->cvv; |
||
| 125 | } |
||
| 126 | |||
| 127 | /** |
||
| 128 | * @param int $cvv |
||
| 129 | */ |
||
| 130 | public function setCvv(int $cvv): void |
||
| 133 | } |
||
| 134 | } |