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
Pull Request — master (#1945)
by Mike
03:19
created
src/ModelTraits/SpatieTranslatable/Sluggable.php 3 patches
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace Backpack\CRUD\ModelTraits\SpatieTranslatable;
4 4
 
5
-use Illuminate\Database\Eloquent\Model;
6
-use Illuminate\Database\Eloquent\Builder;
7 5
 use Cviebrock\EloquentSluggable\Sluggable as OriginalSluggable;
6
+use Illuminate\Database\Eloquent\Builder;
7
+use Illuminate\Database\Eloquent\Model;
8 8
 
9 9
 trait Sluggable
10 10
 {
Please login to merge, or discard this patch.
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,6 @@
 block discarded – undo
37 37
      * Query scope for finding "similar" slugs, used to determine uniqueness.
38 38
      *
39 39
      * @param \Illuminate\Database\Eloquent\Builder $query
40
-     * @param \Illuminate\Database\Eloquent\Model $model
41 40
      * @param string $attribute
42 41
      * @param array $config
43 42
      * @param string $slug
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
         $separator = $config['separator'];
49 49
         $attribute = $attribute.'->'.$this->getLocale();
50 50
 
51
-        return $query->where(function (Builder $q) use ($attribute, $slug, $separator) {
51
+        return $query->where(function(Builder $q) use ($attribute, $slug, $separator) {
52 52
             $q->where($attribute, '=', $slug)
53 53
                 ->orWhere($attribute, 'LIKE', $slug.$separator.'%')
54 54
                 // Fixes issues with Json data types in MySQL where data is sourrounded by "
Please login to merge, or discard this patch.
src/resources/views/fields/checklist_dependency.blade.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,13 +23,13 @@
 block discarded – undo
23 23
             }
24 24
         }
25 25
 
26
-      //for update form, get initial state of the entity
27
-      if( isset($id) && $id ){
26
+        //for update form, get initial state of the entity
27
+        if( isset($id) && $id ){
28 28
 
29 29
         //get entity with relations for primary dependency
30 30
         $entity_dependencies = $entity_model->with($primary_dependency['entity'])
31
-          ->with($primary_dependency['entity'].'.'.$primary_dependency['entity_secondary'])
32
-          ->find($id);
31
+            ->with($primary_dependency['entity'].'.'.$primary_dependency['entity_secondary'])
32
+            ->find($id);
33 33
 
34 34
             $secondaries_from_primary = [];
35 35
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         }
25 25
 
26 26
       //for update form, get initial state of the entity
27
-      if( isset($id) && $id ){
27
+      if (isset($id) && $id) {
28 28
 
29 29
         //get entity with relations for primary dependency
30 30
         $entity_dependencies = $entity_model->with($primary_dependency['entity'])
Please login to merge, or discard this patch.
src/PanelTraits/FakeColumns.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,19 +24,19 @@
 block discarded – undo
24 24
             if (isset($field['fake']) && $field['fake'] == true) {
25 25
                 // add it to the request in its appropriate variable - the one defined, if defined
26 26
                 if (isset($field['store_in'])) {
27
-                    if (! in_array($field['store_in'], $fakeFieldsColumnsArray, true)) {
27
+                    if (!in_array($field['store_in'], $fakeFieldsColumnsArray, true)) {
28 28
                         array_push($fakeFieldsColumnsArray, $field['store_in']);
29 29
                     }
30 30
                 } else {
31 31
                     //otherwise in the one defined in the $crud variable
32
-                    if (! in_array('extras', $fakeFieldsColumnsArray, true)) {
32
+                    if (!in_array('extras', $fakeFieldsColumnsArray, true)) {
33 33
                         array_push($fakeFieldsColumnsArray, 'extras');
34 34
                     }
35 35
                 }
36 36
             }
37 37
         }
38 38
 
39
-        if (! count($fakeFieldsColumnsArray)) {
39
+        if (!count($fakeFieldsColumnsArray)) {
40 40
             $fakeFieldsColumnsArray = ['extras'];
41 41
         }
42 42
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
      * been found.
10 10
      *
11 11
      * @param string   $form The CRUD form. Can be 'create', 'update' or 'both'. Default is 'create'.
12
-     * @param int|bool $id   Optional entity ID needed in the case of the update form.
12
+     * @param integer $id   Optional entity ID needed in the case of the update form.
13 13
      *
14 14
      * @return array The fake columns array.
15 15
      */
Please login to merge, or discard this patch.
src/PanelTraits/Delete.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      *
16 16
      * @param  int $id The id of the item to be deleted.
17 17
      *
18
-     * @return bool True if the item was deleted.
18
+     * @return string True if the item was deleted.
19 19
      *
20 20
      * @throws \Illuminate\Database\Eloquent\ModelNotFoundException if the model was not found.
21 21
      *
Please login to merge, or discard this patch.
src/PanelTraits/Access.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -12,12 +12,18 @@
 block discarded – undo
12 12
     |--------------------------------------------------------------------------
13 13
     */
14 14
 
15
+    /**
16
+     * @param string $access
17
+     */
15 18
     public function allowAccess($access)
16 19
     {
17 20
         // $this->addButtons((array)$access);
18 21
         return $this->access = array_merge(array_diff((array) $access, $this->access), $this->access);
19 22
     }
20 23
 
24
+    /**
25
+     * @param string $access
26
+     */
21 27
     public function denyAccess($access)
22 28
     {
23 29
         // $this->removeButtons((array)$access);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function hasAccess($permission)
35 35
     {
36
-        if (! in_array($permission, $this->access)) {
36
+        if (!in_array($permission, $this->access)) {
37 37
             return false;
38 38
         }
39 39
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     public function hasAccessToAll($permission_array)
69 69
     {
70 70
         foreach ($permission_array as $key => $permission) {
71
-            if (! in_array($permission, $this->access)) {
71
+            if (!in_array($permission, $this->access)) {
72 72
                 return false;
73 73
             }
74 74
         }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function hasAccessOrFail($permission)
88 88
     {
89
-        if (! in_array($permission, $this->access)) {
89
+        if (!in_array($permission, $this->access)) {
90 90
             throw new AccessDeniedException(trans('backpack::crud.unauthorized_access', ['access' => $permission]));
91 91
         }
92 92
 
Please login to merge, or discard this patch.
src/PanelTraits/Buttons.php 2 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -59,6 +59,9 @@  discard block
 block discarded – undo
59 59
         $this->addButton($stack, $name, 'model_function', $model_function_name, $position);
60 60
     }
61 61
 
62
+    /**
63
+     * @param string $view
64
+     */
62 65
     public function addButtonFromView($stack, $name, $view, $position = false)
63 66
     {
64 67
         $view = 'vendor.backpack.crud.buttons.'.$view;
@@ -104,6 +107,9 @@  discard block
 block discarded – undo
104 107
         $this->buttons = collect([]);
105 108
     }
106 109
 
110
+    /**
111
+     * @param string $stack
112
+     */
107 113
     public function removeAllButtonsFromStack($stack)
108 114
     {
109 115
         $this->buttons = $this->buttons->reject(function ($button) use ($stack) {
@@ -126,6 +132,12 @@  discard block
 block discarded – undo
126 132
     public $type = 'view';
127 133
     public $content;
128 134
 
135
+    /**
136
+     * @param string $stack
137
+     * @param string $name
138
+     * @param string $type
139
+     * @param string $content
140
+     */
129 141
     public function __construct($stack, $name, $type, $content)
130 142
     {
131 143
         $this->stack = $stack;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
          */
108 108
         $button = $this->buttons()->firstWhere('name', $name);
109 109
 
110
-        if (! $button) {
110
+        if (!$button) {
111 111
             abort(500, 'CRUD Button "'.$name.'" not found. Please check the button exists before you modify it.');
112 112
         }
113 113
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public function removeButton($name, $stack = null)
130 130
     {
131
-        $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
131
+        $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) {
132 132
             return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name);
133 133
         });
134 134
     }
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 
141 141
     public function removeAllButtonsFromStack($stack)
142 142
     {
143
-        $this->buttons = $this->buttons->reject(function ($button) use ($stack) {
143
+        $this->buttons = $this->buttons->reject(function($button) use ($stack) {
144 144
             return $button->stack == $stack;
145 145
         });
146 146
     }
147 147
 
148 148
     public function removeButtonFromStack($name, $stack)
149 149
     {
150
-        $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
150
+        $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) {
151 151
             return $button->name == $name && $button->stack == $stack;
152 152
         });
153 153
     }
Please login to merge, or discard this patch.
tests/Unit/CrudPanel/CrudPanelCreateTest.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace Backpack\CRUD\Tests\Unit\CrudPanel;
4 4
 
5
-use Faker\Factory;
6
-use Backpack\CRUD\Tests\Unit\Models\User;
7 5
 use Backpack\CRUD\Tests\Unit\Models\Article;
6
+use Backpack\CRUD\Tests\Unit\Models\User;
7
+use Faker\Factory;
8 8
 
9 9
 class CrudPanelCreateTest extends BaseDBCrudPanelTest
10 10
 {
Please login to merge, or discard this patch.
tests/Unit/CrudPanel/CrudPanelDeleteTest.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace Backpack\CRUD\Tests\Unit\CrudPanel;
4 4
 
5
-use Illuminate\Support\Facades\DB;
6 5
 use Backpack\CRUD\Tests\Unit\Models\Article;
7 6
 use Illuminate\Database\Eloquent\ModelNotFoundException;
7
+use Illuminate\Support\Facades\DB;
8 8
 
9 9
 class CrudPanelDeleteTest extends BaseDBCrudPanelTest
10 10
 {
Please login to merge, or discard this patch.
tests/Unit/CrudPanel/CrudPanelReadTest.php 1 patch
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,11 +2,11 @@
 block discarded – undo
2 2
 
3 3
 namespace Backpack\CRUD\Tests\Unit\CrudPanel;
4 4
 
5
-use Illuminate\Support\Collection;
6
-use Illuminate\Support\Facades\DB;
7
-use Backpack\CRUD\Tests\Unit\Models\User;
8 5
 use Backpack\CRUD\Tests\Unit\Models\Article;
6
+use Backpack\CRUD\Tests\Unit\Models\User;
9 7
 use Illuminate\Database\Eloquent\ModelNotFoundException;
8
+use Illuminate\Support\Collection;
9
+use Illuminate\Support\Facades\DB;
10 10
 
11 11
 class CrudPanelReadTest extends BaseDBCrudPanelTest
12 12
 {
Please login to merge, or discard this patch.