@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function purge(Collection $parameters) |
54 | 54 | { |
55 | - $promises = $parameters->map(function ($parameters, $identifier) { |
|
55 | + $promises = $parameters->map(function($parameters, $identifier) { |
|
56 | 56 | return $this->client->deleteAsync("zones/{$identifier}/purge_cache", [ |
57 | 57 | \GuzzleHttp\RequestOptions::JSON => $parameters, |
58 | 58 | ]); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $promises->toArray(), |
79 | 79 | $this->onFulfilled($results), |
80 | 80 | $this->onRejected($results) |
81 | - )->then(function () use ($results) { |
|
81 | + )->then(function() use ($results) { |
|
82 | 82 | return $results; |
83 | 83 | }); |
84 | 84 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | protected function onFulfilled(Collection $results) |
93 | 93 | { |
94 | - return function ($response, $identifier) use ($results) { |
|
94 | + return function($response, $identifier) use ($results) { |
|
95 | 95 | return $results->put($identifier, $this->getBody($response)); |
96 | 96 | }; |
97 | 97 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | protected function onRejected(Collection $results) |
106 | 106 | { |
107 | - return function ($reason, $identifier) use ($results) { |
|
107 | + return function($reason, $identifier) use ($results) { |
|
108 | 108 | $this->logger->error($reason->getMessage(), [ |
109 | 109 | 'zone' => $identifier, |
110 | 110 | 'exception' => $reason, |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | protected function registerClient() |
38 | 38 | { |
39 | - $this->app->bind(Client::class, function () { |
|
39 | + $this->app->bind(Client::class, function() { |
|
40 | 40 | return new Client( |
41 | 41 | $this->bootGuzzleClient(), |
42 | 42 | $this->app['log'] |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | protected function registerCommands() |
61 | 61 | { |
62 | - $this->app->bind(Commands\Cache\Purge::class, function () { |
|
62 | + $this->app->bind(Commands\Cache\Purge::class, function() { |
|
63 | 63 | return new Commands\Cache\Purge( |
64 | 64 | $this->app[Client::class], |
65 | 65 | $this->app['config']['cloudflare.zones'] |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return \Illuminate\Support\Collection |
82 | 82 | */ |
83 | - Collection::macro('_transpose', function () { |
|
83 | + Collection::macro('_transpose', function() { |
|
84 | 84 | $keys = $this->keys()->all(); |
85 | 85 | |
86 | - $params = array_merge([function () use ($keys) { |
|
86 | + $params = array_merge([function() use ($keys) { |
|
87 | 87 | return new static(array_combine($keys, func_get_args())); |
88 | 88 | }], $this->toArray()); |
89 | 89 | |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | * @param mixed $value |
97 | 97 | * @return \Illuminate\Support\Collection |
98 | 98 | */ |
99 | - Collection::macro('insertBetween', function ($value) { |
|
100 | - return $this->values()->flatMap(function ($item, $index) use ($value) { |
|
99 | + Collection::macro('insertBetween', function($value) { |
|
100 | + return $this->values()->flatMap(function($item, $index) use ($value) { |
|
101 | 101 | return [$index ? $value : null, $item]; |
102 | 102 | })->forget(0)->values(); |
103 | 103 | }); |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | * @param mixed $keys |
109 | 109 | * @return \Illuminate\Support\Collection |
110 | 110 | */ |
111 | - Collection::macro('reorder', function ($keys) { |
|
111 | + Collection::macro('reorder', function($keys) { |
|
112 | 112 | $order = $this->getArrayableItems($keys); |
113 | 113 | |
114 | - return $this->sortBy(function ($item, $key) use ($order) { |
|
114 | + return $this->sortBy(function($item, $key) use ($order) { |
|
115 | 115 | return array_search($key, $order); |
116 | 116 | }); |
117 | 117 | }); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | $this->client = $client; |
63 | 63 | |
64 | - $this->zones = collect($zones)->map(function ($zone) { |
|
64 | + $this->zones = collect($zones)->map(function($zone) { |
|
65 | 65 | return new ParameterBag(array_filter($zone)); |
66 | 66 | }); |
67 | 67 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | return $zones; |
111 | 111 | } |
112 | 112 | |
113 | - return $zones->each(function ($zone) use ($defaults) { |
|
113 | + return $zones->each(function($zone) use ($defaults) { |
|
114 | 114 | $zone->replace($defaults); |
115 | 115 | }); |
116 | 116 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | private function purge(Collection $zones) |
125 | 125 | { |
126 | - $parameters = $zones->map(function ($zone) { |
|
126 | + $parameters = $zones->map(function($zone) { |
|
127 | 127 | if ($zone->count()) { |
128 | 128 | return $zone->all(); |
129 | 129 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | ]; |
153 | 153 | |
154 | 154 | // Get the status emoji |
155 | - $emoji = $results->pluck('success')->map(function ($success) { |
|
155 | + $emoji = $results->pluck('success')->map(function($success) { |
|
156 | 156 | return $success ? '✅' : '❌'; |
157 | 157 | }); |
158 | 158 | |
@@ -160,24 +160,24 @@ discard block |
||
160 | 160 | $identifiers = $zones->keys(); |
161 | 161 | |
162 | 162 | // Get the files as multiline strings |
163 | - $files = $zones->map(function ($zones) { |
|
163 | + $files = $zones->map(function($zones) { |
|
164 | 164 | return $this->formatItems($zones->get('files')); |
165 | 165 | }); |
166 | 166 | |
167 | 167 | // Get the tags as multiline strings |
168 | - $tags = $zones->map(function ($zones) { |
|
168 | + $tags = $zones->map(function($zones) { |
|
169 | 169 | return $this->formatItems($zones->get('tags')); |
170 | 170 | }); |
171 | 171 | |
172 | 172 | // Get the hosts as multiline strings |
173 | - $hosts = $zones->map(function ($zones) { |
|
173 | + $hosts = $zones->map(function($zones) { |
|
174 | 174 | return $this->formatItems($zones->get('hosts')); |
175 | 175 | }); |
176 | 176 | |
177 | 177 | // Get the errors as red multiline strings |
178 | - $errors = $results->map(function ($result) { |
|
178 | + $errors = $results->map(function($result) { |
|
179 | 179 | return $this->formatErrors($result->errors); |
180 | - })->map(function ($errors) { |
|
180 | + })->map(function($errors) { |
|
181 | 181 | return $this->formatItems($errors); |
182 | 182 | }); |
183 | 183 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | */ |
215 | 215 | private function formatErrors(array $errors) |
216 | 216 | { |
217 | - return array_map(function ($error) { |
|
217 | + return array_map(function($error) { |
|
218 | 218 | if (isset($error->code)) { |
219 | 219 | return "<fg=red>{$error->code}: {$error->message}</>"; |
220 | 220 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | */ |
231 | 231 | private function getZones() |
232 | 232 | { |
233 | - if (! $zone = $this->argument('zone')) { |
|
233 | + if (!$zone = $this->argument('zone')) { |
|
234 | 234 | return $this->zones; |
235 | 235 | } |
236 | 236 |