@@ -45,23 +45,23 @@ |
||
| 45 | 45 | //check state |
| 46 | 46 | $statesMap = json_decode(file_get_contents(__DIR__ . '/../Json/US_states.json'), true); |
| 47 | 47 | $state = $address->state; |
| 48 | - if(in_array($state, array_keys($statesMap))){ |
|
| 48 | + if (in_array($state, array_keys($statesMap))) { |
|
| 49 | 49 | $address->state_text = $statesMap[$state]; |
| 50 | - }else if (in_array($state, array_values($statesMap))){ |
|
| 50 | + } else if (in_array($state, array_values($statesMap))) { |
|
| 51 | 51 | $address->state = array_flip($statesMap)[$state]; |
| 52 | 52 | $address->state_text = $state; |
| 53 | - }else{ |
|
| 53 | + } else { |
|
| 54 | 54 | $this->_setError($address, 'The state does not exist'); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | //check addressLine1 |
| 58 | 58 | list($HouseNumber) = explode(' ', $address->addressLine1); |
| 59 | - if(!is_numeric($HouseNumber)){ |
|
| 59 | + if (!is_numeric($HouseNumber)) { |
|
| 60 | 60 | $this->_setError($address, 'The address must start with a number'); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | //check zipcode |
| 64 | - if(!is_numeric($address->zipcode)){ |
|
| 64 | + if (!is_numeric($address->zipcode)) { |
|
| 65 | 65 | $this->_setError($address, 'the Zip code must be a number'); |
| 66 | 66 | } |
| 67 | 67 | } |