We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -15,7 +15,7 @@ |
||
15 | 15 | // uncomment the next statement to map strings to enum types in doctrine and get over the 'Unknown database type enum' DBAL error |
16 | 16 | // Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); |
17 | 17 | |
18 | - Schema::create('column_types', function ($table) { |
|
18 | + Schema::create('column_types', function($table) { |
|
19 | 19 | $table->bigInteger('bigIntegerCol'); |
20 | 20 | $table->binary('binaryCol'); |
21 | 21 | $table->boolean('booleanCol'); |
@@ -217,7 +217,7 @@ |
||
217 | 217 | |
218 | 218 | private function getButtonByName($name) |
219 | 219 | { |
220 | - return $this->crudPanel->buttons->first(function ($value) use ($name) { |
|
220 | + return $this->crudPanel->buttons->first(function($value) use ($name) { |
|
221 | 221 | return $value->name == $name; |
222 | 222 | }); |
223 | 223 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | protected function makeSlugUnique(string $slug, array $config, string $attribute): string |
51 | 51 | { |
52 | - if (! $config['unique']) { |
|
52 | + if (!$config['unique']) { |
|
53 | 53 | return $slug; |
54 | 54 | } |
55 | 55 |
@@ -33,12 +33,12 @@ |
||
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 | 38 | |
39 | 39 | // call the setup function inside this closure to also have the request there |
40 | 40 | // this way, developers can use things stored in session (auth variables, etc) |
41 | - $this->middleware(function ($request, $next) { |
|
41 | + $this->middleware(function($request, $next) { |
|
42 | 42 | $this->request = $request; |
43 | 43 | $this->crud->request = $request; |
44 | 44 | $this->setup(); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $fakeFieldKey = isset($field['store_in']) ? $field['store_in'] : 'extras'; |
30 | 30 | $this->addCompactedField($requestInput, $field['name'], $fakeFieldKey); |
31 | 31 | |
32 | - if (! in_array($fakeFieldKey, $compactedFakeFields)) { |
|
32 | + if (!in_array($fakeFieldKey, $compactedFakeFields)) { |
|
33 | 33 | $compactedFakeFields[] = $fakeFieldKey; |
34 | 34 | } |
35 | 35 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | // json_encode all fake_value columns if applicable in the database, so they can be properly stored and interpreted |
39 | 39 | foreach ($compactedFakeFields as $value) { |
40 | - if (! (property_exists($this->model, 'translatable') && in_array($value, $this->model->getTranslatableAttributes(), true)) && $this->model->shouldEncodeFake($value)) { |
|
40 | + if (!(property_exists($this->model, 'translatable') && in_array($value, $this->model->getTranslatableAttributes(), true)) && $this->model->shouldEncodeFake($value)) { |
|
41 | 41 | $requestInput[$value] = json_encode($requestInput[$value]); |
42 | 42 | } |
43 | 43 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('json', 'json_array'); |
58 | 58 | $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('jsonb', 'json_array'); |
59 | 59 | |
60 | - return ! $conn->getDoctrineColumn($table, $column_name)->getNotnull(); |
|
60 | + return !$conn->getDoctrineColumn($table, $column_name)->getNotnull(); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /* |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | foreach ($columns as $key => $column) { |
77 | 77 | $column_contents = $this->{$column}; |
78 | 78 | |
79 | - if (! is_object($this->{$column})) { |
|
79 | + if (!is_object($this->{$column})) { |
|
80 | 80 | $column_contents = json_decode($this->{$column}); |
81 | 81 | } |
82 | 82 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | { |
100 | 100 | $model = '\\'.get_class($this); |
101 | 101 | |
102 | - if (! count($columns)) { |
|
102 | + if (!count($columns)) { |
|
103 | 103 | $columns = (property_exists($model, 'fakeColumns')) ? $this->fakeColumns : ['extras']; |
104 | 104 | } |
105 | 105 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function shouldEncodeFake($column) |
118 | 118 | { |
119 | - return ! in_array($column, array_keys($this->casts)); |
|
119 | + return !in_array($column, array_keys($this->casts)); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /* |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $attribute_value = (array) $this->{$attribute_name}; |
200 | 200 | foreach ($files_to_clear as $key => $filename) { |
201 | 201 | \Storage::disk($disk)->delete($filename); |
202 | - $attribute_value = array_where($attribute_value, function ($value, $key) use ($filename) { |
|
202 | + $attribute_value = array_where($attribute_value, function($value, $key) use ($filename) { |
|
203 | 203 | return $value != $filename; |
204 | 204 | }); |
205 | 205 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $this->setDoctrineTypesMapping(); |
23 | 23 | $this->getDbColumnTypes(); |
24 | 24 | |
25 | - array_map(function ($field) { |
|
25 | + array_map(function($field) { |
|
26 | 26 | $new_field = [ |
27 | 27 | 'name' => $field, |
28 | 28 | 'label' => $this->makeLabel($field), |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | 'attributes' => [], |
34 | 34 | 'autoset' => true, |
35 | 35 | ]; |
36 | - if (! isset($this->create_fields[$field])) { |
|
36 | + if (!isset($this->create_fields[$field])) { |
|
37 | 37 | $this->create_fields[$field] = $new_field; |
38 | 38 | } |
39 | - if (! isset($this->update_fields[$field])) { |
|
39 | + if (!isset($this->update_fields[$field])) { |
|
40 | 40 | $this->update_fields[$field] = $new_field; |
41 | 41 | } |
42 | 42 | |
43 | - if (! in_array($field, $this->model->getHidden()) && ! isset($this->columns[$field])) { |
|
43 | + if (!in_array($field, $this->model->getHidden()) && !isset($this->columns[$field])) { |
|
44 | 44 | $this->addColumn([ |
45 | 45 | 'name' => $field, |
46 | 46 | 'label' => $this->makeLabel($field), |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function getFieldTypeFromDbColumnType($field) |
82 | 82 | { |
83 | - if (! array_key_exists($field, $this->db_column_types)) { |
|
83 | + if (!array_key_exists($field, $this->db_column_types)) { |
|
84 | 84 | return 'text'; |
85 | 85 | } |
86 | 86 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $types = ['enum' => 'string']; |
148 | 148 | $platform = \DB::getDoctrineConnection()->getDatabasePlatform(); |
149 | 149 | foreach ($types as $type_key => $type_value) { |
150 | - if (! $platform->hasDoctrineTypeMappingFor($type_key)) { |
|
150 | + if (!$platform->hasDoctrineTypeMappingFor($type_key)) { |
|
151 | 151 | $platform->registerDoctrineTypeMapping($type_key, $type_value); |
152 | 152 | } |
153 | 153 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $columns = $this->model->getConnection()->getSchemaBuilder()->getColumnListing($this->model->getTable()); |
203 | 203 | $fillable = $this->model->getFillable(); |
204 | 204 | |
205 | - if (! empty($fillable)) { |
|
205 | + if (!empty($fillable)) { |
|
206 | 206 | $columns = array_intersect($columns, $fillable); |
207 | 207 | } |
208 | 208 |
@@ -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 | } |