We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function tabsDisabled() |
31 | 31 | { |
32 | - return ! $this->tabsEnabled; |
|
32 | + return !$this->tabsEnabled; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | public function setTabsType($type) |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | { |
92 | 92 | $all_fields = $this->getCurrentFields(); |
93 | 93 | |
94 | - $fields_without_a_tab = collect($all_fields)->filter(function ($value, $key) { |
|
95 | - return ! isset($value['tab']); |
|
94 | + $fields_without_a_tab = collect($all_fields)->filter(function($value, $key) { |
|
95 | + return !isset($value['tab']); |
|
96 | 96 | }); |
97 | 97 | |
98 | 98 | return $fields_without_a_tab; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | if ($this->tabExists($label)) { |
104 | 104 | $all_fields = $this->getCurrentFields(); |
105 | 105 | |
106 | - $fields_for_current_tab = collect($all_fields)->filter(function ($value, $key) use ($label) { |
|
106 | + $fields_for_current_tab = collect($all_fields)->filter(function($value, $key) use ($label) { |
|
107 | 107 | return isset($value['tab']) && $value['tab'] == $label; |
108 | 108 | }); |
109 | 109 | |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | $fields = $this->getCurrentFields(); |
120 | 120 | |
121 | 121 | $fields_with_tabs = collect($fields) |
122 | - ->filter(function ($value, $key) { |
|
122 | + ->filter(function($value, $key) { |
|
123 | 123 | return isset($value['tab']); |
124 | 124 | }) |
125 | - ->each(function ($value, $key) use (&$tabs) { |
|
126 | - if (! in_array($value['tab'], $tabs)) { |
|
125 | + ->each(function($value, $key) use (&$tabs) { |
|
126 | + if (!in_array($value['tab'], $tabs)) { |
|
127 | 127 | $tabs[] = $value['tab']; |
128 | 128 | } |
129 | 129 | }); |
@@ -2,25 +2,25 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD; |
4 | 4 | |
5 | -use Backpack\CRUD\PanelTraits\Read; |
|
6 | -use Backpack\CRUD\PanelTraits\Tabs; |
|
7 | -use Backpack\CRUD\PanelTraits\Query; |
|
8 | -use Backpack\CRUD\PanelTraits\Views; |
|
9 | 5 | use Backpack\CRUD\PanelTraits\Access; |
6 | +use Backpack\CRUD\PanelTraits\AutoFocus; |
|
7 | +use Backpack\CRUD\PanelTraits\AutoSet; |
|
8 | +use Backpack\CRUD\PanelTraits\Buttons; |
|
9 | +use Backpack\CRUD\PanelTraits\Columns; |
|
10 | 10 | use Backpack\CRUD\PanelTraits\Create; |
11 | 11 | use Backpack\CRUD\PanelTraits\Delete; |
12 | 12 | use Backpack\CRUD\PanelTraits\Errors; |
13 | +use Backpack\CRUD\PanelTraits\FakeColumns; |
|
14 | +use Backpack\CRUD\PanelTraits\FakeFields; |
|
13 | 15 | use Backpack\CRUD\PanelTraits\Fields; |
14 | -use Backpack\CRUD\PanelTraits\Search; |
|
15 | -use Backpack\CRUD\PanelTraits\Update; |
|
16 | -use Backpack\CRUD\PanelTraits\AutoSet; |
|
17 | -use Backpack\CRUD\PanelTraits\Buttons; |
|
18 | -use Backpack\CRUD\PanelTraits\Columns; |
|
19 | 16 | use Backpack\CRUD\PanelTraits\Filters; |
17 | +use Backpack\CRUD\PanelTraits\Query; |
|
18 | +use Backpack\CRUD\PanelTraits\Read; |
|
20 | 19 | use Backpack\CRUD\PanelTraits\Reorder; |
21 | -use Backpack\CRUD\PanelTraits\AutoFocus; |
|
22 | -use Backpack\CRUD\PanelTraits\FakeFields; |
|
23 | -use Backpack\CRUD\PanelTraits\FakeColumns; |
|
20 | +use Backpack\CRUD\PanelTraits\Search; |
|
21 | +use Backpack\CRUD\PanelTraits\Tabs; |
|
22 | +use Backpack\CRUD\PanelTraits\Update; |
|
23 | +use Backpack\CRUD\PanelTraits\Views; |
|
24 | 24 | use Backpack\CRUD\PanelTraits\ViewsAndRestoresRevisions; |
25 | 25 | |
26 | 26 | class CrudPanel |
@@ -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(); |
@@ -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 |
@@ -116,9 +116,9 @@ |
||
116 | 116 | // add the details_row buttons as the first column |
117 | 117 | if ($this->details_row) { |
118 | 118 | array_unshift($row_items, \View::make('crud::columns.details_row_button') |
119 | - ->with('crud', $this) |
|
120 | - ->with('entry', $entry) |
|
121 | - ->render()); |
|
119 | + ->with('crud', $this) |
|
120 | + ->with('entry', $entry) |
|
121 | + ->render()); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | return $row_items; |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function applySearchTerm($searchTerm) |
21 | 21 | { |
22 | - return $this->query->where(function ($query) use ($searchTerm) { |
|
22 | + return $this->query->where(function($query) use ($searchTerm) { |
|
23 | 23 | foreach ($this->getColumns() as $column) { |
24 | - if (! isset($column['type'])) { |
|
24 | + if (!isset($column['type'])) { |
|
25 | 25 | abort(400, 'Missing column type when trying to apply search term.'); |
26 | 26 | } |
27 | 27 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | case 'select': |
62 | 62 | case 'select_multiple': |
63 | - $query->orWhereHas($column['entity'], function ($q) use ($column, $searchTerm) { |
|
63 | + $query->orWhereHas($column['entity'], function($q) use ($column, $searchTerm) { |
|
64 | 64 | $q->where($column['attribute'], 'like', '%'.$searchTerm.'%'); |
65 | 65 | }); |
66 | 66 | break; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | public function getCellView($column, $entry) |
134 | 134 | { |
135 | 135 | // if column type not set, show as text |
136 | - if (! isset($column['type'])) { |
|
136 | + if (!isset($column['type'])) { |
|
137 | 137 | return \View::make('crud::columns.text') |
138 | 138 | ->with('crud', $this) |
139 | 139 | ->with('column', $column) |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $this->setDoctrineTypesMapping(); |
18 | 18 | $this->getDbColumnTypes(); |
19 | 19 | |
20 | - array_map(function ($field) { |
|
20 | + array_map(function($field) { |
|
21 | 21 | // $this->labels[$field] = $this->makeLabel($field); |
22 | 22 | |
23 | 23 | $new_field = [ |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | 'attributes' => [], |
31 | 31 | 'autoset' => true, |
32 | 32 | ]; |
33 | - if (! isset($this->create_fields[$field])) { |
|
33 | + if (!isset($this->create_fields[$field])) { |
|
34 | 34 | $this->create_fields[$field] = $new_field; |
35 | 35 | } |
36 | - if (! isset($this->update_fields[$field])) { |
|
36 | + if (!isset($this->update_fields[$field])) { |
|
37 | 37 | $this->update_fields[$field] = $new_field; |
38 | 38 | } |
39 | 39 | |
40 | - if (! in_array($field, $this->model->getHidden()) && ! isset($this->columns[$field])) { |
|
40 | + if (!in_array($field, $this->model->getHidden()) && !isset($this->columns[$field])) { |
|
41 | 41 | $this->addColumn([ |
42 | 42 | 'name' => $field, |
43 | 43 | 'label' => ucfirst($field), |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getFieldTypeFromDbColumnType($field) |
79 | 79 | { |
80 | - if (! array_key_exists($field, $this->db_column_types)) { |
|
80 | + if (!array_key_exists($field, $this->db_column_types)) { |
|
81 | 81 | return 'text'; |
82 | 82 | } |
83 | 83 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $types = ['enum' => 'string']; |
145 | 145 | $platform = \DB::getDoctrineConnection()->getDatabasePlatform(); |
146 | 146 | foreach ($types as $type_key => $type_value) { |
147 | - if (! $platform->hasDoctrineTypeMappingFor($type_key)) { |
|
147 | + if (!$platform->hasDoctrineTypeMappingFor($type_key)) { |
|
148 | 148 | $platform->registerDoctrineTypeMapping($type_key, $type_value); |
149 | 149 | } |
150 | 150 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $columns = $this->model->getConnection()->getSchemaBuilder()->getColumnListing($this->model->getTable()); |
174 | 174 | $fillable = $this->model->getFillable(); |
175 | 175 | |
176 | - if (! empty($fillable)) { |
|
176 | + if (!empty($fillable)) { |
|
177 | 177 | $columns = array_intersect($columns, $fillable); |
178 | 178 | } |
179 | 179 |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | public function addColumn($column) |
65 | 65 | { |
66 | 66 | // if a string was passed, not an array, change it to an array |
67 | - if (! is_array($column)) { |
|
67 | + if (!is_array($column)) { |
|
68 | 68 | $column = ['name' => $column]; |
69 | 69 | } |
70 | 70 | |
@@ -72,17 +72,17 @@ discard block |
||
72 | 72 | $column_with_details = $this->addDefaultLabel($column); |
73 | 73 | |
74 | 74 | // make sure the column has a name |
75 | - if (! array_key_exists('name', $column_with_details)) { |
|
75 | + if (!array_key_exists('name', $column_with_details)) { |
|
76 | 76 | $column_with_details['name'] = 'anonymous_column_'.str_random(5); |
77 | 77 | } |
78 | 78 | |
79 | 79 | // make sure the column has a type |
80 | - if (! array_key_exists('type', $column_with_details)) { |
|
80 | + if (!array_key_exists('type', $column_with_details)) { |
|
81 | 81 | $column_with_details['type'] = 'text'; |
82 | 82 | } |
83 | 83 | |
84 | 84 | // make sure the column has a key |
85 | - if (! array_key_exists('key', $column_with_details)) { |
|
85 | + if (!array_key_exists('key', $column_with_details)) { |
|
86 | 86 | $column_with_details['key'] = $column_with_details['name']; |
87 | 87 | } |
88 | 88 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | // if this is a relation type field and no corresponding model was specified, get it from the relation method |
101 | 101 | // defined in the main model |
102 | - if (isset($column_with_details['entity']) && ! isset($column_with_details['model'])) { |
|
102 | + if (isset($column_with_details['entity']) && !isset($column_with_details['model'])) { |
|
103 | 103 | $column_with_details['model'] = $this->getRelationModel($column_with_details['entity']); |
104 | 104 | } |
105 | 105 | |
@@ -153,8 +153,7 @@ discard block |
||
153 | 153 | $targetColumnName = is_array($targetColumn) ? $targetColumn['name'] : $targetColumn; |
154 | 154 | |
155 | 155 | if (array_key_exists($targetColumnName, $this->columns)) { |
156 | - $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : |
|
157 | - array_search($targetColumnName, array_keys($this->columns)) + 1; |
|
156 | + $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : array_search($targetColumnName, array_keys($this->columns)) + 1; |
|
158 | 157 | |
159 | 158 | $element = array_pop($this->columns); |
160 | 159 | $beginningPart = array_slice($this->columns, 0, $targetColumnPosition, true); |
@@ -188,7 +187,7 @@ discard block |
||
188 | 187 | */ |
189 | 188 | public function addDefaultLabel($array) |
190 | 189 | { |
191 | - if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
190 | + if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
192 | 191 | $array = array_merge(['label' => ucfirst($this->makeLabel($array['name']))], $array); |
193 | 192 | |
194 | 193 | return $array; |
@@ -214,7 +213,7 @@ discard block |
||
214 | 213 | */ |
215 | 214 | public function removeColumns($columns) |
216 | 215 | { |
217 | - if (! empty($columns)) { |
|
216 | + if (!empty($columns)) { |
|
218 | 217 | foreach ($columns as $columnName) { |
219 | 218 | $this->removeColumn($columnName); |
220 | 219 | } |
@@ -235,8 +234,8 @@ discard block |
||
235 | 234 | */ |
236 | 235 | public function remove($entity, $fields) |
237 | 236 | { |
238 | - return array_values(array_filter($this->{$entity}, function ($field) use ($fields) { |
|
239 | - return ! in_array($field['name'], (array) $fields); |
|
237 | + return array_values(array_filter($this->{$entity}, function($field) use ($fields) { |
|
238 | + return !in_array($field['name'], (array) $fields); |
|
240 | 239 | })); |
241 | 240 | } |
242 | 241 | |
@@ -281,7 +280,7 @@ discard block |
||
281 | 280 | { |
282 | 281 | $columns = $this->getColumns(); |
283 | 282 | |
284 | - return collect($columns)->pluck('entity')->reject(function ($value, $key) { |
|
283 | + return collect($columns)->pluck('entity')->reject(function($value, $key) { |
|
285 | 284 | return $value == null; |
286 | 285 | })->toArray(); |
287 | 286 | } |