| @@ 50-56 (lines=7) @@ | ||
| 47 | * @return void |
|
| 48 | * @throws InvalidArgumentException |
|
| 49 | */ |
|
| 50 | private function validateAddressLine() |
|
| 51 | { |
|
| 52 | $addressLine = $this->address->addressLine; |
|
| 53 | if (empty($addressLine) || !is_string($addressLine)) { |
|
| 54 | throw new \InvalidArgumentException('address line should be a string'); |
|
| 55 | } |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * This validates the city address |
|
| @@ 64-70 (lines=7) @@ | ||
| 61 | * @return void |
|
| 62 | * @throws InvalidArgumentException |
|
| 63 | */ |
|
| 64 | private function validateCity() |
|
| 65 | { |
|
| 66 | $city = $this->address->city; |
|
| 67 | if (empty($city) || !is_string($city)) { |
|
| 68 | throw new \InvalidArgumentException('city address should be a string'); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| 73 | * This validates the state address |
|
| @@ 78-84 (lines=7) @@ | ||
| 75 | * @return void |
|
| 76 | * @throws InvalidArgumentException |
|
| 77 | */ |
|
| 78 | private function validateState() |
|
| 79 | { |
|
| 80 | $state = $this->address->state; |
|
| 81 | if (empty($state) || !is_string($state)) { |
|
| 82 | throw new \InvalidArgumentException('state address should be a string'); |
|
| 83 | } |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * This validates a zip code |
|
| @@ 92-98 (lines=7) @@ | ||
| 89 | * @return void |
|
| 90 | * @throws InvalidArgumentException |
|
| 91 | */ |
|
| 92 | private function validateZipCode() |
|
| 93 | { |
|
| 94 | $zipCode = $this->address->zipCode; |
|
| 95 | if (empty($zipCode) || !is_string($zipCode)) { |
|
| 96 | throw new \InvalidArgumentException('zip code should be a string'); |
|
| 97 | } |
|
| 98 | } |
|
| 99 | } |
|
| 100 | ||
| @@ 65-71 (lines=7) @@ | ||
| 62 | * @return void |
|
| 63 | * @throws InvalidArgumentException |
|
| 64 | */ |
|
| 65 | private function validateAddress() |
|
| 66 | { |
|
| 67 | $address = $this->address->address; |
|
| 68 | if (empty($address) || !is_string($address)) { |
|
| 69 | throw new \InvalidArgumentException('address should be a string'); |
|
| 70 | } |
|
| 71 | } |
|
| 72 | ||
| 73 | /** |
|
| 74 | * This validate a address number |
|
| @@ 93-99 (lines=7) @@ | ||
| 90 | * @return void |
|
| 91 | * @throws InvalidArgumentException |
|
| 92 | */ |
|
| 93 | private function validateNeighborhood() |
|
| 94 | { |
|
| 95 | $neighborhood = $this->address->neighborhood; |
|
| 96 | if (empty($neighborhood) || !is_string($neighborhood)) { |
|
| 97 | throw new \InvalidArgumentException('neighborhood should be a string'); |
|
| 98 | } |
|
| 99 | } |
|
| 100 | ||
| 101 | /** |
|
| 102 | * This validate a virtual card city |
|
| @@ 107-113 (lines=7) @@ | ||
| 104 | * @return void |
|
| 105 | * @throws InvalidArgumentException |
|
| 106 | */ |
|
| 107 | private function validateCity() |
|
| 108 | { |
|
| 109 | $city = $this->address->city; |
|
| 110 | if (empty($city) || !is_string($city)) { |
|
| 111 | throw new \InvalidArgumentException('city should be a string'); |
|
| 112 | } |
|
| 113 | } |
|
| 114 | ||
| 115 | /** |
|
| 116 | * This validate a virtual card state |
|
| @@ 121-127 (lines=7) @@ | ||
| 118 | * @return void |
|
| 119 | * @throws InvalidArgumentException |
|
| 120 | */ |
|
| 121 | private function validateState() |
|
| 122 | { |
|
| 123 | $state = $this->address->state; |
|
| 124 | if (empty($state) || !is_string($state)) { |
|
| 125 | throw new \InvalidArgumentException('state should be a string'); |
|
| 126 | } |
|
| 127 | } |
|
| 128 | ||
| 129 | /** |
|
| 130 | * This validate a virtual card country |
|
| @@ 135-141 (lines=7) @@ | ||
| 132 | * @return void |
|
| 133 | * @throws InvalidArgumentException |
|
| 134 | */ |
|
| 135 | private function validateCountry() |
|
| 136 | { |
|
| 137 | $country = $this->address->country; |
|
| 138 | if (empty($country) || !is_string($country)) { |
|
| 139 | throw new \InvalidArgumentException('country should be a string'); |
|
| 140 | } |
|
| 141 | } |
|
| 142 | } |
|
| 143 | ||