@@ -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}"; |
@@ -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); |
@@ -112,7 +112,7 @@ |
||
112 | 112 | protected function initBranchCallback() |
113 | 113 | { |
114 | 114 | if (is_null($this->branchCallback)) { |
115 | - $this->branchCallback = function ($branch) { |
|
115 | + $this->branchCallback = function($branch) { |
|
116 | 116 | $key = $branch[$this->model->getKeyName()]; |
117 | 117 | $title = $branch[$this->model->getTitleColumn()]; |
118 | 118 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | */ |
63 | 63 | public function render() |
64 | 64 | { |
65 | - return $this->tools->map(function ($tool) { |
|
65 | + return $this->tools->map(function($tool) { |
|
66 | 66 | if ($tool instanceof Renderable) { |
67 | 67 | return $tool->render(); |
68 | 68 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function getRootNamespace() |
35 | 35 | { |
36 | - return parent::getRootNamespace() . |
|
36 | + return parent::getRootNamespace(). |
|
37 | 37 | parent::getConfigGeneratorClassPath($this->getPathConfigNode()); |
38 | 38 | } |
39 | 39 | |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getPath() |
56 | 56 | { |
57 | - return $this->getBasePath() . |
|
58 | - '/' . |
|
59 | - parent::getConfigGeneratorClassPath($this->getPathConfigNode(), true) . |
|
60 | - '/' . |
|
61 | - $this->getName() . |
|
57 | + return $this->getBasePath(). |
|
58 | + '/'. |
|
59 | + parent::getConfigGeneratorClassPath($this->getPathConfigNode(), true). |
|
60 | + '/'. |
|
61 | + $this->getName(). |
|
62 | 62 | 'Repository.php'; |
63 | 63 | } |
64 | 64 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function getRootNamespace() |
35 | 35 | { |
36 | - return parent::getRootNamespace() . |
|
36 | + return parent::getRootNamespace(). |
|
37 | 37 | parent::getConfigGeneratorClassPath($this->getPathConfigNode()); |
38 | 38 | } |
39 | 39 | |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getPath() |
56 | 56 | { |
57 | - return $this->getBasePath() . |
|
58 | - '/' . |
|
59 | - parent::getConfigGeneratorClassPath($this->getPathConfigNode(), true) . |
|
60 | - '/' . |
|
61 | - $this->getName() . |
|
57 | + return $this->getBasePath(). |
|
58 | + '/'. |
|
59 | + parent::getConfigGeneratorClassPath($this->getPathConfigNode(), true). |
|
60 | + '/'. |
|
61 | + $this->getName(). |
|
62 | 62 | 'RepositoryEloquent.php'; |
63 | 63 | } |
64 | 64 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | case 'binary': |
158 | 158 | case 'ipAddress': |
159 | 159 | case 'macAddress': |
160 | - return "\t\t'{$field['name']}' => 'like'," . PHP_EOL; |
|
160 | + return "\t\t'{$field['name']}' => 'like',".PHP_EOL; |
|
161 | 161 | case 'integer': |
162 | 162 | case 'tinyInteger': |
163 | 163 | case 'smallInteger': |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | case 'decimal': |
181 | 181 | case 'double': |
182 | 182 | case 'boolean': |
183 | - return "\t\t'{$field['name']}'," . PHP_EOL; |
|
183 | + return "\t\t'{$field['name']}',".PHP_EOL; |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 |