We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function setModel($model_namespace) |
92 | 92 | { |
93 | - if (! class_exists($model_namespace)) { |
|
93 | + if (!class_exists($model_namespace)) { |
|
94 | 94 | throw new \Exception('This model does not exist.', 404); |
95 | 95 | } |
96 | 96 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | { |
141 | 141 | $complete_route = $route.'.index'; |
142 | 142 | |
143 | - if (! \Route::has($complete_route)) { |
|
143 | + if (!\Route::has($complete_route)) { |
|
144 | 144 | throw new \Exception('There are no routes for this route name.', 404); |
145 | 145 | } |
146 | 146 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public function getFirstOfItsTypeInArray($type, $array) |
192 | 192 | { |
193 | - return array_first($array, function ($item) use ($type) { |
|
193 | + return array_first($array, function($item) use ($type) { |
|
194 | 194 | return $item['type'] == $type; |
195 | 195 | }); |
196 | 196 | } |
@@ -207,8 +207,8 @@ discard block |
||
207 | 207 | |
208 | 208 | public function sync($type, $fields, $attributes) |
209 | 209 | { |
210 | - if (! empty($this->{$type})) { |
|
211 | - $this->{$type} = array_map(function ($field) use ($fields, $attributes) { |
|
210 | + if (!empty($this->{$type})) { |
|
211 | + $this->{$type} = array_map(function($field) use ($fields, $attributes) { |
|
212 | 212 | if (in_array($field['name'], (array) $fields)) { |
213 | 213 | $field = array_merge($field, $attributes); |
214 | 214 | } |
@@ -240,8 +240,8 @@ discard block |
||
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
243 | - return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function ($item) use ($items) { |
|
244 | - return ! in_array($item['name'], $this->sort[$items]); |
|
243 | + return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function($item) use ($items) { |
|
244 | + return !in_array($item['name'], $this->sort[$items]); |
|
245 | 245 | })); |
246 | 246 | } |
247 | 247 | |
@@ -268,22 +268,22 @@ discard block |
||
268 | 268 | */ |
269 | 269 | public function getRelationModel($relationString, $length = null, $model = null) |
270 | 270 | { |
271 | - if(!$model = $this->model->find($this->getLastParameter())) |
|
271 | + if (!$model = $this->model->find($this->getLastParameter())) |
|
272 | 272 | { |
273 | 273 | $model = $this->model; |
274 | 274 | } |
275 | 275 | |
276 | 276 | $relationArray = explode('.', $relationString); |
277 | 277 | |
278 | - if (! isset($length)) { |
|
278 | + if (!isset($length)) { |
|
279 | 279 | $length = count($relationArray); |
280 | 280 | } |
281 | 281 | |
282 | - if (! isset($model)) { |
|
282 | + if (!isset($model)) { |
|
283 | 283 | $model = $this->model; |
284 | 284 | } |
285 | 285 | |
286 | - $result = array_reduce(array_splice($relationArray, 0, $length), function ($obj, $method) { |
|
286 | + $result = array_reduce(array_splice($relationArray, 0, $length), function($obj, $method) { |
|
287 | 287 | return $obj->$method()->getRelated(); |
288 | 288 | }, $model); |
289 | 289 | |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | $relation = $model->{$firstRelationName}; |
331 | 331 | |
332 | 332 | $results = []; |
333 | - if (! empty($relation)) { |
|
333 | + if (!empty($relation)) { |
|
334 | 334 | if ($relation instanceof Collection) { |
335 | 335 | $currentResults = $relation->toArray(); |
336 | 336 | } else { |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | |
340 | 340 | array_shift($relationArray); |
341 | 341 | |
342 | - if (! empty($relationArray)) { |
|
342 | + if (!empty($relationArray)) { |
|
343 | 343 | foreach ($currentResults as $currentResult) { |
344 | 344 | $results = array_merge($results, $this->getRelationModelInstances($currentResult, implode('.', $relationArray))); |
345 | 345 | } |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | |
34 | 34 | public function __construct() |
35 | 35 | { |
36 | - if (! $this->crud) { |
|
36 | + if (!$this->crud) { |
|
37 | 37 | $this->crud = app()->make(CrudPanel::class); |
38 | - $this->crud->ajax_table=false; |
|
38 | + $this->crud->ajax_table = false; |
|
39 | 39 | |
40 | 40 | // call the setup function inside this closure to also have the request there |
41 | 41 | // this way, developers can use things stored in session (auth variables, etc) |
42 | - $this->middleware(function ($request, $next) { |
|
42 | + $this->middleware(function($request, $next) { |
|
43 | 43 | $this->request = $request; |
44 | 44 | $this->crud->request = $request; |
45 | 45 | $this->setup(); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $this->data['title'] = ucfirst($this->crud->entity_name_plural); |
70 | 70 | |
71 | 71 | // get all entries if AJAX is not enabled |
72 | - if (! $this->data['crud']->ajaxTable()) { |
|
72 | + if (!$this->data['crud']->ajaxTable()) { |
|
73 | 73 | $this->data['entries'] = $this->data['crud']->getEntries(); |
74 | 74 | } |
75 | 75 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $this->data['entry'] = $this->crud->entry = $item; |
125 | 125 | |
126 | 126 | // show a success message |
127 | - if($this->crud->model::find($item->id)) |
|
127 | + if ($this->crud->model::find($item->id)) |
|
128 | 128 | \Alert::success(trans('backpack::crud.insert_success'))->flash(); |
129 | 129 | |
130 | 130 | // save the redirect choice for next time |
@@ -156,14 +156,14 @@ discard block |
||
156 | 156 | |
157 | 157 | $this->data['id'] = $id; |
158 | 158 | |
159 | - if($this->crud->eagerLoad && !empty($this->crud->eagerLoad)) |
|
160 | - foreach($this->crud->eagerLoad as $relation_name) |
|
159 | + if ($this->crud->eagerLoad && !empty($this->crud->eagerLoad)) |
|
160 | + foreach ($this->crud->eagerLoad as $relation_name) |
|
161 | 161 | { |
162 | - if($this->data['entry'] && $rel = $this->data['entry']->{$relation_name}) |
|
162 | + if ($this->data['entry'] && $rel = $this->data['entry']->{$relation_name}) |
|
163 | 163 | { |
164 | - foreach($this->data['fields'] as $field_name => $field) |
|
164 | + foreach ($this->data['fields'] as $field_name => $field) |
|
165 | 165 | { |
166 | - if(starts_with($field_name, $relation_name)) |
|
166 | + if (starts_with($field_name, $relation_name)) |
|
167 | 167 | { |
168 | 168 | $column_name = str_replace("{$relation_name}.", '', $field_name); |
169 | 169 | |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | }) |
285 | 285 | ->toArray(); |
286 | 286 | |
287 | - if(!$rel = $item->{$relation_name}) |
|
287 | + if (!$rel = $item->{$relation_name}) |
|
288 | 288 | $item->{$relation_name}()->create($data); |
289 | 289 | else |
290 | 290 | $item->{$relation_name}->update($data); |