@@ -10,6 +10,9 @@ |
||
10 | 10 | */ |
11 | 11 | class ArticlePresenter extends Presenter |
12 | 12 | { |
13 | + /** |
|
14 | + * @param integer $characters |
|
15 | + */ |
|
13 | 16 | public function tease($characters, $moreTextIndicator = '...') : Str |
14 | 17 | { |
15 | 18 | return (string) string($this->entity->text)->tease($characters, $moreTextIndicator); |
@@ -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, |
@@ -32,7 +32,7 @@ |
||
32 | 32 | public static function findByNameOrCreate(string $name, TagType $type) : Tag |
33 | 33 | { |
34 | 34 | $existing = Tag::nonDraft()->get() |
35 | - ->first(function (int $id, Tag $tag) use ($name) { |
|
35 | + ->first(function(int $id, Tag $tag) use ($name) { |
|
36 | 36 | return $tag->translate('name', content_locale()) === $name; |
37 | 37 | }); |
38 | 38 |
@@ -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; |
@@ -2,24 +2,24 @@ discard block |
||
2 | 2 | |
3 | 3 | Route::demoAccess('/demo'); |
4 | 4 | |
5 | -Route::get('coming-soon', function () { |
|
5 | +Route::get('coming-soon', function() { |
|
6 | 6 | return view('temp/index'); |
7 | 7 | }); |
8 | 8 | |
9 | -Route::group(['namespace' => 'Back', 'prefix' => 'blender'], function () { |
|
9 | +Route::group(['namespace' => 'Back', 'prefix' => 'blender'], function() { |
|
10 | 10 | |
11 | 11 | require __DIR__.'/back_auth.php'; |
12 | 12 | |
13 | - Route::group(['middleware' => 'auth'], function () { |
|
13 | + Route::group(['middleware' => 'auth'], function() { |
|
14 | 14 | require __DIR__.'/back.php'; |
15 | 15 | }); |
16 | 16 | }); |
17 | 17 | |
18 | -Route::group(['namespace' => 'Front', 'middleware' => 'demoMode'], function () { |
|
18 | +Route::group(['namespace' => 'Front', 'middleware' => 'demoMode'], function() { |
|
19 | 19 | |
20 | 20 | $multiLingual = count(config('app.locales')) > 1; |
21 | 21 | |
22 | - Route::group($multiLingual ? ['prefix' => locale()] : [], function () { |
|
22 | + Route::group($multiLingual ? ['prefix' => locale()] : [], function() { |
|
23 | 23 | try { |
24 | 24 | require __DIR__.'/front_auth.php'; |
25 | 25 | require __DIR__.'/front.php'; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | }); |
30 | 30 | |
31 | 31 | if ($multiLingual) { |
32 | - Route::get('/', function () { |
|
32 | + Route::get('/', function() { |
|
33 | 33 | return redirect(locale()); |
34 | 34 | }); |
35 | 35 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | public static function allAsRegex() : string |
24 | 24 | { |
25 | - return collect(static::values())->map(function ($value) { |
|
25 | + return collect(static::values())->map(function($value) { |
|
26 | 26 | return "({$value})"; |
27 | 27 | })->implode('|'); |
28 | 28 | } |