@@ -46,7 +46,9 @@ |
||
| 46 | 46 | { |
| 47 | 47 | if (!isset(self::$items[$shortCode])) { |
| 48 | 48 | $country = self::getLoader()->loadCountry($shortCode); |
| 49 | - if (!$country) return null; |
|
| 49 | + if (!$country) { |
|
| 50 | + return null; |
|
| 51 | + } |
|
| 50 | 52 | return self::$items[$shortCode] = self::getMapper()->mapArrayToEntity($country); |
| 51 | 53 | } |
| 52 | 54 | return self::$items[$shortCode]; |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | public function loadCountry($country) |
| 39 | 39 | { |
| 40 | 40 | if (!$country) return null; |
| 41 | - $file = $this->path . DIRECTORY_SEPARATOR . sprintf(self::COUNTRY_FILE, $country); |
|
| 41 | + $file = $this->path . DIRECTORY_SEPARATOR . sprintf(self::COUNTRY_FILE, $country); |
|
| 42 | 42 | if (!file_exists($file)) return null; |
| 43 | 43 | |
| 44 | 44 | return json_decode( |
@@ -37,9 +37,13 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function loadCountry($country) |
| 39 | 39 | { |
| 40 | - if (!$country) return null; |
|
| 40 | + if (!$country) { |
|
| 41 | + return null; |
|
| 42 | + } |
|
| 41 | 43 | $file = $this->path . DIRECTORY_SEPARATOR . sprintf(self::COUNTRY_FILE, $country); |
| 42 | - if (!file_exists($file)) return null; |
|
| 44 | + if (!file_exists($file)) { |
|
| 45 | + return null; |
|
| 46 | + } |
|
| 43 | 47 | |
| 44 | 48 | return json_decode( |
| 45 | 49 | file_get_contents($file), |
@@ -53,9 +57,13 @@ discard block |
||
| 53 | 57 | */ |
| 54 | 58 | public function loadCountryPolygon($country) |
| 55 | 59 | { |
| 56 | - if (!$country) return null; |
|
| 60 | + if (!$country) { |
|
| 61 | + return null; |
|
| 62 | + } |
|
| 57 | 63 | $file = $this->path . DIRECTORY_SEPARATOR . sprintf(self::COUNTRY_POLYGON_FILE, $country); |
| 58 | - if (!file_exists($file)) return null; |
|
| 64 | + if (!file_exists($file)) { |
|
| 65 | + return null; |
|
| 66 | + } |
|
| 59 | 67 | |
| 60 | 68 | return json_decode( |
| 61 | 69 | file_get_contents($file), |