@@ -63,15 +63,15 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $permission = 'update-page'; |
| 65 | 65 | |
| 66 | - if (in_array($verb, ['index','show'])) { |
|
| 66 | + if (in_array($verb, ['index', 'show'])) { |
|
| 67 | 67 | $permission = 'view-page'; |
| 68 | - } elseif (in_array($verb, ['create','store'])) { |
|
| 68 | + } elseif (in_array($verb, ['create', 'store'])) { |
|
| 69 | 69 | $permission = 'create-page'; |
| 70 | 70 | } elseif (in_array($verb, ['delete'])) { |
| 71 | 71 | $permission = 'delete-page'; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if (! auth()->guard('chief')->user()->hasPermissionTo($permission)) { |
|
| 74 | + if (!auth()->guard('chief')->user()->hasPermissionTo($permission)) { |
|
| 75 | 75 | throw NotAllowedManagerRoute::notAllowedPermission($permission, $this); |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | public function saveFields(Request $request) |
| 104 | 104 | { |
| 105 | 105 | // Store the morph_key upon creation |
| 106 | - if (! $this->model->morph_key) { |
|
| 106 | + if (!$this->model->morph_key) { |
|
| 107 | 107 | $this->model->morph_key = $this->model->morphKey(); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | if (is_array_empty($translation)) { |
| 143 | 143 | |
| 144 | 144 | // Nullify all values |
| 145 | - $trans[$locale] = array_map(function ($value) { |
|
| 145 | + $trans[$locale] = array_map(function($value) { |
|
| 146 | 146 | return null; |
| 147 | 147 | }, $translation); |
| 148 | 148 | continue; |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | public function register() |
| 15 | 15 | { |
| 16 | - $this->app->singleton(Settings::class, function ($app) { |
|
| 16 | + $this->app->singleton(Settings::class, function($app) { |
|
| 17 | 17 | return new Settings(); |
| 18 | 18 | }); |
| 19 | 19 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | { |
| 38 | 38 | foreach ($parameters as $key => $value) { |
| 39 | 39 | if ($value instanceof Model) { |
| 40 | - $parameters[$key] = get_class($value) . '@' . $value->id; |
|
| 40 | + $parameters[$key] = get_class($value).'@'.$value->id; |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function get(): string |
| 36 | 36 | { |
| 37 | - $basePath = $this->viewBasePath ? $this->viewBasePath . '.' : ''; |
|
| 37 | + $basePath = $this->viewBasePath ? $this->viewBasePath.'.' : ''; |
|
| 38 | 38 | $guessedParentViewName = $this->parent ? $this->parent->viewKey() : ''; |
| 39 | 39 | $guessedViewName = $this->viewable->viewKey(); |
| 40 | 40 | |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | foreach ($viewPaths as $viewPath) { |
| 56 | - if (! view()->exists($viewPath)) { |
|
| 56 | + if (!view()->exists($viewPath)) { |
|
| 57 | 57 | continue; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | return $viewPath; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - if (! view()->exists($basePath.'show')) { |
|
| 63 | + if (!view()->exists($basePath.'show')) { |
|
| 64 | 64 | throw new NotFoundView('Viewfile not found for ['.get_class($this->viewable).']. Make sure the view ['.$basePath.$guessedViewName.'] or the default view ['.$basePath.'show] exists.'); |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | public static function fromKeys($keys) |
| 21 | 21 | { |
| 22 | - $keys = (array) $keys; |
|
| 22 | + $keys = (array)$keys; |
|
| 23 | 23 | $collection = collect(); |
| 24 | 24 | |
| 25 | 25 | /** @var Managers */ |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public static function fromTags($tags) |
| 35 | 35 | { |
| 36 | - $tags = (array) $tags; |
|
| 36 | + $tags = (array)$tags; |
|
| 37 | 37 | $collection = collect(); |
| 38 | 38 | |
| 39 | 39 | /** @var Managers */ |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | private static function fromManagers(Collection $collection) |
| 54 | 54 | { |
| 55 | - return new static(...$collection->reject(function ($manager) { |
|
| 55 | + return new static(...$collection->reject(function($manager) { |
|
| 56 | 56 | return !$manager->can('index'); |
| 57 | - })->map(function ($manager) { |
|
| 57 | + })->map(function($manager) { |
|
| 58 | 58 | return new NavItem($manager->details()->plural, $manager->route('index'), [ |
| 59 | 59 | 'key' => $manager->details()->key, |
| 60 | 60 | 'tags' => app(Register::class)->filterByKey($manager->details()->key)->first()->tags() |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | public function rejectKeys($keys) |
| 66 | 66 | { |
| 67 | - $keys = (array) $keys; |
|
| 67 | + $keys = (array)$keys; |
|
| 68 | 68 | |
| 69 | 69 | foreach ($this->items as $k => $item) { |
| 70 | 70 | if (in_array($item->details('key', ''), $keys)) { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | public function rejectTags($tags) |
| 79 | 79 | { |
| 80 | - $tags = (array) $tags; |
|
| 80 | + $tags = (array)$tags; |
|
| 81 | 81 | |
| 82 | 82 | foreach ($this->items as $k => $item) { |
| 83 | 83 | if (count(array_intersect($item->details('tags', []), $tags)) > 0) { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $output = ''; |
| 120 | 120 | |
| 121 | 121 | foreach ($this->items as $item) { |
| 122 | - $output .= '<a class="' . (isActiveUrl($item->url()) ? 'active' : '') . '" href="'.$item->url().'">'; |
|
| 122 | + $output .= '<a class="'.(isActiveUrl($item->url()) ? 'active' : '').'" href="'.$item->url().'">'; |
|
| 123 | 123 | $output .= $title ?? ucfirst($item->title()); |
| 124 | 124 | $output .= '</a>'; |
| 125 | 125 | } |
@@ -146,14 +146,14 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | $items = ''; |
| 148 | 148 | foreach ($this->items as $item) { |
| 149 | - $items .= '<a class="' . (isActiveUrl($item->url()) ? 'active' : '') . '" href="'.$item->url().'">'; |
|
| 149 | + $items .= '<a class="'.(isActiveUrl($item->url()) ? 'active' : '').'" href="'.$item->url().'">'; |
|
| 150 | 150 | $items .= ucfirst($item->title()); |
| 151 | 151 | $items .= '</a>'; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | // Surround within vue dropdown |
| 155 | 155 | $output = '<dropdown>'; |
| 156 | - $output .= '<span class="center-y nav-item" slot="trigger" slot-scope="{ toggle, isActive }" @click="toggle">'. ($title ?? 'Collecties') .'</span>'; |
|
| 156 | + $output .= '<span class="center-y nav-item" slot="trigger" slot-scope="{ toggle, isActive }" @click="toggle">'.($title ?? 'Collecties').'</span>'; |
|
| 157 | 157 | $output .= '<div v-cloak class="dropdown-box inset-s">'; |
| 158 | 158 | $output .= $items; |
| 159 | 159 | $output .= '</div>'; |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | { |
| 54 | 54 | foreach ($flatReferences as $locale => $flatReferenceString) { |
| 55 | 55 | if (!$flatReferenceString) { |
| 56 | - throw new \InvalidArgumentException('Homepage setting value cannot be empty. Value for locale ' . $locale . ' is missing.'); |
|
| 56 | + throw new \InvalidArgumentException('Homepage setting value cannot be empty. Value for locale '.$locale.' is missing.'); |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public static function redirectsFromModel(ProvidesUrl $model) |
| 20 | 20 | { |
| 21 | - $records = MemoizedUrlRecord::getByModel($model)->reject(function ($record) { |
|
| 21 | + $records = MemoizedUrlRecord::getByModel($model)->reject(function($record) { |
|
| 22 | 22 | return !$record->isRedirect(); |
| 23 | 23 | })->sortByDesc('created_at'); |
| 24 | 24 | |
@@ -60,10 +60,10 @@ discard block |
||
| 60 | 60 | $fields = new static([]); |
| 61 | 61 | |
| 62 | 62 | foreach ($locales as $locale) { |
| 63 | - $fields['url-slugs.' . $locale] = UrlSlugField::make('url-slugs.' . $locale) |
|
| 63 | + $fields['url-slugs.'.$locale] = UrlSlugField::make('url-slugs.'.$locale) |
|
| 64 | 64 | ->setBaseUrlSegment($model->baseUrlSegment($locale)) |
| 65 | - ->prepend($model->resolveUrl($locale, $model->baseUrlSegment($locale)) .'/') |
|
| 66 | - ->name('url-slugs[' . $locale . ']') |
|
| 65 | + ->prepend($model->resolveUrl($locale, $model->baseUrlSegment($locale)).'/') |
|
| 66 | + ->name('url-slugs['.$locale.']') |
|
| 67 | 67 | ->label($locale); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | private static function fillWithExistingValues(ProvidesUrl $model, self $fields): void |
| 78 | 78 | { |
| 79 | - $records = UrlRecord::getByModel($model)->reject(function ($record) { |
|
| 79 | + $records = UrlRecord::getByModel($model)->reject(function($record) { |
|
| 80 | 80 | return $record->isRedirect(); |
| 81 | 81 | })->sortBy('locale'); |
| 82 | 82 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $fields['url-slugs.'.$record->locale] |
| 89 | 89 | ->setUrlRecord($record) |
| 90 | 90 | ->setBaseUrlSegment($model->baseUrlSegment($record->locale)) |
| 91 | - ->prepend($model->resolveUrl($record->locale, $model->baseUrlSegment($record->locale)) .'/'); |
|
| 91 | + ->prepend($model->resolveUrl($record->locale, $model->baseUrlSegment($record->locale)).'/'); |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | if (PreviewMode::fromRequest()->check()) { |
| 12 | 12 | Session::now('note.default', 'U bekijkt een preview.'); |
| 13 | 13 | return true; |
| 14 | - } else { |
|
| 14 | + }else { |
|
| 15 | 15 | return false; |
| 16 | 16 | } |
| 17 | 17 | } |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Thinktomorrow\Chief\Fields\Types; |
| 5 | 5 | |