We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function getEntry($id) |
21 | 21 | { |
22 | - if (! $this->entry) { |
|
22 | + if (!$this->entry) { |
|
23 | 23 | $this->entry = $this->model->findOrFail($id); |
24 | 24 | $this->entry = $this->entry->withFakes(); |
25 | 25 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | public function hasUploadFields($form, $id = false) |
95 | 95 | { |
96 | 96 | $fields = $this->getFields($form, $id); |
97 | - $upload_fields = array_where($fields, function ($value, $key) { |
|
97 | + $upload_fields = array_where($fields, function($value, $key) { |
|
98 | 98 | return isset($value['upload']) && $value['upload'] == true; |
99 | 99 | }); |
100 | 100 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function getCellView($column, $entry) |
194 | 194 | { |
195 | - if (! isset($column['type'])) { |
|
195 | + if (!isset($column['type'])) { |
|
196 | 196 | return \View::make('crud::columns.text')->with('crud', $this)->with('column', $column)->with('entry', $entry)->render(); |
197 | 197 | } else { |
198 | 198 | if (view()->exists('vendor.backpack.crud.columns.'.$column['type'])) { |
@@ -3,15 +3,15 @@ |
||
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($entry) && ($entry->{$field['start_name']} instanceof \Carbon\Carbon || $entry->{$field['start_name']} instanceof \Jenssegers\Date\Date) ) { |
|
7 | - $start_name = $entry->{$field['start_name']}->format( 'Y-m-d H:i:s' ); |
|
6 | + if (isset($entry) && ($entry->{$field['start_name']} instanceof \Carbon\Carbon || $entry->{$field['start_name']} instanceof \Jenssegers\Date\Date)) { |
|
7 | + $start_name = $entry->{$field['start_name']}->format('Y-m-d H:i:s'); |
|
8 | 8 | } else { |
9 | 9 | $start_name = null; |
10 | 10 | } |
11 | 11 | |
12 | 12 | //Do the same as the above but for the range end field |
13 | - if ( isset($entry) && ($entry->{$field['end_name']} instanceof \Carbon\Carbon || $entry->{$field['end_name']} instanceof \Jenssegers\Date\Date) ) { |
|
14 | - $end_name = $entry->{$field['end_name']}->format( 'Y-m-d H:i:s' ); |
|
13 | + if (isset($entry) && ($entry->{$field['end_name']} instanceof \Carbon\Carbon || $entry->{$field['end_name']} instanceof \Jenssegers\Date\Date)) { |
|
14 | + $end_name = $entry->{$field['end_name']}->format('Y-m-d H:i:s'); |
|
15 | 15 | } else { |
16 | 16 | $end_name = null; |
17 | 17 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | { |
17 | 17 | $this->getDbColumnTypes(); |
18 | 18 | |
19 | - array_map(function ($field) { |
|
19 | + array_map(function($field) { |
|
20 | 20 | // $this->labels[$field] = $this->makeLabel($field); |
21 | 21 | |
22 | 22 | $new_field = [ |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $this->create_fields[$field] = $new_field; |
31 | 31 | $this->update_fields[$field] = $new_field; |
32 | 32 | |
33 | - if (! in_array($field, $this->model->getHidden())) { |
|
33 | + if (!in_array($field, $this->model->getHidden())) { |
|
34 | 34 | $this->columns[] = [ |
35 | 35 | 'name' => $field, |
36 | 36 | 'label' => ucfirst($field), |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function getFieldTypeFromDbColumnType($field) |
69 | 69 | { |
70 | - if (! array_key_exists($field, $this->db_column_types)) { |
|
70 | + if (!array_key_exists($field, $this->db_column_types)) { |
|
71 | 71 | return 'text'; |
72 | 72 | } |
73 | 73 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $columns = $this->model->getConnection()->getSchemaBuilder()->getColumnListing($this->model->getTable()); |
149 | 149 | $fillable = $this->model->getFillable(); |
150 | 150 | |
151 | - if (! empty($fillable)) { |
|
151 | + if (!empty($fillable)) { |
|
152 | 152 | $columns = array_intersect($columns, $fillable); |
153 | 153 | } |
154 | 154 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | 'delete_confirmation_not_deleted_title' => 'Não apagado', |
66 | 66 | 'delete_confirmation_not_deleted_message' => 'Está tudo bem!. O item não foi apagado.', |
67 | 67 | |
68 | - // DataTables translation |
|
68 | + // DataTables translation |
|
69 | 69 | 'emptyTable' => 'Sem dados disponíveis na tabela', |
70 | 70 | 'info' => 'A mostrar _START_ a _END_ de _TOTAL_ registos', |
71 | 71 | 'infoEmpty' => 'A mostrar 0 a 0 de 0 registos', |
@@ -25,23 +25,23 @@ discard block |
||
25 | 25 | |
26 | 26 | // if this is a relation type field and no corresponding model was specified, get it from the relation method |
27 | 27 | // defined in the main model |
28 | - if (isset($complete_field_array['entity']) && ! isset($complete_field_array['model'])) { |
|
28 | + if (isset($complete_field_array['entity']) && !isset($complete_field_array['model'])) { |
|
29 | 29 | $complete_field_array['model'] = $this->getRelationModel($complete_field_array['entity']); |
30 | 30 | } |
31 | 31 | |
32 | 32 | // if the label is missing, we should set it |
33 | - if (! isset($complete_field_array['label'])) { |
|
33 | + if (!isset($complete_field_array['label'])) { |
|
34 | 34 | $complete_field_array['label'] = ucfirst($complete_field_array['name']); |
35 | 35 | } |
36 | 36 | |
37 | 37 | // if the field type is missing, we should set it |
38 | - if (! isset($complete_field_array['type'])) { |
|
38 | + if (!isset($complete_field_array['type'])) { |
|
39 | 39 | $complete_field_array['type'] = $this->getFieldTypeFromDbColumnType($complete_field_array['name']); |
40 | 40 | } |
41 | 41 | |
42 | 42 | // if a tab was mentioned, we should enable it |
43 | 43 | if (isset($complete_field_array['tab'])) { |
44 | - if (! $this->tabsEnabled()) { |
|
44 | + if (!$this->tabsEnabled()) { |
|
45 | 45 | $this->enableTabs(); |
46 | 46 | } |
47 | 47 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function removeFields($array_of_names, $form = 'both') |
156 | 156 | { |
157 | - if (! empty($array_of_names)) { |
|
157 | + if (!empty($array_of_names)) { |
|
158 | 158 | foreach ($array_of_names as $name) { |
159 | 159 | $this->removeField($name, $form); |
160 | 160 | } |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $jsonCastables = ['array', 'object', 'json']; |
219 | 219 | $fieldCasting = $casted_attributes[$field['name']]; |
220 | 220 | |
221 | - if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && ! empty($data[$field['name']]) && ! is_array($data[$field['name']])) { |
|
221 | + if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && !empty($data[$field['name']]) && !is_array($data[$field['name']])) { |
|
222 | 222 | try { |
223 | 223 | $data[$field['name']] = json_decode($data[$field['name']]); |
224 | 224 | } catch (Exception $e) { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | public function addColumn($column) |
55 | 55 | { |
56 | 56 | // if a string was passed, not an array, change it to an array |
57 | - if (! is_array($column)) { |
|
57 | + if (!is_array($column)) { |
|
58 | 58 | $column = ['name' => $column]; |
59 | 59 | } |
60 | 60 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $column_with_details = $this->addDefaultLabel($column); |
63 | 63 | |
64 | 64 | // make sure the column has a name |
65 | - if (! array_key_exists('name', $column_with_details)) { |
|
65 | + if (!array_key_exists('name', $column_with_details)) { |
|
66 | 66 | $column_with_details['name'] = 'anonymous_column_'.str_random(5); |
67 | 67 | } |
68 | 68 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | // if this is a relation type field and no corresponding model was specified, get it from the relation method |
72 | 72 | // defined in the main model |
73 | - if (isset($column_with_details['entity']) && ! isset($column_with_details['model'])) { |
|
73 | + if (isset($column_with_details['entity']) && !isset($column_with_details['model'])) { |
|
74 | 74 | $column_with_details['model'] = $this->getRelationModel($column_with_details['entity']); |
75 | 75 | } |
76 | 76 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function addDefaultLabel($array) |
149 | 149 | { |
150 | - if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
150 | + if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
151 | 151 | $array = array_merge(['label' => ucfirst($this->makeLabel($array['name']))], $array); |
152 | 152 | |
153 | 153 | return $array; |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function remove($entity, $fields) |
183 | 183 | { |
184 | - return array_values(array_filter($this->{$entity}, function ($field) use ($fields) { |
|
185 | - return ! in_array($field['name'], (array) $fields); |
|
184 | + return array_values(array_filter($this->{$entity}, function($field) use ($fields) { |
|
185 | + return !in_array($field['name'], (array) $fields); |
|
186 | 186 | })); |
187 | 187 | } |
188 | 188 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | { |
234 | 234 | $columns = $this->getColumns(); |
235 | 235 | |
236 | - return collect($columns)->pluck('entity')->reject(function ($value, $key) { |
|
236 | + return collect($columns)->pluck('entity')->reject(function($value, $key) { |
|
237 | 237 | return $value == null; |
238 | 238 | })->toArray(); |
239 | 239 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $dataTable = new \LiveControl\EloquentDataTable\DataTable($this->crud->query, $columns); |
20 | 20 | |
21 | 21 | // make the datatable use the column types instead of just echoing the text |
22 | - $dataTable->setFormatRowFunction(function ($entry) { |
|
22 | + $dataTable->setFormatRowFunction(function($entry) { |
|
23 | 23 | // get the actual HTML for each row's cell |
24 | 24 | $row_items = $this->crud->getRowViews($entry, $this->crud); |
25 | 25 | |
@@ -55,15 +55,15 @@ discard block |
||
55 | 55 | // create an array with the names of the searchable columns |
56 | 56 | $columns = collect($this->crud->columns) |
57 | 57 | // Excludes fields that are not searchable |
58 | - ->reject(function ($column, $key) { |
|
58 | + ->reject(function($column, $key) { |
|
59 | 59 | return array_get($column, 'searchable', true) === false; |
60 | 60 | }) |
61 | 61 | // Excludes fields on a relation |
62 | - ->reject(function ($column, $key) { |
|
62 | + ->reject(function($column, $key) { |
|
63 | 63 | return array_key_exists('entity', $column); |
64 | 64 | }) |
65 | 65 | // Excludes field types with no column |
66 | - ->reject(function ($column, $key) { |
|
66 | + ->reject(function($column, $key) { |
|
67 | 67 | return in_array(array_get($column, 'type'), ['select_multiple', 'model_function', 'model_function_attribute']); |
68 | 68 | }) |
69 | 69 | ->pluck('name') |