@@ -8,17 +8,17 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function register() |
| 10 | 10 | { |
| 11 | - Menu::macro('front', function () { |
|
| 11 | + Menu::macro('front', function() { |
|
| 12 | 12 | return Menu::new()->setActiveFromRequest(locale()); |
| 13 | 13 | }); |
| 14 | 14 | |
| 15 | - Menu::macro('main', function () { |
|
| 15 | + Menu::macro('main', function() { |
|
| 16 | 16 | return Menu::front() |
| 17 | 17 | ->addClass('nav navbar-nav') |
| 18 | 18 | ->url('/', 'Home'); |
| 19 | 19 | }); |
| 20 | 20 | |
| 21 | - Menu::macro('language', function () { |
|
| 21 | + Menu::macro('language', function() { |
|
| 22 | 22 | $menu = Menu::front(); |
| 23 | 23 | |
| 24 | 24 | foreach (config('app.locales') as $locale) { |
@@ -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 | } |
@@ -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 | } |
@@ -10,32 +10,32 @@ discard block |
||
| 10 | 10 | { |
| 11 | 11 | public function register() |
| 12 | 12 | { |
| 13 | - Menu::macro('back', function () { |
|
| 13 | + Menu::macro('back', function() { |
|
| 14 | 14 | return Menu::new() |
| 15 | 15 | ->setActiveClass('-active') |
| 16 | 16 | ->setActiveFromRequest('/blender'); |
| 17 | 17 | }); |
| 18 | 18 | |
| 19 | - Menu::macro('moduleGroup', function ($title) { |
|
| 19 | + Menu::macro('moduleGroup', function($title) { |
|
| 20 | 20 | return Menu::back() |
| 21 | 21 | ->addParentClass('menu_group') |
| 22 | 22 | ->setParentAttribute('data-menu-group', fragment("back.nav.{$title}")) |
| 23 | - ->registerFilter(function (Link $link) { |
|
| 23 | + ->registerFilter(function(Link $link) { |
|
| 24 | 24 | $link->addParentClass('menu_group_item'); |
| 25 | 25 | }); |
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | - Menu::macro('startSecondary', function () { |
|
| 29 | - return $this->registerFilter(function (Link $link) { |
|
| 28 | + Menu::macro('startSecondary', function() { |
|
| 29 | + return $this->registerFilter(function(Link $link) { |
|
| 30 | 30 | $link->addParentClass('-secondary'); |
| 31 | 31 | }); |
| 32 | 32 | }); |
| 33 | 33 | |
| 34 | - Menu::macro('module', function (string $action, string $name) { |
|
| 34 | + Menu::macro('module', function(string $action, string $name) { |
|
| 35 | 35 | return $this->action("Back\\{$action}", fragment("back.{$name}")); |
| 36 | 36 | }); |
| 37 | 37 | |
| 38 | - Menu::macro('backMain', function () { |
|
| 38 | + Menu::macro('backMain', function() { |
|
| 39 | 39 | return Menu::back() |
| 40 | 40 | ->addClass('menu_groups') |
| 41 | 41 | ->setAttribute('data-menu-groups') |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | ); |
| 68 | 68 | }); |
| 69 | 69 | |
| 70 | - Menu::macro('backUser', function () { |
|
| 70 | + Menu::macro('backUser', function() { |
|
| 71 | 71 | |
| 72 | 72 | $avatar = HTML::avatar(current_user(), '-small'). |
| 73 | 73 | el('span.:response-desktop-only', current_user()->email); |