@@ -15,7 +15,7 @@ |
||
15 | 15 | $file = __DIR__.'/../../resources/csv/provinces.csv'; |
16 | 16 | $header = ['id', 'name', 'lat', 'long']; |
17 | 17 | $data = $csv->csv_to_array($file, $header); |
18 | - $provinces = array_map(function ($arr) use ($now) { |
|
18 | + $provinces = array_map(function($arr) use ($now) { |
|
19 | 19 | return [ |
20 | 20 | 'country_id' => 104, |
21 | 21 | 'name' => $arr['name'], |
@@ -14,7 +14,7 @@ |
||
14 | 14 | $file = __DIR__.'/../../resources/csv/districts.csv'; |
15 | 15 | $header = ['id', 'city_id', 'name', 'lat', 'long']; |
16 | 16 | $data = $csv->csv_to_array($file, $header); |
17 | - $districts = array_map(function ($arr) use ($now) { |
|
17 | + $districts = array_map(function($arr) use ($now) { |
|
18 | 18 | return [ |
19 | 19 | 'name' => $arr['name'], |
20 | 20 | 'city_id' => $arr['city_id'], |
@@ -17,7 +17,7 @@ |
||
17 | 17 | $header = ['id', 'district_id', 'name', 'lat', 'long']; |
18 | 18 | $data = $csv->csv_to_array($file->getRealPath(), $header); |
19 | 19 | |
20 | - $villages = array_map(function ($arr) use ($now) { |
|
20 | + $villages = array_map(function($arr) use ($now) { |
|
21 | 21 | return [ |
22 | 22 | 'district_id' => $arr['district_id'], |
23 | 23 | 'name' => $arr['name'], |
@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public function run() |
17 | 17 | { |
18 | - $colors = array_map(function ($color) { |
|
18 | + $colors = array_map(function($color) { |
|
19 | 19 | return [ |
20 | 20 | 'name' => $color['name'], |
21 | 21 | 'code' => $color['code'], |
@@ -17,7 +17,7 @@ |
||
17 | 17 | { |
18 | 18 | $file = __DIR__.'/../../resources/countries.json'; |
19 | 19 | $data = json_decode(file_get_contents($file), true); |
20 | - $countries = array_map(function ($country) { |
|
20 | + $countries = array_map(function($country) { |
|
21 | 21 | return [ |
22 | 22 | 'capital' => $country['capital'] ?? null, |
23 | 23 | 'citizenship' => ((isset($country['citizenship'])) ? $country['citizenship'] : null), |
@@ -19,7 +19,7 @@ |
||
19 | 19 | $file = __DIR__.'/../../resources/currencies.json'; |
20 | 20 | |
21 | 21 | $data = json_decode(file_get_contents($file), true); |
22 | - $currencies = array_map(function ($currency) { |
|
22 | + $currencies = array_map(function($currency) { |
|
23 | 23 | return [ |
24 | 24 | 'priority' => isset($currency['priority']) ? $currency['priority'] : 100, |
25 | 25 | 'iso_code' => isset($currency['iso_code']) ? $currency['iso_code'] : null, |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $this->info("Processing {$count} Province"); |
47 | 47 | $bar = $this->output->createProgressBar($count); |
48 | 48 | $bar->start(); |
49 | - Province::cursor()->each(function ($item) use ($bar) { |
|
49 | + Province::cursor()->each(function($item) use ($bar) { |
|
50 | 50 | $meta = $item->meta; |
51 | 51 | $geocoding = \Geocoder::getCoordinatesForAddress($item->address); |
52 | 52 | $meta['lat'] = $geocoding['lat'] ?? null; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $this->info("Processing {$count} City"); |
63 | 63 | $bar = $this->output->createProgressBar($count); |
64 | 64 | $bar->start(); |
65 | - City::with('provinsi')->cursor()->each(function ($item) use ($bar) { |
|
65 | + City::with('provinsi')->cursor()->each(function($item) use ($bar) { |
|
66 | 66 | $meta = $item->meta; |
67 | 67 | $geocoding = \Geocoder::getCoordinatesForAddress($item->address); |
68 | 68 | $meta['lat'] = $geocoding['lat'] ?? null; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $this->info("Processing {$count} District"); |
79 | 79 | $bar = $this->output->createProgressBar($count); |
80 | 80 | $bar->start(); |
81 | - District::with('kabupaten.provinsi')->cursor()->each(function ($item) use ($bar) { |
|
81 | + District::with('kabupaten.provinsi')->cursor()->each(function($item) use ($bar) { |
|
82 | 82 | $meta = $item->meta; |
83 | 83 | $geocoding = \Geocoder::getCoordinatesForAddress($item->address); |
84 | 84 | $meta['lat'] = $geocoding['lat'] ?? null; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $this->info("Processing {$count} Village"); |
95 | 95 | $bar = $this->output->createProgressBar($count); |
96 | 96 | $bar->start(); |
97 | - Village::whereNull('meta')->cursor()->each(function ($item) use ($bar) { |
|
97 | + Village::whereNull('meta')->cursor()->each(function($item) use ($bar) { |
|
98 | 98 | $meta = $item->meta; |
99 | 99 | if (!$meta) { |
100 | 100 | try { |
@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | public function register() |
13 | 13 | { |
14 | - $this->app->bind('master', function () { |
|
14 | + $this->app->bind('master', function() { |
|
15 | 15 | return new MasterService(); |
16 | 16 | }); |
17 | 17 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | public function __construct() |
45 | 45 | { |
46 | 46 | $this->storage = app('currency')->getDriver(); |
47 | - $this->currencies = include(__DIR__ . '/../../resources/currencies.php'); |
|
47 | + $this->currencies = include(__DIR__.'/../../resources/currencies.php'); |
|
48 | 48 | |
49 | 49 | parent::__construct(); |
50 | 50 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $data['code'] = $currency; |
93 | 93 | |
94 | 94 | if (is_string($result = $this->storage->create($data))) { |
95 | - $this->output->writeln('<error>' . ($result ?: 'Failed') . '</error>'); |
|
95 | + $this->output->writeln('<error>'.($result ?: 'Failed').'</error>'); |
|
96 | 96 | } else { |
97 | 97 | $this->output->writeln("<info>success</info>"); |
98 | 98 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $this->output->write("Updating {$currency} currency..."); |
116 | 116 | |
117 | 117 | if (is_string($result = $this->storage->update($currency, $data))) { |
118 | - $this->output->writeln('<error>' . ($result ?: 'Failed') . '</error>'); |
|
118 | + $this->output->writeln('<error>'.($result ?: 'Failed').'</error>'); |
|
119 | 119 | } else { |
120 | 120 | $this->output->writeln("<info>success</info>"); |
121 | 121 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $this->output->write("Deleting {$currency} currency..."); |
134 | 134 | |
135 | 135 | if (is_string($result = $this->storage->delete($currency))) { |
136 | - $this->output->writeln('<error>' . ($result ?: 'Failed') . '</error>'); |
|
136 | + $this->output->writeln('<error>'.($result ?: 'Failed').'</error>'); |
|
137 | 137 | } else { |
138 | 138 | $this->output->writeln("<info>success</info>"); |
139 | 139 | } |