@@ -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 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | public function getPermissionsAttr(AdminRole $model) |
34 | 34 | { |
35 | 35 | $permissions = "<div style='margin-bottom: 5px;'>"; |
36 | - $permissions .= collect($model->permissions)->map(function ($permission, $index) { |
|
36 | + $permissions .= collect($model->permissions)->map(function($permission, $index) { |
|
37 | 37 | $br = $index && $index % 3 == 0 ? '</div><div style=\'margin-bottom: 5px;\'>' : ''; |
38 | 38 | |
39 | 39 | return "<span class='label label-success'>{$permission->name}</span>{$br}"; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | public function getRolesAttr(AdminMenu $model) |
37 | 37 | { |
38 | 38 | $roles = "<div style='margin-bottom: 5px;'>"; |
39 | - $roles .= collect($model->roles)->map(function ($role, $index) { |
|
39 | + $roles .= collect($model->roles)->map(function($role, $index) { |
|
40 | 40 | $br = $index && $index % 3 == 0 ? '</div><div style=\'margin-bottom: 5px;\'>' : ''; |
41 | 41 | |
42 | 42 | return "<span class='label label-success'>{$role->name}</span>{$br}"; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | public function getRolesAttr(AdminUser $model) |
41 | 41 | { |
42 | 42 | $roles = "<div style='margin-bottom: 5px;'>"; |
43 | - $roles .= collect($model->roles)->map(function ($role, $index) { |
|
43 | + $roles .= collect($model->roles)->map(function($role, $index) { |
|
44 | 44 | $br = $index && $index % 3 == 0 ? '</div><div style=\'margin-bottom: 5px;\'>' : ''; |
45 | 45 | |
46 | 46 | return "<span class='label label-success'>{$role->name}</span>{$br}"; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function getPermissionsAttr(AdminUser $model) |
54 | 54 | { |
55 | 55 | $permissions = "<div style='margin-bottom: 5px;'>"; |
56 | - $permissions .= collect($model->permissions)->map(function ($permission, $index) { |
|
56 | + $permissions .= collect($model->permissions)->map(function($permission, $index) { |
|
57 | 57 | $br = $index && $index % 3 == 0 ? '</div><div style=\'margin-bottom: 5px;\'>' : ''; |
58 | 58 | |
59 | 59 | return "<span class='label label-success'>{$permission->name}</span>{$br}"; |
@@ -433,7 +433,7 @@ |
||
433 | 433 | * @return bool |
434 | 434 | */ |
435 | 435 | public function saveImage($image, $exif, $final_path_with_name, |
436 | - &$final_file_sha1 = null, &$final_file_size = null) |
|
436 | + &$final_file_sha1 = null, &$final_file_size = null) |
|
437 | 437 | { |
438 | 438 | // set correct orientation |
439 | 439 | if (!empty($exif) && is_array($exif)) { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | try { |
215 | 215 | $image = Image::make($source); |
216 | 216 | } catch (StoreImageException $e) { |
217 | - throw new StoreImageException('YeelightImageService: Unable to make image [' + (string) $e + ']'); |
|
217 | + throw new StoreImageException('YeelightImageService: Unable to make image [' +(string) $e + ']'); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | $is_allowed_animated_gif = $isAllowGIF && $isGIF; |
@@ -374,21 +374,21 @@ discard block |
||
374 | 374 | } |
375 | 375 | |
376 | 376 | // convert to image |
377 | - $img = Image::cache(function ($image) use ($file_path, $imageTemplate) { |
|
377 | + $img = Image::cache(function($image) use ($file_path, $imageTemplate) { |
|
378 | 378 | /* @var \Intervention\Image\Image $image */ |
379 | 379 | $image->make($file_path); |
380 | 380 | |
381 | 381 | // resize |
382 | 382 | if (!$imageTemplate->isOriginal()) { |
383 | 383 | if ($imageTemplate->isHeighten()) { |
384 | - $image->heighten($imageTemplate->getHeight(), function ($constraint) use ($imageTemplate) { |
|
384 | + $image->heighten($imageTemplate->getHeight(), function($constraint) use ($imageTemplate) { |
|
385 | 385 | if ($imageTemplate->isRatio()) { |
386 | 386 | $constraint->aspectRatio(); |
387 | 387 | } |
388 | 388 | $constraint->upsize(); |
389 | 389 | }); |
390 | 390 | } elseif ($imageTemplate->isWiden()) { |
391 | - $image->widen($imageTemplate->getWidth(), function ($constraint) use ($imageTemplate) { |
|
391 | + $image->widen($imageTemplate->getWidth(), function($constraint) use ($imageTemplate) { |
|
392 | 392 | if ($imageTemplate->isRatio()) { |
393 | 393 | $constraint->aspectRatio(); |
394 | 394 | } |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | $image->fit($imageTemplate->getWidth(), $imageTemplate->getHeight()); |
401 | 401 | } else { |
402 | 402 | $image->resize($imageTemplate->getWidth(), $imageTemplate->getHeight(), |
403 | - function ($constraint) use ($imageTemplate) { |
|
403 | + function($constraint) use ($imageTemplate) { |
|
404 | 404 | if ($imageTemplate->isRatio()) { |
405 | 405 | $constraint->aspectRatio(); |
406 | 406 | } |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | } |
488 | 488 | |
489 | 489 | // resize |
490 | - $image->resize($newWidth, $newHeight, function ($constraint) { |
|
490 | + $image->resize($newWidth, $newHeight, function($constraint) { |
|
491 | 491 | $constraint->aspectRatio(); |
492 | 492 | $constraint->upsize(); |
493 | 493 | }); |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | |
563 | 563 | return $image_data; |
564 | 564 | } catch (StoreImageException $e) { |
565 | - \Log::error('YeelightImageService: Unable to convert to image [' + (string) $e + ']'); |
|
565 | + \Log::error('YeelightImageService: Unable to convert to image [' +(string) $e + ']'); |
|
566 | 566 | |
567 | 567 | return; |
568 | 568 | } |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | |
577 | 577 | return $is_gif; |
578 | 578 | } catch (StoreImageException $e) { |
579 | - \Log::error('YeelightImageService: Unable to convert to image [' + (string) $e + ']'); |
|
579 | + \Log::error('YeelightImageService: Unable to convert to image [' +(string) $e + ']'); |
|
580 | 580 | |
581 | 581 | return false; |
582 | 582 | } |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | 'Content-Disposition' => "attachment; filename=\"$filename\"", |
28 | 28 | ]; |
29 | 29 | |
30 | - response()->stream(function () { |
|
30 | + response()->stream(function() { |
|
31 | 31 | $handle = fopen('php://output', 'w'); |
32 | 32 | |
33 | 33 | $titles = []; |
34 | 34 | |
35 | - $this->chunk(function ($records) use ($handle, &$titles) { |
|
35 | + $this->chunk(function($records) use ($handle, &$titles) { |
|
36 | 36 | if (empty($titles)) { |
37 | 37 | $titles = $this->getHeaderRowFromRecords($records); |
38 | 38 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function getHeaderRowFromRecords(Collection $records): array |
61 | 61 | { |
62 | 62 | $titles = collect(array_dot($records->first()->toArray()))->keys()->map( |
63 | - function ($key) { |
|
63 | + function($key) { |
|
64 | 64 | $key = str_replace('.', ' ', $key); |
65 | 65 | |
66 | 66 | return Str::ucfirst($key); |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function export() |
23 | 23 | { |
24 | - Excel::create($this->getTable().date('YmdHis'), function ($excel) { |
|
25 | - $excel->sheet($this->getTable(), function ($sheet) { |
|
24 | + Excel::create($this->getTable().date('YmdHis'), function($excel) { |
|
25 | + $excel->sheet($this->getTable(), function($sheet) { |
|
26 | 26 | $titles = []; |
27 | 27 | |
28 | - $this->chunk(function ($records) use ($sheet, &$titles) { |
|
28 | + $this->chunk(function($records) use ($sheet, &$titles) { |
|
29 | 29 | if (empty($titles)) { |
30 | 30 | $titles = $this->getHeaderRowFromRecords($records); |
31 | 31 | $sheet->prependRow($titles); |
32 | 32 | } |
33 | - $rows = collect($records->toArray())->map(function ($item) { |
|
33 | + $rows = collect($records->toArray())->map(function($item) { |
|
34 | 34 | $return = []; |
35 | 35 | foreach ($item as $in => $it) { |
36 | 36 | if (is_array($it)) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function getHeaderRowFromRecords(Collection $records): array |
57 | 57 | { |
58 | 58 | $titles = collect(array_dot($records->first()->toArray()))->keys()->map( |
59 | - function ($key) { |
|
59 | + function($key) { |
|
60 | 60 | $key = str_replace('.', ' ', $key); |
61 | 61 | |
62 | 62 | return Str::ucfirst($key); |