Completed
Push — master ( 73ee22...737efb )
by Antonio Carlos
08:46
created
src/package/Support/helpers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 use PragmaRX\Countries\Package\Support\Collection;
4 4
 
5
-if (! function_exists('array_sort_by_keys_recursive')) {
5
+if (!function_exists('array_sort_by_keys_recursive')) {
6 6
     /**
7 7
      * Recursively sort array by keys.
8 8
      *
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     }
22 22
 }
23 23
 
24
-if (! function_exists('countriesCollect')) {
24
+if (!function_exists('countriesCollect')) {
25 25
     /**
26 26
      * Check if array is multidimensional.
27 27
      *
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     }
35 35
 }
36 36
 
37
-if (! function_exists('arrayable')) {
37
+if (!function_exists('arrayable')) {
38 38
     /**
39 39
      * Recursively change all array keys case.
40 40
      *
Please login to merge, or discard this patch.
src/update/Cities.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
         $this->helper->message('Processing cities...');
45 45
 
46
-        $normalizerClosure = function ($item) {
46
+        $normalizerClosure = function($item) {
47 47
             $item = $this->updater->addDataSource($item, 'natural');
48 48
 
49 49
             $item = $this->updater->addRecordType($item, 'city');
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
             return $this->updater->normalizeStateOrCityData($item);
52 52
         };
53 53
 
54
-        $codeGeneratorClosure = function ($item) {
54
+        $codeGeneratorClosure = function($item) {
55 55
             return $this->helper->caseForKey($item['nameascii']);
56 56
         };
57 57
 
58
-        $mergerClosure = function ($item) {
58
+        $mergerClosure = function($item) {
59 59
             return $item;
60 60
         };
61 61
 
Please login to merge, or discard this patch.
src/update/Currencies.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,13 +47,13 @@  discard block
 block discarded – undo
47 47
             throw new Exception("No currencies found in {$directory}");
48 48
         }
49 49
 
50
-        $currencies = $currencies->mapWithKeys(function ($currency) {
50
+        $currencies = $currencies->mapWithKeys(function($currency) {
51 51
             return $currency;
52 52
         });
53 53
 
54 54
         $this->helper->message('Processing currencies...');
55 55
 
56
-        $normalizerClosure = function ($item) {
56
+        $normalizerClosure = function($item) {
57 57
             $item = $this->updater->addDataSource($item, 'world-currencies');
58 58
 
59 59
             $item = $this->updater->addRecordType($item, 'currency');
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
             return [$item];
62 62
         };
63 63
 
64
-        $getCodeClosure = function () {
64
+        $getCodeClosure = function() {
65 65
         };
66 66
 
67
-        $generateTaxData = function ($tax) {
67
+        $generateTaxData = function($tax) {
68 68
             return $tax;
69 69
         };
70 70
 
Please login to merge, or discard this patch.
src/update/Taxes.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
         $taxes = $this->helper->loadJsonFiles($this->helper->dataDir('third-party/commerceguys/taxes/types'));
40 40
 
41
-        $taxes = $taxes->mapWithKeys(function ($vat, $key) {
41
+        $taxes = $taxes->mapWithKeys(function($vat, $key) {
42 42
             $parts = coollect(explode('_', $key));
43 43
             $cca2 = $parts->first();
44 44
             $type = $parts->last();
@@ -69,15 +69,15 @@  discard block
 block discarded – undo
69 69
 
70 70
         $this->helper->message('Processing taxes...');
71 71
 
72
-        $normalizerClosure = function ($item) {
72
+        $normalizerClosure = function($item) {
73 73
             return $item;
74 74
         };
75 75
 
76
-        $getCodeClosure = function ($item) {
76
+        $getCodeClosure = function($item) {
77 77
             return $item['tax_type'];
78 78
         };
79 79
 
80
-        $generateTaxData = function ($tax) {
80
+        $generateTaxData = function($tax) {
81 81
             return $this->normalizeTax($tax);
82 82
         };
83 83
 
Please login to merge, or discard this patch.
src/update/States.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
         $this->helper->message('Processing states...');
50 50
 
51
-        $normalizerClosure = function ($item) {
51
+        $normalizerClosure = function($item) {
52 52
             $item = $this->updater->addDataSource($item, 'natural');
53 53
 
54 54
             $item = $this->updater->addRecordType($item, 'state');
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
             return $this->updater->normalizeStateOrCityData($item);
57 57
         };
58 58
 
59
-        $getCodeClosure = function ($item) {
59
+        $getCodeClosure = function($item) {
60 60
             return $this->makeStatePostalCode($item);
61 61
         };
62 62
 
63 63
         $counter = 0;
64 64
 
65
-        $mergerClosure = function ($states) use (&$counter) {
65
+        $mergerClosure = function($states) use (&$counter) {
66 66
             if ($counter++ % 100 === 0) {
67 67
                 $this->helper->message("Processed: $counter");
68 68
             }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             }
94 94
         }
95 95
 
96
-        if (! empty(trim($item->postal))) {
96
+        if (!empty(trim($item->postal))) {
97 97
             $item->postal;
98 98
         }
99 99
 
Please login to merge, or discard this patch.
src/package/Support/Collection.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     private function arrayFinder(string $propertyName, $find, Closure $finderClosure)
110 110
     {
111
-        return $this->filter(function ($data) use ($find, $propertyName, $finderClosure) {
111
+        return $this->filter(function($data) use ($find, $propertyName, $finderClosure) {
112 112
             try {
113 113
                 $attributeValue = $data->{$propertyName};
114 114
             } catch (\Exception $e) {
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     private function _whereKey(string $arrayName, $value)
132 132
     {
133
-        $finderClosure = function ($value, $attributeValue) {
133
+        $finderClosure = function($value, $attributeValue) {
134 134
             return Arr::has($attributeValue, $value);
135 135
         };
136 136
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      */
149 149
     private function _whereAttribute(string $arrayName, $value)
150 150
     {
151
-        $finderClosure = function ($value, $attributeValue) {
151
+        $finderClosure = function($value, $attributeValue) {
152 152
             return \in_array($value, $attributeValue->toArray());
153 153
         };
154 154
 
Please login to merge, or discard this patch.
src/package/Support/Base.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 {
7 7
     public function defineConstants()
8 8
     {
9
-        if (! \defined('__COUNTRIES_DIR__')) {
9
+        if (!\defined('__COUNTRIES_DIR__')) {
10 10
             \define(
11 11
                 '__COUNTRIES_DIR__',
12 12
                 realpath(
Please login to merge, or discard this patch.
src/package/Services/Helper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             throw new Exception('loadJson Error: File name not set');
49 49
         }
50 50
 
51
-        if (! file_exists($file) && ! file_exists($file = $this->dataDir("/$dir/".strtolower($file).'.json'))) {
51
+        if (!file_exists($file) && !file_exists($file = $this->dataDir("/$dir/".strtolower($file).'.json'))) {
52 52
             return coollect();
53 53
         }
54 54
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function loadJsonFiles($dir)
71 71
     {
72
-        return coollect(glob("$dir/*.json*"))->mapWithKeys(function ($file) {
72
+        return coollect(glob("$dir/*.json*"))->mapWithKeys(function($file) {
73 73
             $key = str_replace(['.json5', '.json'], '', basename($file));
74 74
 
75 75
             return [$key => $this->loadJson($file)];
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function moveFilesWildcard($from, $to)
86 86
     {
87
-        coollect(glob($this->dataDir($from)))->each(function ($from) use ($to) {
87
+        coollect(glob($this->dataDir($from)))->each(function($from) use ($to) {
88 88
             $this->mkDir($dir = $this->dataDir($to));
89 89
 
90 90
             rename($from, $dir.'/'.basename($from));
Please login to merge, or discard this patch.
src/update/Nationality.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function load()
37 37
     {
38
-        $mledoze = coollect($this->helper->loadJson('countries', 'third-party/mledoze/dist'))->mapWithKeys(function (
38
+        $mledoze = coollect($this->helper->loadJson('countries', 'third-party/mledoze/dist'))->mapWithKeys(function(
39 39
             $country
40 40
         ) {
41 41
             $country = $this->updater->addDataSource($country, 'mledoze');
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     {
90 90
         [$country, $countryCode] = $this->updater->findCountryByAnyField($mledoze, $natural);
91 91
 
92
-        if (! $country->isEmpty()) {
92
+        if (!$country->isEmpty()) {
93 93
             return [coollect($this->helper->arrayKeysSnakeRecursive($country)), $countryCode];
94 94
         }
95 95
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
             $result[$key] = $mledozeValue; // Natural Earth Vector
138 138
         }
139 139
 
140
-        return coollect($result)->sortBy(function ($value, $key) {
140
+        return coollect($result)->sortBy(function($value, $key) {
141 141
             return $key;
142 142
         });
143 143
     }
Please login to merge, or discard this patch.