We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -22,36 +22,36 @@ |
||
22 | 22 | } |
23 | 23 | } |
24 | 24 | |
25 | - //for update form, get initial state of the entity |
|
26 | - if (isset($id) && $id) { |
|
25 | + //for update form, get initial state of the entity |
|
26 | + if (isset($id) && $id) { |
|
27 | 27 | |
28 | 28 | //get entity with relations for primary dependency |
29 | - $entity_dependencies = $entity_model->with($primary_dependency['entity']) |
|
30 | - ->with($primary_dependency['entity'].'.'.$primary_dependency['entity_secondary']) |
|
31 | - ->find($id); |
|
29 | + $entity_dependencies = $entity_model->with($primary_dependency['entity']) |
|
30 | + ->with($primary_dependency['entity'].'.'.$primary_dependency['entity_secondary']) |
|
31 | + ->find($id); |
|
32 | 32 | |
33 | - $secondaries_from_primary = []; |
|
33 | + $secondaries_from_primary = []; |
|
34 | 34 | |
35 | - //convert relation in array |
|
36 | - $primary_array = $entity_dependencies->{$primary_dependency['entity']}->toArray(); |
|
35 | + //convert relation in array |
|
36 | + $primary_array = $entity_dependencies->{$primary_dependency['entity']}->toArray(); |
|
37 | 37 | |
38 | - $secondary_ids = []; |
|
38 | + $secondary_ids = []; |
|
39 | 39 | |
40 | - //create secondary dependency from primary relation, used to check what chekbox must be check from second checklist |
|
41 | - if (old($primary_dependency['name'])) { |
|
42 | - foreach (old($primary_dependency['name']) as $primary_item) { |
|
43 | - foreach ($dependencyArray[$primary_item] as $second_item) { |
|
44 | - $secondary_ids[$second_item] = $second_item; |
|
45 | - } |
|
46 | - } |
|
47 | - } else { //create dependecies from relation if not from validate error |
|
48 | - foreach ($primary_array as $primary_item) { |
|
49 | - foreach ($primary_item[$secondary_dependency['entity']] as $second_item) { |
|
50 | - $secondary_ids[$second_item['id']] = $second_item['id']; |
|
51 | - } |
|
52 | - } |
|
53 | - } |
|
54 | - } |
|
40 | + //create secondary dependency from primary relation, used to check what chekbox must be check from second checklist |
|
41 | + if (old($primary_dependency['name'])) { |
|
42 | + foreach (old($primary_dependency['name']) as $primary_item) { |
|
43 | + foreach ($dependencyArray[$primary_item] as $second_item) { |
|
44 | + $secondary_ids[$second_item] = $second_item; |
|
45 | + } |
|
46 | + } |
|
47 | + } else { //create dependecies from relation if not from validate error |
|
48 | + foreach ($primary_array as $primary_item) { |
|
49 | + foreach ($primary_item[$secondary_dependency['entity']] as $second_item) { |
|
50 | + $secondary_ids[$second_item['id']] = $second_item['id']; |
|
51 | + } |
|
52 | + } |
|
53 | + } |
|
54 | + } |
|
55 | 55 | |
56 | 56 | //json encode of dependency matrix |
57 | 57 | $dependencyJson = json_encode($dependencyArray); |
@@ -224,10 +224,10 @@ |
||
224 | 224 | // add the details_row button to the first column |
225 | 225 | if ($this->getOperationSetting('detailsRow')) { |
226 | 226 | $details_row_button = \View::make('crud::columns.inc.details_row_button') |
227 | - ->with('crud', $this) |
|
228 | - ->with('entry', $entry) |
|
229 | - ->with('row_number', $rowNumber) |
|
230 | - ->render(); |
|
227 | + ->with('crud', $this) |
|
228 | + ->with('entry', $entry) |
|
229 | + ->with('row_number', $rowNumber) |
|
230 | + ->render(); |
|
231 | 231 | $row_items[0] = $details_row_button.$row_items[0]; |
232 | 232 | } |
233 | 233 |
@@ -389,10 +389,12 @@ |
||
389 | 389 | return $this->fallbackLogic($value); |
390 | 390 | } |
391 | 391 | |
392 | - public function else($value) |
|
392 | + public function else { |
|
393 | + ($value) |
|
393 | 394 | { |
394 | 395 | return $this->fallbackLogic($value); |
395 | 396 | } |
397 | + } |
|
396 | 398 | |
397 | 399 | // --------------- |
398 | 400 | // PRIVATE METHODS |
@@ -438,10 +438,10 @@ |
||
438 | 438 | $this->assertTrue(in_array(-1, $this->crudPanel->getOperationSetting('pageLengthMenu')[0])); |
439 | 439 | } |
440 | 440 | |
441 | - /** |
|
442 | - * Tests if paginator aborts when 0 is provided as key. |
|
443 | - * |
|
444 | - */ |
|
441 | + /** |
|
442 | + * Tests if paginator aborts when 0 is provided as key. |
|
443 | + * |
|
444 | + */ |
|
445 | 445 | public function testCrudPanelPaginatorWithZeroAsOption() |
446 | 446 | { |
447 | 447 | $this->crudPanel->setModel(User::class); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | { |
187 | 187 | if($value !== 0) { |
188 | 188 | $this->setOperationSetting('defaultPageLength', $value); |
189 | - }else{ |
|
189 | + } else{ |
|
190 | 190 | abort(500, 'You should not use 0 as a key in paginator. If you are looking for "ALL" option, use -1 instead.'); |
191 | 191 | } |
192 | 192 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | if ($position !== false) { |
218 | 218 | array_unshift($values, $this->getDefaultPageLength()); |
219 | 219 | array_unshift($labels, $labels[$position]); |
220 | - }else{ |
|
220 | + } else{ |
|
221 | 221 | // if it's not in array we add it as the first element |
222 | 222 | array_unshift($values, $this->getDefaultPageLength()); |
223 | 223 | array_unshift($labels, $this->getDefaultPageLength()); |
@@ -248,18 +248,18 @@ discard block |
||
248 | 248 | if (! isset($menu[1]) || ! is_array($menu[1])) { |
249 | 249 | $menu[1] = $menu[0]; |
250 | 250 | } |
251 | - }else{ |
|
251 | + } else{ |
|
252 | 252 | abort(500, 'You should not use 0 as a key in paginator. If you are looking for "ALL" option, use -1 instead.'); |
253 | 253 | } |
254 | - }else{ |
|
254 | + } else{ |
|
255 | 255 | // developer defined setPageLengthMenu([10 => 'f', 100 => 'h', 300 => 't']) OR setPageLengthMenu([50, 100, 300]) |
256 | 256 | $menu = $this->buildPageLengthMenuFromArray($menu); |
257 | 257 | } |
258 | - }else{ |
|
258 | + } else{ |
|
259 | 259 | // developer added only a single value setPageLengthMenu(10) |
260 | 260 | if($menu !== 0) { |
261 | 261 | $menu = [[$menu], [$menu]]; |
262 | - }else{ |
|
262 | + } else{ |
|
263 | 263 | abort(500, 'You should not use 0 as a key in paginator. If you are looking for "ALL" option, use -1 instead.'); |
264 | 264 | } |
265 | 265 | } |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | |
290 | 290 | abort(500, 'You should not use 0 as a key in paginator. If you are looking for "ALL" option, use -1 instead.'); |
291 | 291 | |
292 | - }else{ |
|
292 | + } else{ |
|
293 | 293 | // developer defined length as setPageLengthMenu([50, 100, 300]) |
294 | 294 | // we will use the same values as labels |
295 | 295 | if(!in_array(0, $menu)) { |