Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Push — master ( 3d2fec...3195c5 )
by Cristian
02:59
created
src/CrudServiceProvider.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 namespace Backpack\CRUD;
3 3
 
4 4
 use Illuminate\Support\ServiceProvider;
5
-use Illuminate\Routing\Router;
6 5
 use Route;
7 6
 
8 7
 class CrudServiceProvider extends ServiceProvider
Please login to merge, or discard this patch.
src/resources/views/list.blade.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,8 +71,7 @@
 block discarded – undo
71 71
                             if ($results && $results->count()) {
72 72
                                 $results_array = $results->lists($column['attribute'], 'id');
73 73
                                 echo implode(', ', $results_array->toArray());
74
-                                }
75
-                                else
74
+                                } else
76 75
                                 {
77 76
                                 echo '-';
78 77
                                 }
Please login to merge, or discard this patch.
src/app/Http/Controllers/CrudController.php 1 patch
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -3,16 +3,12 @@
 block discarded – undo
3 3
 use Illuminate\Foundation\Bus\DispatchesJobs;
4 4
 use Illuminate\Routing\Controller as BaseController;
5 5
 use Illuminate\Foundation\Validation\ValidatesRequests;
6
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
7
-use Illuminate\Support\Facades\Form as Form;
8 6
 use Illuminate\Http\Request;
9 7
 use Backpack\CRUD\Crud;
10
-use Crypt;
11 8
 use Alert;
12 9
 
13 10
 
14 11
 // VALIDATION: change the requests to match your own file names if you need form validation
15
-use Backpack\CRUD\app\Http\Requests\CrudRequest as StoreRequest;
16 12
 use Backpack\CRUD\app\Http\Requests\CrudRequest as UpdateRequest;
17 13
 
