@@ -203,15 +203,15 @@ discard block |
||
| 203 | 203 | { |
| 204 | 204 | $routes = app('router')->getRoutes(); |
| 205 | 205 | $prefix = config('yeelight.backend.tools.api-tester.prefix'); |
| 206 | - $routes = collect($routes)->filter(function ($route) use ($prefix) { |
|
| 206 | + $routes = collect($routes)->filter(function($route) use ($prefix) { |
|
| 207 | 207 | return Str::startsWith($route->uri, config('yeelight.backend.tools.api-tester.prefix')); |
| 208 | - })->map(function ($route) { |
|
| 208 | + })->map(function($route) { |
|
| 209 | 209 | return $this->getRouteInformation($route); |
| 210 | 210 | })->all(); |
| 211 | 211 | if ($sort = request('_sort')) { |
| 212 | 212 | $routes = $this->sortRoutes($sort, $routes); |
| 213 | 213 | } |
| 214 | - $routes = collect($routes)->filter()->map(function ($route) { |
|
| 214 | + $routes = collect($routes)->filter()->map(function($route) { |
|
| 215 | 215 | $route['parameters'] = json_encode($this->getRouteParameters($route['action'])); |
| 216 | 216 | unset($route['middleware'], $route['host'], $route['name'], $route['action']); |
| 217 | 217 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | foreach (array_get($matches, 1, []) as $item) { |
| 247 | 247 | preg_match_all('/(\w+)=[\'"]?([^\r\n"]+)[\'"]?,?\n/s', $item, $match); |
| 248 | 248 | if (count($match) == 3) { |
| 249 | - $match[2] = array_map(function ($val) { |
|
| 249 | + $match[2] = array_map(function($val) { |
|
| 250 | 250 | return trim($val, ','); |
| 251 | 251 | }, $match[2]); |
| 252 | 252 | $parameters[] = array_combine($match[1], $match[2]); |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | protected function sortRoutes($sort, $routes) |
| 304 | 304 | { |
| 305 | - return Arr::sort($routes, function ($route) use ($sort) { |
|
| 305 | + return Arr::sort($routes, function($route) use ($sort) { |
|
| 306 | 306 | return $route[$sort]; |
| 307 | 307 | }); |
| 308 | 308 | } |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | */ |
| 317 | 317 | protected function getRouteMiddleware($route) |
| 318 | 318 | { |
| 319 | - return collect($route->gatherMiddleware())->map(function ($middleware) { |
|
| 319 | + return collect($route->gatherMiddleware())->map(function($middleware) { |
|
| 320 | 320 | return $middleware instanceof \Closure ? 'Closure' : $middleware; |
| 321 | 321 | }); |
| 322 | 322 | } |
@@ -64,8 +64,8 @@ |
||
| 64 | 64 | * Minimum and maximum years to cope with the Year 2038 problem in UNIX. We run PHP which most likely runs on a UNIX environment so we |
| 65 | 65 | * must assume vulnerability. |
| 66 | 66 | */ |
| 67 | - protected $RANGE_YEARS_MIN = 1970; // Must match date range supported by date(). See also: http://en.wikipedia.org/wiki/Year_2038_problem |
|
| 68 | - protected $RANGE_YEARS_MAX = 2037; // Must match date range supported by date(). See also: http://en.wikipedia.org/wiki/Year_2038_problem |
|
| 67 | + protected $RANGE_YEARS_MIN = 1970; // Must match date range supported by date(). See also: http://en.wikipedia.org/wiki/Year_2038_problem |
|
| 68 | + protected $RANGE_YEARS_MAX = 2037; // Must match date range supported by date(). See also: http://en.wikipedia.org/wiki/Year_2038_problem |
|
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * Function: __construct. |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | $method = $this->http_method; |
| 100 | 100 | |
| 101 | - $matches = array_map(function ($path) use ($method) { |
|
| 101 | + $matches = array_map(function($path) use ($method) { |
|
| 102 | 102 | $path = trim(config('yeelight.backend.route.prefix'), '/').$path; |
| 103 | 103 | |
| 104 | 104 | if (Str::contains($path, ':')) { |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | return false; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - $method = collect($match['method'])->filter()->map(function ($method) { |
|
| 135 | + $method = collect($match['method'])->filter()->map(function($method) { |
|
| 136 | 136 | return strtoupper($method); |
| 137 | 137 | }); |
| 138 | 138 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | if (is_array($permission)) { |
| 31 | - collect($permission)->each(function ($permission) { |
|
| 31 | + collect($permission)->each(function($permission) { |
|
| 32 | 32 | call_user_func([Permission::class, 'check'], $permission); |
| 33 | 33 | }); |
| 34 | 34 | |
@@ -43,12 +43,12 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * Fields from libphonenumber\PhoneNumber. |
| 45 | 45 | */ |
| 46 | - public $country_code; // 65 |
|
| 47 | - public $country_code_plus_sign; // +65 |
|
| 46 | + public $country_code; // 65 |
|
| 47 | + public $country_code_plus_sign; // +65 |
|
| 48 | 48 | public $national_number; |
| 49 | 49 | public $extension; |
| 50 | - public $country_code_source; // 0 |
|
| 51 | - public $country_code_source_text; // FROM_NUMBER_WITH_PLUS_SIGN |
|
| 50 | + public $country_code_source; // 0 |
|
| 51 | + public $country_code_source_text; // FROM_NUMBER_WITH_PLUS_SIGN |
|
| 52 | 52 | public $preferred_domestic_carrier_code; |
| 53 | 53 | public $raw_input; |
| 54 | 54 | public $raw_input_country; |
@@ -59,24 +59,24 @@ discard block |
||
| 59 | 59 | public $is_possible_number = false; |
| 60 | 60 | public $is_valid_number = false; |
| 61 | 61 | public $is_mobile_number = false; |
| 62 | - public $region_code_for_number; // SG |
|
| 63 | - public $number_type; // 1 |
|
| 64 | - public $number_type_text; // MOBILE |
|
| 62 | + public $region_code_for_number; // SG |
|
| 63 | + public $number_type; // 1 |
|
| 64 | + public $number_type_text; // MOBILE |
|
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * From Formatting. |
| 68 | 68 | */ |
| 69 | - public $format_e164; // +6590919293 |
|
| 70 | - public $format_national; // 9091 9293 |
|
| 71 | - public $format_international; // +65 9091 9293 |
|
| 72 | - public $format_rfc3966; // tel:+65-9091-9293 |
|
| 69 | + public $format_e164; // +6590919293 |
|
| 70 | + public $format_national; // 9091 9293 |
|
| 71 | + public $format_international; // +65 9091 9293 |
|
| 72 | + public $format_rfc3966; // tel:+65-9091-9293 |
|
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | 75 | * From additional. |
| 76 | 76 | */ |
| 77 | - public $description; // Singapore |
|
| 78 | - public $carrier_name; // M1 |
|
| 79 | - public $timezones; // Asia/Singapore |
|
| 77 | + public $description; // Singapore |
|
| 78 | + public $carrier_name; // M1 |
|
| 79 | + public $timezones; // Asia/Singapore |
|
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | 82 | * PhoneNumberModel constructor. |
@@ -161,7 +161,7 @@ |
||
| 161 | 161 | { |
| 162 | 162 | parent::boot(); |
| 163 | 163 | |
| 164 | - static::deleting(function ($model) { |
|
| 164 | + static::deleting(function($model) { |
|
| 165 | 165 | $model->roles()->detach(); |
| 166 | 166 | |
| 167 | 167 | $model->permissions()->detach(); |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | 'total' => $this->backendPagination->total(), |
| 70 | 70 | ]; |
| 71 | 71 | |
| 72 | - $parameters = collect($parameters)->flatMap(function ($parameter, $key) { |
|
| 72 | + $parameters = collect($parameters)->flatMap(function($parameter, $key) { |
|
| 73 | 73 | return [$key => "<b>$parameter</b>"]; |
| 74 | 74 | }); |
| 75 | 75 | |
@@ -201,7 +201,7 @@ |
||
| 201 | 201 | { |
| 202 | 202 | static::$branchOrder = array_flip(array_flatten($order)); |
| 203 | 203 | |
| 204 | - static::$branchOrder = array_map(function ($item) { |
|
| 204 | + static::$branchOrder = array_map(function($item) { |
|
| 205 | 205 | return ++$item; |
| 206 | 206 | }, static::$branchOrder); |
| 207 | 207 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function getHttpPathAttr(AdminPermission $model) |
| 36 | 36 | { |
| 37 | - return collect(explode("\r\n", $model->http_path))->map(function ($path) use ($model) { |
|
| 37 | + return collect(explode("\r\n", $model->http_path))->map(function($path) use ($model) { |
|
| 38 | 38 | $method = $model->http_method ?: ['ANY']; |
| 39 | 39 | |
| 40 | 40 | if (Str::contains($path, ':')) { |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | $method = explode(',', $method); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - $method = collect($method)->map(function ($name) { |
|
| 45 | + $method = collect($method)->map(function($name) { |
|
| 46 | 46 | return strtoupper($name); |
| 47 | - })->map(function ($name) { |
|
| 47 | + })->map(function($name) { |
|
| 48 | 48 | return "<span class='label label-primary'>{$name}</span>"; |
| 49 | 49 | })->implode(' '); |
| 50 | 50 | |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | public function getHttpMethodAttr(AdminPermission $model) |
| 58 | 58 | { |
| 59 | - return collect($model->http_method)->map(function ($name) { |
|
| 59 | + return collect($model->http_method)->map(function($name) { |
|
| 60 | 60 | return strtoupper($name); |
| 61 | - })->map(function ($name) { |
|
| 61 | + })->map(function($name) { |
|
| 62 | 62 | return "<span class='label label-primary'>{$name}</span>"; |
| 63 | 63 | })->implode(' '); |
| 64 | 64 | } |