We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function register() |
78 | 78 | { |
79 | - $this->app->bind('CRUD', function ($app) { |
|
79 | + $this->app->bind('CRUD', function($app) { |
|
80 | 80 | return new CRUD($app); |
81 | 81 | }); |
82 | 82 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $this->commands($this->commands); |
92 | 92 | |
93 | 93 | // map the elfinder prefix |
94 | - if (! \Config::get('elfinder.route.prefix')) { |
|
94 | + if (!\Config::get('elfinder.route.prefix')) { |
|
95 | 95 | \Config::set('elfinder.route.prefix', \Config::get('backpack.base.route_prefix').'/elfinder'); |
96 | 96 | } |
97 | 97 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $crudPubPath = public_path('vendor/backpack/crud'); |
113 | 113 | |
114 | - if (! is_dir($crudPubPath)) { |
|
114 | + if (!is_dir($crudPubPath)) { |
|
115 | 115 | return true; |
116 | 116 | } |
117 | 117 |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function setModel($model_namespace) |
90 | 90 | { |
91 | - if (! class_exists($model_namespace)) { |
|
91 | + if (!class_exists($model_namespace)) { |
|
92 | 92 | throw new \Exception('This model does not exist.', 404); |
93 | 93 | } |
94 | 94 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | { |
139 | 139 | $complete_route = $route.'.index'; |
140 | 140 | |
141 | - if (! \Route::has($complete_route)) { |
|
141 | + if (!\Route::has($complete_route)) { |
|
142 | 142 | throw new \Exception('There are no routes for this route name.', 404); |
143 | 143 | } |
144 | 144 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function getFirstOfItsTypeInArray($type, $array) |
190 | 190 | { |
191 | - return array_first($array, function ($item) use ($type) { |
|
191 | + return array_first($array, function($item) use ($type) { |
|
192 | 192 | return $item['type'] == $type; |
193 | 193 | }); |
194 | 194 | } |
@@ -205,8 +205,8 @@ discard block |
||
205 | 205 | |
206 | 206 | public function sync($type, $fields, $attributes) |
207 | 207 | { |
208 | - if (! empty($this->{$type})) { |
|
209 | - $this->{$type} = array_map(function ($field) use ($fields, $attributes) { |
|
208 | + if (!empty($this->{$type})) { |
|
209 | + $this->{$type} = array_map(function($field) use ($fields, $attributes) { |
|
210 | 210 | if (in_array($field['name'], (array) $fields)) { |
211 | 211 | $field = array_merge($field, $attributes); |
212 | 212 | } |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | } |
239 | 239 | } |
240 | 240 | |
241 | - return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function ($item) use ($items) { |
|
242 | - return ! in_array($item['name'], $this->sort[$items]); |
|
241 | + return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function($item) use ($items) { |
|
242 | + return !in_array($item['name'], $this->sort[$items]); |
|
243 | 243 | })); |
244 | 244 | } |
245 | 245 | |
@@ -268,15 +268,15 @@ discard block |
||
268 | 268 | { |
269 | 269 | $relationArray = explode('.', $relationString); |
270 | 270 | |
271 | - if (! isset($length)) { |
|
271 | + if (!isset($length)) { |
|
272 | 272 | $length = count($relationArray); |
273 | 273 | } |
274 | 274 | |
275 | - if (! isset($model)) { |
|
275 | + if (!isset($model)) { |
|
276 | 276 | $model = $this->model; |
277 | 277 | } |
278 | 278 | |
279 | - $result = array_reduce(array_splice($relationArray, 0, $length), function ($obj, $method) { |
|
279 | + $result = array_reduce(array_splice($relationArray, 0, $length), function($obj, $method) { |
|
280 | 280 | return $obj->$method()->getRelated(); |
281 | 281 | }, $model); |
282 | 282 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $relation = $model->{$firstRelationName}; |
324 | 324 | |
325 | 325 | $results = []; |
326 | - if (! empty($relation)) { |
|
326 | + if (!empty($relation)) { |
|
327 | 327 | if ($relation instanceof Collection) { |
328 | 328 | $currentResults = $relation->toArray(); |
329 | 329 | } else { |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | array_shift($relationArray); |
334 | 334 | |
335 | - if (! empty($relationArray)) { |
|
335 | + if (!empty($relationArray)) { |
|
336 | 336 | foreach ($currentResults as $currentResult) { |
337 | 337 | $results = array_merge($results, $this->getRelationModelInstances($currentResult, implode('.', $relationArray))); |
338 | 338 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | foreach ($fields as &$field) { |
53 | 53 | // set the value |
54 | - if (! isset($field['value'])) { |
|
54 | + if (!isset($field['value'])) { |
|
55 | 55 | if (isset($field['subfields'])) { |
56 | 56 | $field['value'] = []; |
57 | 57 | foreach ($field['subfields'] as $subfield) { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | // always have a hidden input for the entry id |
67 | - if (! array_key_exists('id', $fields)) { |
|
67 | + if (!array_key_exists('id', $fields)) { |
|
68 | 68 | $fields['id'] = [ |
69 | 69 | 'name' => $entry->getKeyName(), |
70 | 70 | 'value' => $entry->getKey(), |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | { |
88 | 88 | if (isset($field['entity'])) { |
89 | 89 | $relationArray = explode('.', $field['entity']); |
90 | - $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function ($obj, $method) { |
|
90 | + $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function($obj, $method) { |
|
91 | 91 | return $obj->{$method} ? $obj->{$method} : $obj; |
92 | 92 | }, $model); |
93 | 93 |
@@ -5,7 +5,7 @@ |
||
5 | 5 | <label>{!! $field['label'] !!}</label> |
6 | 6 | @include('crud::inc.field_translatable_icon') |
7 | 7 | |
8 | - <?php $entity_model = $crud->getRelationModel($field['entity'], - 1); ?> |
|
8 | + <?php $entity_model = $crud->getRelationModel($field['entity'], - 1); ?> |
|
9 | 9 | <select |
10 | 10 | name="{{ $field['name'] }}" |
11 | 11 | @include('crud::inc.field_attributes') |
@@ -2,7 +2,7 @@ |
||
2 | 2 | <div @include('crud::inc.field_wrapper_attributes') > |
3 | 3 | <label>{!! $field['label'] !!}</label> |
4 | 4 | @include('crud::inc.field_translatable_icon') |
5 | - <?php $entity_model = $crud->getRelationModel($field['entity'], - 1); ?> |
|
5 | + <?php $entity_model = $crud->getRelationModel($field['entity'], - 1); ?> |
|
6 | 6 | <select |
7 | 7 | name="{{ $field['name'] }}" |
8 | 8 | style="width: 100%" |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | { |
91 | 91 | $all_relation_fields = $this->getRelationFields($form); |
92 | 92 | |
93 | - return array_where($all_relation_fields, function ($value, $key) { |
|
93 | + return array_where($all_relation_fields, function($value, $key) { |
|
94 | 94 | return isset($value['pivot']) && $value['pivot']; |
95 | 95 | }); |
96 | 96 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | private function createRelationsForItem($item, $formattedData) |
163 | 163 | { |
164 | - if (! isset($formattedData['relations'])) { |
|
164 | + if (!isset($formattedData['relations'])) { |
|
165 | 165 | return false; |
166 | 166 | } |
167 | 167 | |
@@ -219,11 +219,11 @@ discard block |
||
219 | 219 | $key = implode('.relations.', explode('.', $relationField['entity'])); |
220 | 220 | $fieldData = array_get($relationData, 'relations.'.$key, []); |
221 | 221 | |
222 | - if (! array_key_exists('model', $fieldData)) { |
|
222 | + if (!array_key_exists('model', $fieldData)) { |
|
223 | 223 | $fieldData['model'] = $relationField['model']; |
224 | 224 | } |
225 | 225 | |
226 | - if (! array_key_exists('parent', $fieldData)) { |
|
226 | + if (!array_key_exists('parent', $fieldData)) { |
|
227 | 227 | $fieldData['parent'] = $this->getRelationModel($relationField['entity'], -1); |
228 | 228 | } |
229 | 229 |
@@ -9,8 +9,8 @@ |
||
9 | 9 | <?php |
10 | 10 | $from = ''; |
11 | 11 | $to = ''; |
12 | - if($filter->currentValue) { |
|
13 | - $range = (array)json_decode($filter->currentValue); |
|
12 | + if ($filter->currentValue) { |
|
13 | + $range = (array) json_decode($filter->currentValue); |
|
14 | 14 | $from = $range['from']; |
15 | 15 | $to = $range['to']; |
16 | 16 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | { |
42 | 42 | $id = $this->getCurrentEntryId(); |
43 | 43 | |
44 | - if (! $id) { |
|
44 | + if (!$id) { |
|
45 | 45 | return false; |
46 | 46 | } |
47 | 47 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function getEntry($id) |
59 | 59 | { |
60 | - if (! $this->entry) { |
|
60 | + if (!$this->entry) { |
|
61 | 61 | $this->entry = $this->model->findOrFail($id); |
62 | 62 | $this->entry = $this->entry->withFakes(); |
63 | 63 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | public function hasUploadFields($form, $id = false) |
133 | 133 | { |
134 | 134 | $fields = $this->getFields($form, $id); |
135 | - $upload_fields = array_where($fields, function ($value, $key) { |
|
135 | + $upload_fields = array_where($fields, function($value, $key) { |
|
136 | 136 | return isset($value['upload']) && $value['upload'] == true; |
137 | 137 | }); |
138 | 138 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | { |
193 | 193 | // If the default Page Length isn't in the menu's values, Add it the beginnin and resort all to show a croissant list. |
194 | 194 | // assume both array are the same lenght. |
195 | - if (! in_array($this->getDefaultPageLength(), $this->page_length_menu[0])) { |
|
195 | + if (!in_array($this->getDefaultPageLength(), $this->page_length_menu[0])) { |
|
196 | 196 | // Loop through 2 arrays of prop. page_length_menu |
197 | 197 | foreach ($this->page_length_menu as $key => &$page_length_choices) { |
198 | 198 | // This is a condition that should be always true. |
@@ -223,9 +223,9 @@ discard block |
||
223 | 223 | public function getPageLengthMenu() |
224 | 224 | { |
225 | 225 | // if already set, use that |
226 | - if (! $this->page_length_menu) { |
|
226 | + if (!$this->page_length_menu) { |
|
227 | 227 | // try to get the menu settings from the config file |
228 | - if (! $this->page_length_menu = config('backpack.crud.page_length_menu')) { |
|
228 | + if (!$this->page_length_menu = config('backpack.crud.page_length_menu')) { |
|
229 | 229 | // otherwise set a sensible default |
230 | 230 | $this->page_length_menu = [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'backpack::crud.all']]; |
231 | 231 | } |
@@ -25,9 +25,9 @@ |
||
25 | 25 | </thead> |
26 | 26 | <?php |
27 | 27 | |
28 | -if (! empty($_POST)) { |
|
28 | +if (!empty($_POST)) { |
|
29 | 29 | foreach ($_POST as $key => $value) { |
30 | - if ((! is_string($value) && ! is_numeric($value)) || ! is_string($key)) { |
|
30 | + if ((!is_string($value) && !is_numeric($value)) || !is_string($key)) { |
|
31 | 31 | continue; |
32 | 32 | } |
33 | 33 |