@@ -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; |
@@ -81,7 +81,7 @@ |
||
81 | 81 | $this->addModelToCollection($i, $child); |
82 | 82 | } |
83 | 83 | |
84 | - return $this->sets->values()->map(function (ViewableContract $child) { |
|
84 | + return $this->sets->values()->map(function(ViewableContract $child) { |
|
85 | 85 | return ($this->withSnippets && method_exists($child, 'withSnippets')) |
86 | 86 | ? $child->withSnippets()->setViewParent($this->parent)->renderView() |
87 | 87 | : $child->setViewParent($this->parent)->renderView(); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | continue; |
195 | 195 | } |
196 | 196 | |
197 | - $child = $children->first(function ($c) use ($reference) { |
|
197 | + $child = $children->first(function($c) use ($reference) { |
|
198 | 198 | return $c->modelReference()->get() == $reference; |
199 | 199 | }); |
200 | 200 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | private function stripTagsBlacklist($value, $blacklist = []) |
246 | 246 | { |
247 | 247 | foreach ($blacklist as $tag) { |
248 | - $value = preg_replace('/<\/?' . $tag . '(.|\s)*?>/', '', $value); |
|
248 | + $value = preg_replace('/<\/?'.$tag.'(.|\s)*?>/', '', $value); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | return $value; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | ->orderBy('sort', 'ASC') |
55 | 55 | ->get(); |
56 | 56 | |
57 | - return $relations->map(function (Relation $relation) { |
|
57 | + return $relations->map(function(Relation $relation) { |
|
58 | 58 | $parent = $relation->parent; |
59 | 59 | $parent->relation = $relation; |
60 | 60 | |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | ->orderBy('sort', 'ASC') |
71 | 71 | ->get(); |
72 | 72 | |
73 | - return $relations->map(function (Relation $relation) use ($parent_type, $parent_id) { |
|
73 | + return $relations->map(function(Relation $relation) use ($parent_type, $parent_id) { |
|
74 | 74 | |
75 | 75 | // It could be that the child itself is soft-deleted, if this is the case, we will ignore it and move on. |
76 | 76 | if (!$child = $relation->child) { |
77 | 77 | if (!$relation->child()->withTrashed()->first()) { |
78 | 78 | // If we cannot retrieve it then the relation type is possibly wrong, this is a database inconsistency and should be addressed |
79 | - throw new \DomainException('Corrupt relation reference. Related child [' . $relation->child_type . '@' . $relation->child_id . '] could not be retrieved for parent [' . $parent_type . '@' . $parent_id . ']. Make sure the morph key can resolve to a valid class.'); |
|
79 | + throw new \DomainException('Corrupt relation reference. Related child ['.$relation->child_type.'@'.$relation->child_id.'] could not be retrieved for parent ['.$parent_type.'@'.$parent_id.']. Make sure the morph key can resolve to a valid class.'); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | return null; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | }) |
89 | 89 | |
90 | 90 | // In case of soft-deleted entries, this will be null and should be ignored. We make sure that keys are reset in case of removed child |
91 | - ->reject(function ($child) { |
|
91 | + ->reject(function($child) { |
|
92 | 92 | return is_null($child); |
93 | 93 | }) |
94 | 94 | ->values(); |
@@ -105,10 +105,10 @@ discard block |
||
105 | 105 | |
106 | 106 | public static function deleteRelationsOf($type, $id) |
107 | 107 | { |
108 | - $relations = static::where(function ($query) use ($type, $id) { |
|
108 | + $relations = static::where(function($query) use ($type, $id) { |
|
109 | 109 | return $query->where('parent_type', $type) |
110 | 110 | ->where('parent_id', $id); |
111 | - })->orWhere(function ($query) use ($type, $id) { |
|
111 | + })->orWhere(function($query) use ($type, $id) { |
|
112 | 112 | return $query->where('child_type', $type) |
113 | 113 | ->where('child_id', $id); |
114 | 114 | })->get(); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | public static function deleteAllChildRelationsOf($type, $id) |
122 | 122 | { |
123 | - $relations = static::where(function ($query) use ($type, $id) { |
|
123 | + $relations = static::where(function($query) use ($type, $id) { |
|
124 | 124 | return $query->where('parent_type', $type) |
125 | 125 | ->where('parent_id', $id); |
126 | 126 | })->get(); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | public static function deleteAllParentRelationsOf($type, $id) |
134 | 134 | { |
135 | - $relations = static::where(function ($query) use ($type, $id) { |
|
135 | + $relations = static::where(function($query) use ($type, $id) { |
|
136 | 136 | return $query->where('child_type', $type) |
137 | 137 | ->where('child_id', $id); |
138 | 138 | })->get(); |