We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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 | } |
@@ -7,14 +7,14 @@ |
||
7 | 7 | |
8 | 8 | <div class="form-group backpack-filter mb-0"> |
9 | 9 | <?php |
10 | - $from = ''; |
|
11 | - $to = ''; |
|
12 | - if($filter->currentValue) { |
|
13 | - $range = (array)json_decode($filter->currentValue); |
|
14 | - $from = $range['from']; |
|
15 | - $to = $range['to']; |
|
16 | - } |
|
17 | - ?> |
|
10 | + $from = ''; |
|
11 | + $to = ''; |
|
12 | + if($filter->currentValue) { |
|
13 | + $range = (array)json_decode($filter->currentValue); |
|
14 | + $from = $range['from']; |
|
15 | + $to = $range['to']; |
|
16 | + } |
|
17 | + ?> |
|
18 | 18 | <div class="input-group"> |
19 | 19 | <input class="form-control pull-right from" |
20 | 20 | type="number" |
@@ -167,18 +167,18 @@ |
||
167 | 167 | { |
168 | 168 | foreach ($modifications as $key => $newValue) { |
169 | 169 | switch (strtolower($form)) { |
170 | - case 'create': |
|
170 | + case 'create': |
|
171 | 171 | $this->create_fields[$field][$key] = $newValue; |
172 | - break; |
|
172 | + break; |
|
173 | 173 | |
174 | - case 'update': |
|
174 | + case 'update': |
|
175 | 175 | $this->update_fields[$field][$key] = $newValue; |
176 | - break; |
|
176 | + break; |
|
177 | 177 | |
178 | - default: |
|
178 | + default: |
|
179 | 179 | $this->create_fields[$field][$key] = $newValue; |
180 | - $this->update_fields[$field][$key] = $newValue; |
|
181 | - break; |
|
180 | + $this->update_fields[$field][$key] = $newValue; |
|
181 | + break; |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | } |
@@ -28,28 +28,28 @@ discard block |
||
28 | 28 | |
29 | 29 | // if this is a relation type field and no corresponding model was specified, get it from the relation method |
30 | 30 | // defined in the main model |
31 | - if (isset($completeFieldsArray['entity']) && ! isset($completeFieldsArray['model'])) { |
|
31 | + if (isset($completeFieldsArray['entity']) && !isset($completeFieldsArray['model'])) { |
|
32 | 32 | $completeFieldsArray['model'] = $this->getRelationModel($completeFieldsArray['entity']); |
33 | 33 | } |
34 | 34 | |
35 | 35 | // if the label is missing, we should set it |
36 | - if (! isset($completeFieldsArray['label'])) { |
|
36 | + if (!isset($completeFieldsArray['label'])) { |
|
37 | 37 | $completeFieldsArray['label'] = mb_ucfirst(str_replace('_', ' ', $completeFieldsArray['name'])); |
38 | 38 | } |
39 | 39 | |
40 | 40 | // if the field type is missing, we should set it |
41 | - if (! isset($completeFieldsArray['type'])) { |
|
41 | + if (!isset($completeFieldsArray['type'])) { |
|
42 | 42 | $completeFieldsArray['type'] = $this->getFieldTypeFromDbColumnType($completeFieldsArray['name']); |
43 | 43 | } |
44 | 44 | |
45 | 45 | // if a tab was mentioned, we should enable it |
46 | 46 | if (isset($completeFieldsArray['tab'])) { |
47 | - if (! $this->tabsEnabled()) { |
|
47 | + if (!$this->tabsEnabled()) { |
|
48 | 48 | $this->enableTabs(); |
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
52 | - $this->transformFields($form, function ($fields) use ($completeFieldsArray) { |
|
52 | + $this->transformFields($form, function($fields) use ($completeFieldsArray) { |
|
53 | 53 | $fields[$completeFieldsArray['name']] = $completeFieldsArray; |
54 | 54 | |
55 | 55 | return $fields; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function afterField($targetFieldName, $form = 'both') |
83 | 83 | { |
84 | - $this->transformFields($form, function ($fields) use ($targetFieldName) { |
|
84 | + $this->transformFields($form, function($fields) use ($targetFieldName) { |
|
85 | 85 | return $this->moveField($fields, $targetFieldName, false); |
86 | 86 | }); |
87 | 87 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function beforeField($targetFieldName, $form = 'both') |
96 | 96 | { |
97 | - $this->transformFields($form, function ($fields) use ($targetFieldName) { |
|
97 | + $this->transformFields($form, function($fields) use ($targetFieldName) { |
|
98 | 98 | return $this->moveField($fields, $targetFieldName, true); |
99 | 99 | }); |
100 | 100 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function removeField($name, $form = 'both') |
139 | 139 | { |
140 | - $this->transformFields($form, function ($fields) use ($name) { |
|
140 | + $this->transformFields($form, function($fields) use ($name) { |
|
141 | 141 | array_forget($fields, $name); |
142 | 142 | |
143 | 143 | return $fields; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function removeFields($array_of_names, $form = 'both') |
154 | 154 | { |
155 | - if (! empty($array_of_names)) { |
|
155 | + if (!empty($array_of_names)) { |
|
156 | 156 | foreach ($array_of_names as $name) { |
157 | 157 | $this->removeField($name, $form); |
158 | 158 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | public function removeAllFields($form = 'both') |
168 | 168 | { |
169 | 169 | $current_fields = $this->getCurrentFields(); |
170 | - if (! empty($current_fields)) { |
|
170 | + if (!empty($current_fields)) { |
|
171 | 171 | foreach ($current_fields as $field) { |
172 | 172 | $this->removeField($field['name'], $form); |
173 | 173 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $jsonCastables = ['array', 'object', 'json']; |
258 | 258 | $fieldCasting = $casted_attributes[$field['name']]; |
259 | 259 | |
260 | - if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && ! empty($data[$field['name']]) && ! is_array($data[$field['name']])) { |
|
260 | + if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && !empty($data[$field['name']]) && !is_array($data[$field['name']])) { |
|
261 | 261 | try { |
262 | 262 | $data[$field['name']] = json_decode($data[$field['name']]); |
263 | 263 | } catch (\Exception $e) { |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | */ |
292 | 292 | public function orderFields($order, $form = 'both') |
293 | 293 | { |
294 | - $this->transformFields($form, function ($fields) use ($order) { |
|
294 | + $this->transformFields($form, function($fields) use ($order) { |
|
295 | 295 | return $this->applyOrderToFields($fields, $order); |
296 | 296 | }); |
297 | 297 | } |
@@ -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 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * Upload fields are the ones that have "upload" => true defined on them. |
128 | 128 | * |
129 | 129 | * @param string $form create/update/both - defaults to 'both' |
130 | - * @param bool|int $id id of the entity - defaults to false |
|
130 | + * @param integer $id id of the entity - defaults to false |
|
131 | 131 | * |
132 | 132 | * @return bool |
133 | 133 | */ |
@@ -162,6 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | /** |
164 | 164 | * Set the number of rows that should be show on the list view. |
165 | + * @param integer $value |
|
165 | 166 | */ |
166 | 167 | public function setDefaultPageLength($value) |
167 | 168 | { |
@@ -13,7 +13,7 @@ |
||
13 | 13 | | |
14 | 14 | */ |
15 | 15 | |
16 | - return [ |
|
16 | + return [ |
|
17 | 17 | 'infoFiltered' => '(filtered from _MAX_ total entries)', |
18 | 18 | 'thousands' => ',', |
19 | 19 | 'admin' => 'المشرف', |
@@ -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 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $this->executeProcess('mkdir -p public/uploads'); |
54 | 54 | break; |
55 | 55 | case '\\': // windows |
56 | - if (! file_exists('public\uploads')) { |
|
56 | + if (!file_exists('public\uploads')) { |
|
57 | 57 | $this->executeProcess('mkdir public\uploads'); |
58 | 58 | } |
59 | 59 | break; |
@@ -30,7 +30,7 @@ |
||
30 | 30 | /** |
31 | 31 | * Execute the console command. |
32 | 32 | * |
33 | - * @return mixed |
|
33 | + * @return false|null |
|
34 | 34 | */ |
35 | 35 | public function handle() |
36 | 36 | { |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\app\Console\Commands; |
4 | 4 | |
5 | -use Illuminate\Console\Command; |
|
6 | 5 | use Backpack\Base\app\Console\Commands\Install as BaseInstall; |
7 | 6 | |
8 | 7 | class Install extends BaseInstall |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $sourceFile = $this->sourcePath.$file.'.blade.php'; |
74 | 74 | $copiedFile = $this->destinationPath.$file.'.blade.php'; |
75 | 75 | |
76 | - if (! file_exists($sourceFile)) { |
|
76 | + if (!file_exists($sourceFile)) { |
|
77 | 77 | return $this->error( |
78 | 78 | 'Cannot find source view file at ' |
79 | 79 | .$sourceFile. |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | if ($canCopy) { |
94 | 94 | $path = pathinfo($copiedFile); |
95 | 95 | |
96 | - if (! file_exists($path['dirname'])) { |
|
96 | + if (!file_exists($path['dirname'])) { |
|
97 | 97 | mkdir($path['dirname'], 0755, true); |
98 | 98 | } |
99 | 99 |
@@ -119,10 +119,10 @@ |
||
119 | 119 | // add the details_row button to the first column |
120 | 120 | if ($this->details_row) { |
121 | 121 | $details_row_button = \View::make('crud::columns.details_row_button') |
122 | - ->with('crud', $this) |
|
123 | - ->with('entry', $entry) |
|
124 | - ->with('row_number', $rowNumber) |
|
125 | - ->render(); |
|
122 | + ->with('crud', $this) |
|
123 | + ->with('entry', $entry) |
|
124 | + ->with('row_number', $rowNumber) |
|
125 | + ->render(); |
|
126 | 126 | $row_items[0] = $details_row_button.$row_items[0]; |
127 | 127 | } |
128 | 128 |
@@ -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; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | private function renderCellView($view, $column, $entry, $rowNumber = false) |
179 | 179 | { |
180 | - if (! view()->exists($view)) { |
|
180 | + if (!view()->exists($view)) { |
|
181 | 181 | $view = 'crud::columns.text'; // fallback to text column |
182 | 182 | } |
183 | 183 |
@@ -35,6 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Apply the search logic for each CRUD column. |
38 | + * @param string $searchTerm |
|
38 | 39 | */ |
39 | 40 | public function applySearchLogicForColumn($query, $column, $searchTerm) |
40 | 41 | { |
@@ -230,7 +231,7 @@ discard block |
||
230 | 231 | * |
231 | 232 | * @param string $view |
232 | 233 | * @param array $column |
233 | - * @param object $entry |
|
234 | + * @param \Illuminate\Database\Eloquent\Model $entry |
|
234 | 235 | * @param bool|int $rowNumber The number shown to the user as row number (index) |
235 | 236 | * |
236 | 237 | * @return string |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\PanelTraits; |
4 | 4 | |
5 | -use Validator; |
|
6 | 5 | use Carbon\Carbon; |
6 | +use Validator; |
|
7 | 7 | |
8 | 8 | trait Search |
9 | 9 | { |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | public function isRequired($inputName, $operation) |
44 | 44 | { |
45 | - if (! isset($this->requiredFields[$operation])) { |
|
45 | + if (!isset($this->requiredFields[$operation])) { |
|
46 | 46 | return false; |
47 | 47 | } |
48 | 48 |