We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('square_brackets_to_dots')) { |
|
3 | +if (!function_exists('square_brackets_to_dots')) { |
|
4 | 4 | /** |
5 | 5 | * Turns a string from bracket-type array to dot-notation array. |
6 | 6 | * Ex: array[0][property] turns into array.0.property. |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | -if (! function_exists('is_countable')) { |
|
20 | +if (!function_exists('is_countable')) { |
|
21 | 21 | /** |
22 | 22 | * We need this because is_countable was only introduced in PHP 7.3, |
23 | 23 | * and in PHP 7.2 you should check if count() argument is really countable. |
@@ -68,10 +68,10 @@ |
||
68 | 68 | <ol class="sortable mt-0"> |
69 | 69 | <?php |
70 | 70 | $all_entries = collect($entries->all())->sortBy('lft')->keyBy($crud->getModel()->getKeyName()); |
71 | - $root_entries = $all_entries->filter(function ($item) { |
|
71 | + $root_entries = $all_entries->filter(function($item) { |
|
72 | 72 | return $item->parent_id == 0; |
73 | 73 | }); |
74 | - foreach ($root_entries as $key => $entry){ |
|
74 | + foreach ($root_entries as $key => $entry) { |
|
75 | 75 | $root_entries[$key] = tree_element($entry, $key, $all_entries, $crud); |
76 | 76 | } |
77 | 77 | ?> |
@@ -3,7 +3,7 @@ |
||
3 | 3 | <?php |
4 | 4 | // if the column has been cast to Carbon or Date (using attribute casting) |
5 | 5 | // get the value as a date string |
6 | -if (isset($field['value']) && ( $field['value'] instanceof \Carbon\CarbonInterface )) { |
|
6 | +if (isset($field['value']) && ($field['value'] instanceof \Carbon\CarbonInterface)) { |
|
7 | 7 | $field['value'] = $field['value']->toDateTimeString(); |
8 | 8 | } |
9 | 9 | ?> |
@@ -3,11 +3,11 @@ |
||
3 | 3 | <?php |
4 | 4 | // if the column has been cast to Carbon or Date (using attribute casting) |
5 | 5 | // get the value as a date string |
6 | - if (isset($field['value']) && ( $field['value'] instanceof \Carbon\CarbonInterface )) { |
|
6 | + if (isset($field['value']) && ($field['value'] instanceof \Carbon\CarbonInterface)) { |
|
7 | 7 | $field['value'] = $field['value']->format('Y-m-d'); |
8 | 8 | } |
9 | 9 | |
10 | - $field_language = isset($field['date_picker_options']['language'])?$field['date_picker_options']['language']:\App::getLocale(); |
|
10 | + $field_language = isset($field['date_picker_options']['language']) ? $field['date_picker_options']['language'] : \App::getLocale(); |
|
11 | 11 | |
12 | 12 | if (!isset($field['attributes']['style'])) { |
13 | 13 | $field['attributes']['style'] = 'background-color: white!important;'; |
@@ -3,7 +3,7 @@ |
||
3 | 3 | <?php |
4 | 4 | // if the column has been cast to Carbon or Date (using attribute casting) |
5 | 5 | // get the value as a date string |
6 | -if (isset($field['value']) && ( $field['value'] instanceof \Carbon\CarbonInterface )) { |
|
6 | +if (isset($field['value']) && ($field['value'] instanceof \Carbon\CarbonInterface)) { |
|
7 | 7 | $field['value'] = $field['value']->toDateString(); |
8 | 8 | } |
9 | 9 | ?> |
@@ -3,11 +3,11 @@ |
||
3 | 3 | <?php |
4 | 4 | // if the column has been cast to Carbon or Date (using attribute casting) |
5 | 5 | // get the value as a date string |
6 | -if (isset($field['value']) && ( $field['value'] instanceof \Carbon\CarbonInterface )) { |
|
6 | +if (isset($field['value']) && ($field['value'] instanceof \Carbon\CarbonInterface)) { |
|
7 | 7 | $field['value'] = $field['value']->format('Y-m-d H:i:s'); |
8 | 8 | } |
9 | 9 | |
10 | - $field_language = isset($field['datetime_picker_options']['language'])?$field['datetime_picker_options']['language']:\App::getLocale(); |
|
10 | + $field_language = isset($field['datetime_picker_options']['language']) ? $field['datetime_picker_options']['language'] : \App::getLocale(); |
|
11 | 11 | ?> |
12 | 12 | |
13 | 13 | <div @include('crud::inc.field_wrapper_attributes') > |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('json', 'json_array'); |
70 | 70 | $conn->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('jsonb', 'json_array'); |
71 | 71 | |
72 | - return ! $conn->getDoctrineColumn($table, $column_name)->getNotnull(); |
|
72 | + return !$conn->getDoctrineColumn($table, $column_name)->getNotnull(); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /* |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | public function addFakes($columns = ['extras']) |
87 | 87 | { |
88 | 88 | foreach ($columns as $key => $column) { |
89 | - if (! isset($this->attributes[$column])) { |
|
89 | + if (!isset($this->attributes[$column])) { |
|
90 | 90 | continue; |
91 | 91 | } |
92 | 92 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function shouldDecodeFake($column) |
136 | 136 | { |
137 | - return ! in_array($column, array_keys($this->casts)); |
|
137 | + return !in_array($column, array_keys($this->casts)); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function shouldEncodeFake($column) |
147 | 147 | { |
148 | - return ! in_array($column, array_keys($this->casts)); |
|
148 | + return !in_array($column, array_keys($this->casts)); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /* |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | public function uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path) |
220 | 220 | { |
221 | 221 | $request = \Request::instance(); |
222 | - if (! is_array($this->{$attribute_name})) { |
|
222 | + if (!is_array($this->{$attribute_name})) { |
|
223 | 223 | $attribute_value = json_decode($this->{$attribute_name}, true) ?? []; |
224 | 224 | } else { |
225 | 225 | $attribute_value = $this->{$attribute_name}; |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | if ($files_to_clear) { |
232 | 232 | foreach ($files_to_clear as $key => $filename) { |
233 | 233 | \Storage::disk($disk)->delete($filename); |
234 | - $attribute_value = array_where($attribute_value, function ($value, $key) use ($filename) { |
|
234 | + $attribute_value = array_where($attribute_value, function($value, $key) use ($filename) { |
|
235 | 235 | return $value != $filename; |
236 | 236 | }); |
237 | 237 | } |
@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | */ |
18 | 18 | public function setFromDb() |
19 | 19 | { |
20 | - if (! $this->driverIsMongoDb()) { |
|
20 | + if (!$this->driverIsMongoDb()) { |
|
21 | 21 | $this->setDoctrineTypesMapping(); |
22 | 22 | $this->getDbColumnTypes(); |
23 | 23 | } |
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), |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function getFieldTypeFromDbColumnType($field) |
98 | 98 | { |
99 | - if (! array_key_exists($field, $this->db_column_types)) { |
|
99 | + if (!array_key_exists($field, $this->db_column_types)) { |
|
100 | 100 | return 'text'; |
101 | 101 | } |
102 | 102 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $types = ['enum' => 'string']; |
163 | 163 | $platform = $this->getSchema()->getConnection()->getDoctrineConnection()->getDatabasePlatform(); |
164 | 164 | foreach ($types as $type_key => $type_value) { |
165 | - if (! $platform->hasDoctrineTypeMappingFor($type_key)) { |
|
165 | + if (!$platform->hasDoctrineTypeMappingFor($type_key)) { |
|
166 | 166 | $platform->registerDoctrineTypeMapping($type_key, $type_value); |
167 | 167 | } |
168 | 168 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | // Automatically-set columns should be both in the database, and in the $fillable variable on the Eloquent Model |
222 | 222 | $columns = $this->model->getConnection()->getSchemaBuilder()->getColumnListing($this->model->getTable()); |
223 | 223 | |
224 | - if (! empty($fillable)) { |
|
224 | + if (!empty($fillable)) { |
|
225 | 225 | $columns = array_intersect($columns, $fillable); |
226 | 226 | } |
227 | 227 | } |
@@ -21,13 +21,13 @@ |
||
21 | 21 | |
22 | 22 | public function __construct() |
23 | 23 | { |
24 | - if (! $this->crud) { |
|
24 | + if (!$this->crud) { |
|
25 | 25 | // make a new CrudPanel object, from the one stored in Laravel's service container |
26 | 26 | $this->crud = app()->make('crud'); |
27 | 27 | |
28 | 28 | // call the setup function inside this closure to also have the request there |
29 | 29 | // this way, developers can use things stored in session (auth variables, etc) |
30 | - $this->middleware(function ($request, $next) { |
|
30 | + $this->middleware(function($request, $next) { |
|
31 | 31 | $this->request = $request; |
32 | 32 | $this->crud->request = $request; |
33 | 33 | $this->setup(); |