@@ -35,7 +35,7 @@ |
||
35 | 35 | /** |
36 | 36 | * Get a parameter of the current route. |
37 | 37 | * |
38 | - * @param $key |
|
38 | + * @param string $key |
|
39 | 39 | * |
40 | 40 | * @return object|string |
41 | 41 | */ |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | public function boot() |
16 | 16 | { |
17 | - Validator::extend('tags_exist', function ($attribute, $tagNames, $parameters) { |
|
17 | + Validator::extend('tags_exist', function($attribute, $tagNames, $parameters) { |
|
18 | 18 | list($tagType) = $parameters; |
19 | 19 | $tagType = new TagType($tagType); |
20 | 20 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | return true; |
31 | 31 | }); |
32 | 32 | |
33 | - Validator::extend('enum', function ($attribute, $value, $parameters) { |
|
33 | + Validator::extend('enum', function($attribute, $value, $parameters) { |
|
34 | 34 | |
35 | 35 | /** @var \App\Foundation\Models\Enums\Enum $class */ |
36 | 36 | $class = $parameters[0]; |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | |
43 | 43 | protected function registerFragmentBreadcrumbs() |
44 | 44 | { |
45 | - BreadCrumbsManager::register('fragments', function ($breadcrumbs) { |
|
45 | + BreadCrumbsManager::register('fragments', function($breadcrumbs) { |
|
46 | 46 | $breadcrumbs->push(fragment('back.fragments.title'), action('Back\FragmentController@index')); |
47 | 47 | }); |
48 | 48 | |
49 | - BreadCrumbsManager::register('fragmentDetail', function ($breadcrumbs, $string) { |
|
49 | + BreadCrumbsManager::register('fragmentDetail', function($breadcrumbs, $string) { |
|
50 | 50 | $breadcrumbs->parent('fragments'); |
51 | 51 | $breadcrumbs->push($string->name, action('Back\FragmentController@edit', $string->id)); |
52 | 52 | }); |
@@ -54,30 +54,30 @@ discard block |
||
54 | 54 | |
55 | 55 | protected function registerUserBreadcrumbs() |
56 | 56 | { |
57 | - BreadCrumbsManager::register('backUserListBack', function ($breadcrumbs) { |
|
57 | + BreadCrumbsManager::register('backUserListBack', function($breadcrumbs) { |
|
58 | 58 | $breadcrumbs->push(fragment('back.backUsers.title'), action('Back\BackUserController@index')); |
59 | 59 | }); |
60 | 60 | |
61 | - BreadCrumbsManager::register('newBackUserBack', function ($breadcrumbs) { |
|
61 | + BreadCrumbsManager::register('newBackUserBack', function($breadcrumbs) { |
|
62 | 62 | $breadcrumbs->parent('backUserListBack'); |
63 | 63 | $breadcrumbs->push(fragment('back.backUsers.new'), action('Back\BackUserController@create')); |
64 | 64 | }); |
65 | 65 | |
66 | - BreadCrumbsManager::register('editBackUserBack', function ($breadcrumbs, $user) { |
|
66 | + BreadCrumbsManager::register('editBackUserBack', function($breadcrumbs, $user) { |
|
67 | 67 | $breadcrumbs->parent('backUserListBack', $user); |
68 | 68 | $breadcrumbs->push($user->present()->fullName, action('Back\BackUserController@edit', $user->id)); |
69 | 69 | }); |
70 | 70 | |
71 | - BreadCrumbsManager::register('frontUserListBack', function ($breadcrumbs) { |
|
71 | + BreadCrumbsManager::register('frontUserListBack', function($breadcrumbs) { |
|
72 | 72 | $breadcrumbs->push(fragment('back.frontUsers.title'), action('Back\FrontUserController@index')); |
73 | 73 | }); |
74 | 74 | |
75 | - BreadCrumbsManager::register('newFrontUserBack', function ($breadcrumbs) { |
|
75 | + BreadCrumbsManager::register('newFrontUserBack', function($breadcrumbs) { |
|
76 | 76 | $breadcrumbs->parent('frontUserListBack'); |
77 | 77 | $breadcrumbs->push(fragment('back.frontUsers.new'), action('Back\FrontUserController@create')); |
78 | 78 | }); |
79 | 79 | |
80 | - BreadCrumbsManager::register('editFrontUserBack', function ($breadcrumbs, $user) { |
|
80 | + BreadCrumbsManager::register('editFrontUserBack', function($breadcrumbs, $user) { |
|
81 | 81 | $breadcrumbs->parent('frontUserListBack', $user); |
82 | 82 | $breadcrumbs->push($user->present()->fullName, action('Back\FrontUserController@edit', $user->id)); |
83 | 83 | }); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | BreadCrumbsManager::register( |
95 | 95 | "{$singular}ListBack", |
96 | - function ($breadcrumbs) use ($ucname, $plural) { |
|
96 | + function($breadcrumbs) use ($ucname, $plural) { |
|
97 | 97 | $breadcrumbs->push( |
98 | 98 | fragment("back.{$plural}.title"), |
99 | 99 | action("Back\\{$ucname}Controller@index") |
@@ -103,12 +103,11 @@ discard block |
||
103 | 103 | |
104 | 104 | BreadCrumbsManager::register( |
105 | 105 | "{$singular}Back", |
106 | - function ($breadcrumbs, $model) use ($singular, $ucname, $plural) { |
|
106 | + function($breadcrumbs, $model) use ($singular, $ucname, $plural) { |
|
107 | 107 | $breadcrumbs->parent("{$singular}ListBack"); |
108 | 108 | |
109 | 109 | $breadcrumbs->push( |
110 | - $model->isDraft() ? fragment("back.{$plural}.new") : |
|
111 | - (isset($model->name) ? $model->name : ucfirst(fragment('back.change'))), |
|
110 | + $model->isDraft() ? fragment("back.{$plural}.new") : (isset($model->name) ? $model->name : ucfirst(fragment('back.change'))), |
|
112 | 111 | action("Back\\{$ucname}Controller@create") |
113 | 112 | ); |
114 | 113 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | protected function registerSection() |
26 | 26 | { |
27 | - Request::macro('section', function () { |
|
27 | + Request::macro('section', function() { |
|
28 | 28 | |
29 | 29 | if (request()->segment(1) === 'blender') { |
30 | 30 | return 'back'; |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | return 'front'; |
34 | 34 | }); |
35 | 35 | |
36 | - Request::macro('isFront', function () { |
|
36 | + Request::macro('isFront', function() { |
|
37 | 37 | return request()->section() === 'front'; |
38 | 38 | }); |
39 | 39 | |
40 | - Request::macro('isBack', function () { |
|
40 | + Request::macro('isBack', function() { |
|
41 | 41 | return request()->section() === 'back'; |
42 | 42 | }); |
43 | 43 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | return Cache::rememberForever( |
32 | 32 | "locale.fragments.{$locale}.{$group}", |
33 | - function () use ($group, $locale) { |
|
33 | + function() use ($group, $locale) { |
|
34 | 34 | return Fragment::getGroup($group, $locale); |
35 | 35 | } |
36 | 36 | ); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public static function findByName(string $name) |
20 | 20 | { |
21 | - return app('cache')->rememberForever("fragment.findByName.{$name}", function () use ($name) { |
|
21 | + return app('cache')->rememberForever("fragment.findByName.{$name}", function() use ($name) { |
|
22 | 22 | return static::where('name', $name)->first(); |
23 | 23 | }); |
24 | 24 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | return static::query() |
29 | 29 | ->where('name', 'LIKE', "{$group}.%") |
30 | 30 | ->get() |
31 | - ->map(function (Fragment $fragment) use ($locale, $group) { |
|
31 | + ->map(function(Fragment $fragment) use ($locale, $group) { |
|
32 | 32 | return [ |
33 | 33 | 'key' => preg_replace("/{$group}\\./", '', $fragment->name, 1), |
34 | 34 | 'text' => $fragment->translate($locale)->text, |
@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public static function bootHasUrl() |
8 | 8 | { |
9 | - static::saving(function ($model) { |
|
9 | + static::saving(function($model) { |
|
10 | 10 | |
11 | 11 | if (!in_array('name', $model->translatable ?? [])) { |
12 | 12 | $model->url = str_slug($model->name); |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | public function boot() |
12 | 12 | { |
13 | - Builder::macro('if', function (bool $condition, string $column, string $operator, $value) { |
|
13 | + Builder::macro('if', function(bool $condition, string $column, string $operator, $value) { |
|
14 | 14 | if ($condition) { |
15 | 15 | return $this->where($column, $operator, $value); |
16 | 16 | } |
@@ -99,7 +99,7 @@ |
||
99 | 99 | |
100 | 100 | public function locales(array $locales, string $current) : string |
101 | 101 | { |
102 | - $list = array_reduce($locales, function (array $list, string $locale) { |
|
102 | + $list = array_reduce($locales, function(array $list, string $locale) { |
|
103 | 103 | $list[$locale] = trans("locales.{$locale}"); |
104 | 104 | |
105 | 105 | return $list; |