18 14
 class CrudController extends BaseController {
Please login to merge, or discard this patch.
src/app/Http/Controllers/ExampleCrudController.php 1 patch
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -1,12 +1,8 @@
 block discarded – undo
1 1
 <?php namespace App\Http\Controllers\Admin;
2 2
 
3
-use App\Http\Requests;
4
-use App\Http\Controllers\Controller;
5 3
 use Backpack\CRUD\app\Http\Controllers\CrudController;
6
-use Illuminate\Http\Request;
7 4
 
8 5
 // VALIDATION: change the requests to match your own file names if you need form validation
9
-use Backpack\CRUD\app\Http\Requests\CrudRequest as StoreRequest;
10 6
 use Backpack\CRUD\app\Http\Requests\CrudRequest as UpdateRequest;
11 7
 
12 8
 class ExampleCrudController extends CrudController {
Please login to merge, or discard this patch.
src/app/Http/Controllers/ToneCrudNestedController.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -4,10 +4,7 @@
 block discarded – undo
4 4
  */
5 5
 namespace Backpack\Crud\Http\Controllers;
6 6
 
7
-use Illuminate\Foundation\Bus\DispatchesJobs;
8 7
 use Illuminate\Routing\Controller as BaseController;
9
-use Illuminate\Foundation\Validation\ValidatesRequests;
10
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
11 8
 use Backpack\Crud\Crud;
12 9
 
13 10
 /**
Please login to merge, or discard this patch.
src/CrudTrait.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,6 @@
 block discarded – undo
1 1
 <?php namespace Backpack\CRUD;
2 2
 
3
-use Illuminate\Database\Eloquent\Collection;
4
-use Illuminate\Database\Eloquent\Model;
5 3
 use DB;
6
-use Lang;
7 4
 
8 5
 trait CrudTrait {
9 6
 
Please login to merge, or discard this patch.
src/resources/views/fields/checklist_dependency.blade.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
                 $secondary_ids[$second_item] = $second_item;
46 46
             }
47 47
           }
48
-        }else{ //create dependecies from relation if not from validate error
48
+        } else{ //create dependecies from relation if not from validate error
49 49
           foreach( $primary_array as $primary_item ){
50 50
             foreach($primary_item[$secondary_dependency['entity']] as $second_item ){
51 51
                 $secondary_ids[$second_item['id']] = $second_item['id'];
Please login to merge, or discard this patch.
src/ToneCrud.php 1 patch
Braces   +64 added lines, -22 removed lines patch added patch discarded remove patch
@@ -40,7 +40,9 @@  discard block
 block discarded – undo
40 40
 
41 41
     public function setModel($model)
42 42
     {
43
-        if (!class_exists($model)) throw new \Exception('This model does not exist.', 404);
43
+        if (!class_exists($model)) {
44
+            throw new \Exception('This model does not exist.', 404);
45
+        }
44 46
 
45 47
         $this->model = new $model();
46 48
         $this->query = $this->model->select('*');
@@ -56,7 +58,9 @@  discard block
 block discarded – undo
56 58
     // TODO: make this work without having to specify "index"
57 59
     public function setRoute($route, $parameters = [])
58 60
     {
59
-        if (!\Route::has($route)) throw new \Exception('This route does not exist.', 404);
61
+        if (!\Route::has($route)) {
62
+            throw new \Exception('This route does not exist.', 404);
63
+        }
60 64
 
61 65
         $this->route = route($route, $parameters);
62 66
         $this->initButtons();
@@ -254,7 +258,9 @@  discard block
 block discarded – undo
254 258
     {
255 259
         $model = $this->model->findOrFail($id);
256 260
         $updated = $model->update($data);
257
-        if ($updated) $this->syncPivot($model, $data);
261
+        if ($updated) {
262
+            $this->syncPivot($model, $data);
263
+        }
258 264
 
259 265
         return $model;
260 266
     }
@@ -282,7 +288,9 @@  discard block
 block discarded – undo
282 288
 
283 289
     public function checkPermission($permission) // DONE
284 290
     {
285
-        if (!in_array($permission, $this->permissions)) abort(403);
291
+        if (!in_array($permission, $this->permissions)) {
292
+            abort(403);
293
+        }
286 294
     }
287 295
 
288 296
     public function unsetListActions($actions)
@@ -351,11 +359,17 @@  discard block
 block discarded – undo
351 359
 
352 360
         $this->state = 'list';
353 361
 
354
-        if (in_array('create', $segments)) $this->state = 'add';
362
+        if (in_array('create', $segments)) {
363
+            $this->state = 'add';
364
+        }
355 365
 
356
-        if (in_array('edit', $segments)) $this->state = 'edit';
366
+        if (in_array('edit', $segments)) {
367
+            $this->state = 'edit';
368
+        }
357 369
 
358
-        if (is_numeric(end($segments))) $this->state = 'view';
370
+        if (is_numeric(end($segments))) {
371
+            $this->state = 'view';
372
+        }
359 373
     }
360 374
 
361 375
     private function removeButtons($buttons)
@@ -373,21 +387,27 @@  discard block
 block discarded – undo
373 387
         $columns = \Schema::getColumnListing($this->model->getTable());
374 388
         $fillable = $this->model->getFillable();
375 389
 
376
-        if (!empty($fillable)) $columns = array_intersect($columns, $fillable);
390
+        if (!empty($fillable)) {
391
+            $columns = array_intersect($columns, $fillable);
392
+        }
377 393
 
378 394
         return array_values(array_diff($columns, [$this->model->getKeyName(), 'updated_at', 'deleted_at']));
379 395
     }
380 396
 
381 397
     private function syncColumn($column)
382 398
     {
383
-        if (array_key_exists('name', (array)$column)) return array_merge(['type' => $this->getType($column['name'])], $column);
399
+        if (array_key_exists('name', (array)$column)) {
400
+            return array_merge(['type' => $this->getType($column['name'])], $column);
401
+        }
384 402
 
385 403
         return false;
386 404
     }
387 405
 
388 406
     private function syncField($field)
389 407
     {
390
-        if (array_key_exists('name', (array)$field)) return array_merge(['type' => $this->getType($field['name']), 'value' => '', 'default' => null, 'values' => [], 'attributes' => []], $field);
408
+        if (array_key_exists('name', (array)$field)) {
409
+            return array_merge(['type' => $this->getType($field['name']), 'value' => '', 'default' => null, 'values' => [], 'attributes' => []], $field);
410
+        }
391 411
 
392 412
         return false;
393 413
     }
@@ -404,11 +424,17 @@  discard block
 block discarded – undo
404 424
 
405 425
     private function getType($field) // DONE
406 426
     {
407
-        if (!array_key_exists($field, $this->fieldTypes)) return 'text';
427
+        if (!array_key_exists($field, $this->fieldTypes)) {
428
+            return 'text';
429
+        }
408 430
 
409
-        if ($field == 'password') return 'password';
431
+        if ($field == 'password') {
432
+            return 'password';
433
+        }
410 434
 
411
-        if ($field == 'email') return 'email';
435
+        if ($field == 'email') {
436
+            return 'email';
437
+        }
412 438
 
413 439
         switch ($this->fieldTypes[$field]['type'])
414 440
         {
@@ -466,7 +492,9 @@  discard block
 block discarded – undo
466 492
 
467 493
             $this->fields[] = ['name' => $field, 'value' => '', 'default' => $this->fieldTypes[$field]['default'], 'type' => $this->getType($field), 'values' => [], 'attributes' => []];
468 494
 
469
-            if (!in_array($field, $this->model->getHidden())) $this->columns[] = ['name' => $field, 'type' => $this->getType($field)];
495
+            if (!in_array($field, $this->model->getHidden())) {
496
+                $this->columns[] = ['name' => $field, 'type' => $this->getType($field)];
497
+            }
470 498
         }, $this->getColumns());
471 499
     }
472 500
 
@@ -478,8 +506,11 @@  discard block
 block discarded – undo
478 506
 
479 507
             foreach ($this->{$fields} as $key => $field)
480 508
             {
481
-                if (array_key_exists($field['name'], $this->relations) && $this->relations[$field['name']]['pivot']) $this->{$fields}[$key]['value'] = $this->item->{$this->relations[$field['name']]['name']}()->lists($this->relations[$field['name']]['model']->getKeyName())->toArray();
482
-                    else $this->{$fields}[$key]['value'] = $this->item->{$field['name']};
509
+                if (array_key_exists($field['name'], $this->relations) && $this->relations[$field['name']]['pivot']) {
510
+                    $this->{$fields}[$key]['value'] = $this->item->{$this->relations[$field['name']]['name']}()->lists($this->relations[$field['name']]['model']->getKeyName())->toArray();
511
+                } else {
512
+                        $this->{$fields}[$key]['value'] = $this->item->{$field['name']};
513
+                    }
483 514
             }
484 515
         }
485 516
     }
@@ -499,7 +530,9 @@  discard block
 block discarded – undo
499 530
         if (!empty($this->{$type}))
500 531
         {
501 532
             $this->{$type} = array_map(function($field) use ($fields, $attributes) {
502
-                if (in_array($field['name'], (array)$fields)) $field = array_merge($field, $attributes);
533
+                if (in_array($field['name'], (array)$fields)) {
534
+                    $field = array_merge($field, $attributes);
535
+                }
503 536
 
504 537
                 return $field;
505 538
             }, $this->{$type});
@@ -524,7 +557,9 @@  discard block
 block discarded – undo
524 557
 
525 558
             foreach ($this->sort[$items] as $item)
526 559
             {
527
-                if (is_numeric($key = array_search($item, array_column($this->{$items}, 'name')))) $elements[] = $this->{$items}[$key];
560
+                if (is_numeric($key = array_search($item, array_column($this->{$items}, 'name')))) {
561
+                    $elements[] = $this->{$items}[$key];
562
+                }
528 563
             }
529 564
 
530 565
             return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function($item) use($items) {return !in_array($item['name'], $this->sort[$items]);}));
@@ -554,9 +589,13 @@  discard block
 block discarded – undo
554 589
         $order = (array)$order;
555 590
         $values = $model->select('*');
556 591
 
557
-        if (!empty($where)) call_user_func_array([$values, $where[0]], array_slice($where, 1));
592
+        if (!empty($where)) {
593
+            call_user_func_array([$values, $where[0]], array_slice($where, 1));
594
+        }
558 595
 
559
-        if (!empty($order)) call_user_func_array([$values, 'orderBy'], $order);
596
+        if (!empty($order)) {
597
+            call_user_func_array([$values, 'orderBy'], $order);
598
+        }
560 599
 
561 600
         return $values->get()->lists($field, $model->getKeyName())->toArray();
562 601
     }
@@ -564,8 +603,11 @@  discard block
 block discarded – undo
564 603
     private function syncRelations($entity)
565 604
     {
566 605
         foreach ($this->relations as $field => $relation) {
567
-            if ($relation['pivot']) $this->add($entity, ['name' => $field, 'type' => 'multiselect', 'value' => [], 'values' => $this->relations[$field]['values']]);
568
-                else $this->sync($entity, $field, ['type' => 'select', 'values' => $this->relations[$field]['values']]);
606
+            if ($relation['pivot']) {
607
+                $this->add($entity, ['name' => $field, 'type' => 'multiselect', 'value' => [], 'values' => $this->relations[$field]['values']]);
608
+            } else {
609
+                    $this->sync($entity, $field, ['type' => 'select', 'values' => $this->relations[$field]['values']]);
610
+                }
569 611
         }
570 612
     }
571 613
 
Please login to merge, or discard this patch.
src/app/Http/Controllers/ToneCrudController.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -4,10 +4,7 @@
 block discarded – undo
4 4
  */
5 5
 namespace Backpack\Crud\Http\Controllers;
6 6
 
7
-use Illuminate\Foundation\Bus\DispatchesJobs;
8 7
 use Illuminate\Routing\Controller as BaseController;
9
-use Illuminate\Foundation\Validation\ValidatesRequests;
10
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
11 8
 use Backpack\Crud\Crud;
12 9
 
13 10
 /**
Please login to merge, or discard this patch.