@@ -10,24 +10,24 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public function register() |
| 12 | 12 | { |
| 13 | - Menu::macro('front', function () { |
|
| 13 | + Menu::macro('front', function() { |
|
| 14 | 14 | return Menu::new()->setActiveFromRequest(locale()); |
| 15 | 15 | }); |
| 16 | 16 | |
| 17 | - Menu::macro('main', function () { |
|
| 17 | + Menu::macro('main', function() { |
|
| 18 | 18 | return Menu::front() |
| 19 | 19 | ->addClass('nav__list') |
| 20 | 20 | ->url('/', 'Home'); |
| 21 | 21 | }); |
| 22 | 22 | |
| 23 | - Menu::macro('language', function () { |
|
| 24 | - return locales()->reduce(function (Menu $menu, string $locale) { |
|
| 23 | + Menu::macro('language', function() { |
|
| 24 | + return locales()->reduce(function(Menu $menu, string $locale) { |
|
| 25 | 25 | $menu->url($locale, $locale); |
| 26 | 26 | }, Menu::front()); |
| 27 | 27 | }); |
| 28 | 28 | |
| 29 | - Menu::macro('articleSiblings', function (Article $article) { |
|
| 30 | - return $article->siblings->reduce(function (Menu $menu, Article $article) { |
|
| 29 | + Menu::macro('articleSiblings', function(Article $article) { |
|
| 30 | + return $article->siblings->reduce(function(Menu $menu, Article $article) { |
|
| 31 | 31 | return $menu->url($article->fullUrl, $article->name); |
| 32 | 32 | }, Menu::front()); |
| 33 | 33 | }); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | public function isSpecialArticle(): bool |
| 43 | 43 | { |
| 44 | - return ! empty($this->technical_name); |
|
| 44 | + return !empty($this->technical_name); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function children(): HasMany |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | public function getFirstChildAttribute(): Article |
| 58 | 58 | { |
| 59 | - if (! $this->hasChildren()) { |
|
| 59 | + if (!$this->hasChildren()) { |
|
| 60 | 60 | throw new Exception("Article `{$this->id}` doesn't have any children."); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | public function hasParent(): bool |
| 79 | 79 | { |
| 80 | - return ! is_null($this->parent); |
|
| 80 | + return !is_null($this->parent); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | public function getFullUrlAttribute(): string |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | return Cache::rememberForever( |
| 34 | 34 | "article.findByTechnicalName.{$technicalName}", |
| 35 | - function () use ($technicalName) { |
|
| 35 | + function() use ($technicalName) { |
|
| 36 | 36 | return Article::where('technical_name', $technicalName)->firstOrFail(); |
| 37 | 37 | } |
| 38 | 38 | ); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | return Cache::rememberForever( |
| 44 | 44 | "article.getWithTechnicalNameLike.{$technicalName}", |
| 45 | - function () use ($technicalName) { |
|
| 45 | + function() use ($technicalName) { |
|
| 46 | 46 | return Article::where('technical_name', 'like', "{$technicalName}.%") |
| 47 | 47 | ->orderBy('order_column') |
| 48 | 48 | ->get(); |