@@ -75,21 +75,21 @@ |
||
| 75 | 75 | private function validate($managerClass, $modelClass) |
| 76 | 76 | { |
| 77 | 77 | if (!class_exists($managerClass)) { |
| 78 | - throw new \InvalidArgumentException('Manager class [' . $managerClass . '] is an invalid class reference. Please make sure the class exists.'); |
|
| 78 | + throw new \InvalidArgumentException('Manager class ['.$managerClass.'] is an invalid class reference. Please make sure the class exists.'); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | if (!class_exists($modelClass)) { |
| 82 | - throw new \InvalidArgumentException('Model class [' . $modelClass . '] is an invalid model reference. Please make sure the class exists.'); |
|
| 82 | + throw new \InvalidArgumentException('Model class ['.$modelClass.'] is an invalid model reference. Please make sure the class exists.'); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | $manager = new \ReflectionClass($managerClass); |
| 86 | 86 | if (!$manager->implementsInterface(Manager::class)) { |
| 87 | - throw new \InvalidArgumentException('Class [' . $managerClass . '] is expected to implement the [' . Manager::class . '] contract.'); |
|
| 87 | + throw new \InvalidArgumentException('Class ['.$managerClass.'] is expected to implement the ['.Manager::class.'] contract.'); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $model = new \ReflectionClass($modelClass); |
| 91 | 91 | if (!$model->implementsInterface(ManagedModel::class)) { |
| 92 | - throw new \InvalidArgumentException('Class [' . $modelClass . '] is expected to implement the [' . ManagedModel::class . '] contract.'); |
|
| 92 | + throw new \InvalidArgumentException('Class ['.$modelClass.'] is expected to implement the ['.ManagedModel::class.'] contract.'); |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $availableChildren = AvailableChildren::forParent($model); |
| 51 | 51 | |
| 52 | - $modules = $availableChildren->onlyModules()->reject(function ($module) use ($model) { |
|
| 52 | + $modules = $availableChildren->onlyModules()->reject(function($module) use ($model) { |
|
| 53 | 53 | return $module->owner_id != null && $module->owner_id != $model->id; |
| 54 | 54 | }); |
| 55 | 55 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $available_sets = ModelReferencePresenter::toGroupedSelectValues($availableChildren->onlySets())->toArray(); |
| 59 | 59 | |
| 60 | 60 | // Current sections |
| 61 | - $sections = $model->children()->map(function ($section, $index) { |
|
| 61 | + $sections = $model->children()->map(function($section, $index) { |
|
| 62 | 62 | if ($section instanceof TranslatableContract) { |
| 63 | 63 | $section->injectTranslationForForm(); |
| 64 | 64 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | { |
| 51 | 51 | $registrations = collect($this->register->filterByTag($tag)->all()); |
| 52 | 52 | |
| 53 | - return $registrations->map(function ($registration) { |
|
| 53 | + return $registrations->map(function($registration) { |
|
| 54 | 54 | return $this->instance($registration); |
| 55 | 55 | }); |
| 56 | 56 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | $registrations = collect($this->register->filterByTag($tag)->all()); |
| 67 | 67 | |
| 68 | - return $registrations->map(function ($registration) { |
|
| 68 | + return $registrations->map(function($registration) { |
|
| 69 | 69 | return $this->instance($registration)->details(); |
| 70 | 70 | }); |
| 71 | 71 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | //return array with group name and values |
| 77 | 77 | $grouped = []; |
| 78 | 78 | |
| 79 | - $managers = $managers->map(function (Manager $item) { |
|
| 79 | + $managers = $managers->map(function(Manager $item) { |
|
| 80 | 80 | return [ |
| 81 | 81 | 'id' => $item->details()->id, |
| 82 | 82 | 'group' => $item->details()->plural, |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | { |
| 91 | 91 | $registrations = collect($this->register->all()); |
| 92 | 92 | |
| 93 | - return $registrations->map(function ($registration) { |
|
| 93 | + return $registrations->map(function($registration) { |
|
| 94 | 94 | return $this->instance($registration); |
| 95 | 95 | }); |
| 96 | 96 | } |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | private function registrationMustExistConstraint(string $key, $value, $registrations): void |
| 137 | 137 | { |
| 138 | 138 | if (empty($registrations) && count($registrations) != $this->registrations) { |
| 139 | - throw new NonRegisteredManager('No manager found for ' . $key . ' [' . print_r($value, true) . ']. Did you perhaps forgot to register the manager?'); |
|
| 139 | + throw new NonRegisteredManager('No manager found for '.$key.' ['.print_r($value, true).']. Did you perhaps forgot to register the manager?'); |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | public function assistant(string $assistantKey): Assistant |
| 52 | 52 | { |
| 53 | 53 | if (!$this->isAssistedBy($assistantKey)) { |
| 54 | - throw new MissingAssistant('No assistant [' . $assistantKey . '] registered on manager ' . static::class); |
|
| 54 | + throw new MissingAssistant('No assistant ['.$assistantKey.'] registered on manager '.static::class); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $instance = app($this->getAssistantClass($assistantKey)); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | // If no view has been created for this page collection, we try once again to fetch the content value if any. This will silently fail |
| 51 | 51 | // if no content value is present. We don't consider the 'content' attribute to be a default as we do for module. |
| 52 | - return $this->map(function ($item) { |
|
| 52 | + return $this->map(function($item) { |
|
| 53 | 53 | return ($this->viewParent && $item instanceof ViewableContract) |
| 54 | 54 | ? $item->setViewParent($this->viewParent)->renderView() |
| 55 | 55 | : ($item->content ?? ''); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | $currentPage = $currentPage ?? request()->get('page', 1); |
| 84 | 84 | $path = request()->path(); |
| 85 | - $items = array_slice($this->all(), ($currentPage - 1) * $perPage); |
|
| 85 | + $items = array_slice($this->all(), ($currentPage-1) * $perPage); |
|
| 86 | 86 | |
| 87 | 87 | return (new \Illuminate\Pagination\Paginator($items, $perPage ?? $this->paginateSetting('perPage', '12'), $currentPage))->setPath($path); |
| 88 | 88 | } |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | public function paginate($perPage = null, $currentPage = null): Paginator |
| 99 | 99 | { |
| 100 | 100 | $currentPage = $currentPage ?? request()->get('page', 1); |
| 101 | - $path = '/' . request()->path(); |
|
| 102 | - $items = array_slice($this->all(), ($currentPage - 1) * $perPage, $perPage); |
|
| 101 | + $path = '/'.request()->path(); |
|
| 102 | + $items = array_slice($this->all(), ($currentPage-1) * $perPage, $perPage); |
|
| 103 | 103 | |
| 104 | 104 | return (new \Illuminate\Pagination\LengthAwarePaginator($items, $this->paginateSetting('total', $this->count()), $perPage ?? $this->paginateSetting('perPage', '12'), $currentPage))->setPath($path); |
| 105 | 105 | } |
@@ -35,12 +35,12 @@ |
||
| 35 | 35 | |
| 36 | 36 | public function toReference(): SetReference |
| 37 | 37 | { |
| 38 | - $reference = SetReference::all()->first(function ($setReference) { |
|
| 38 | + $reference = SetReference::all()->first(function($setReference) { |
|
| 39 | 39 | return $setReference->key() == $this->key; |
| 40 | 40 | }); |
| 41 | 41 | |
| 42 | 42 | if (!$reference) { |
| 43 | - throw new \Exception('No query set found by key [' . $this->key . ']. Make sure that this ' . $this->key . ' set is added to the chief.sets config array.'); |
|
| 43 | + throw new \Exception('No query set found by key ['.$this->key.']. Make sure that this '.$this->key.' set is added to the chief.sets config array.'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return $reference; |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function apply($value = null): Closure |
| 21 | 21 | { |
| 22 | - return function ($query) use ($value) { |
|
| 22 | + return function($query) use ($value) { |
|
| 23 | 23 | if ($value == 'all') { |
| 24 | 24 | return $query; |
| 25 | 25 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $this->pageBuilderField(), |
| 89 | 89 | InputField::make('title')->translatable($this->model->availableLocales()) |
| 90 | 90 | ->validation('required-fallback-locale|max:200', [], [ |
| 91 | - 'trans.' . config('app.fallback_locale', 'nl') . '.title' => 'title', |
|
| 91 | + 'trans.'.config('app.fallback_locale', 'nl').'.title' => 'title', |
|
| 92 | 92 | ]) |
| 93 | 93 | ->label('Intern label') |
| 94 | 94 | ->description('Dit is de benaming die zal worden getoond in de admin selectie velden.') |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | if (is_array_empty($translation)) { |
| 211 | 211 | |
| 212 | 212 | // Nullify all values |
| 213 | - $trans[$locale] = array_map(function ($value) { |
|
| 213 | + $trans[$locale] = array_map(function($value) { |
|
| 214 | 214 | return null; |
| 215 | 215 | }, $translation); |
| 216 | 216 | continue; |