@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $countries = $this->cache->remember( |
| 52 | 52 | 'updateTimezone.countries', |
| 53 | 53 | 160, |
| 54 | - function () { |
|
| 54 | + function() { |
|
| 55 | 55 | return $this->helper->loadCsv($this->helper->dataDir('third-party/timezonedb/country.csv')); |
| 56 | 56 | } |
| 57 | 57 | ); |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | $zones = $this->cache->remember( |
| 62 | 62 | 'updateTimezone.zones', |
| 63 | 63 | 160, |
| 64 | - function () { |
|
| 65 | - return $this->helper->loadCsv($this->helper->dataDir('third-party/timezonedb/zone.csv'))->mapWithKeys(function ($value) { |
|
| 64 | + function() { |
|
| 65 | + return $this->helper->loadCsv($this->helper->dataDir('third-party/timezonedb/zone.csv'))->mapWithKeys(function($value) { |
|
| 66 | 66 | return [ |
| 67 | 67 | $value[0] => [ |
| 68 | 68 | 'zone_id' => $value[0], |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | $timezones = $this->cache->remember( |
| 80 | 80 | 'updateTimezone.timezones', |
| 81 | 81 | 160, |
| 82 | - function () { |
|
| 83 | - return $this->helper->loadCsv($this->helper->dataDir('third-party/timezonedb/timezone.csv'))->map(function ($timezone) { |
|
| 82 | + function() { |
|
| 83 | + return $this->helper->loadCsv($this->helper->dataDir('third-party/timezonedb/timezone.csv'))->map(function($timezone) { |
|
| 84 | 84 | return [ |
| 85 | 85 | 'zone_id' => $timezone[0], |
| 86 | 86 | 'abbreviation' => $timezone[1], |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | $abbreviations = $this->cache->remember( |
| 98 | 98 | 'updateTimezone.abbreviations', |
| 99 | 99 | 160, |
| 100 | - function () use ($timezones) { |
|
| 101 | - return $timezones->groupBy('zone_id')->map(function (Coollection $timezones) { |
|
| 102 | - return $timezones->map(function ($timezone) { |
|
| 100 | + function() use ($timezones) { |
|
| 101 | + return $timezones->groupBy('zone_id')->map(function(Coollection $timezones) { |
|
| 102 | + return $timezones->map(function($timezone) { |
|
| 103 | 103 | return $timezone['abbreviation']; |
| 104 | 104 | })->unique()->sort()->values(); |
| 105 | 105 | }); |
@@ -108,13 +108,13 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | $this->helper->progress('Updating countries timezones...'); |
| 110 | 110 | |
| 111 | - $countries = $countries->mapWithKeys(function ($item) { |
|
| 111 | + $countries = $countries->mapWithKeys(function($item) { |
|
| 112 | 112 | return [$item[0] => [ |
| 113 | 113 | 'cca2' => $item[0], |
| 114 | 114 | 'name' => $item[1], |
| 115 | 115 | ]]; |
| 116 | 116 | }) |
| 117 | - ->mapWithKeys(function ($item, $cca2) { |
|
| 117 | + ->mapWithKeys(function($item, $cca2) { |
|
| 118 | 118 | $fields = [ |
| 119 | 119 | ['cca2', 'cca2'], |
| 120 | 120 | ['name.common', 'name'], |
@@ -134,8 +134,8 @@ discard block |
||
| 134 | 134 | 'name' => $item['name'], |
| 135 | 135 | ], |
| 136 | 136 | ]; |
| 137 | - })->map(function ($country) use ($zones, $abbreviations) { |
|
| 138 | - $country['timezones'] = $zones->where('country_code', $country['cca2'])->mapWithKeys(function ($zone) use ($abbreviations, $country) { |
|
| 137 | + })->map(function($country) use ($zones, $abbreviations) { |
|
| 138 | + $country['timezones'] = $zones->where('country_code', $country['cca2'])->mapWithKeys(function($zone) use ($abbreviations, $country) { |
|
| 139 | 139 | $zone['abbreviations'] = $abbreviations[$zone['zone_id']]; |
| 140 | 140 | |
| 141 | 141 | $zone['cca3'] = isset($country['cca3']) ? $country['cca3'] : null; |
@@ -154,14 +154,14 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | $this->helper->message('Generating timezone files...'); |
| 156 | 156 | |
| 157 | - $getCountryCodeClosure = function () { |
|
| 157 | + $getCountryCodeClosure = function() { |
|
| 158 | 158 | }; |
| 159 | 159 | |
| 160 | - $normalizeCountryClosure = function ($country) { |
|
| 160 | + $normalizeCountryClosure = function($country) { |
|
| 161 | 161 | return [$country['timezones']]; |
| 162 | 162 | }; |
| 163 | 163 | |
| 164 | - $dummyClosure = function ($country) { |
|
| 164 | + $dummyClosure = function($country) { |
|
| 165 | 165 | return $country; |
| 166 | 166 | }; |
| 167 | 167 | |