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 (#1556)
by Thomas
07:32
created
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/CrudPanel.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -123,6 +123,7 @@
 block discarded – undo
123 123
      *
124 124
      * @param [string] Route name.
125 125
      * @param [array] Parameters.
126
+     * @param string $route
126 127
      */
127 128
     public function setRouteName($route, $parameters = [])
128 129
     {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     public function setModel($model_namespace)
90 90
     {
91
-        if (! class_exists($model_namespace)) {
91
+        if (!class_exists($model_namespace)) {
92 92
             throw new \Exception('This model does not exist.', 404);
93 93
         }
94 94
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     {
139 139
         $complete_route = $route.'.index';
140 140
 
141
-        if (! \Route::has($complete_route)) {
141
+        if (!\Route::has($complete_route)) {
142 142
             throw new \Exception('There are no routes for this route name.', 404);
143 143
         }
144 144
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
      */
189 189
     public function getFirstOfItsTypeInArray($type, $array)
190 190
     {
191
-        return array_first($array, function ($item) use ($type) {
191
+        return array_first($array, function($item) use ($type) {
192 192
             return $item['type'] == $type;
193 193
         });
194 194
     }
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 
206 206
     public function sync($type, $fields, $attributes)
207 207
     {
208
-        if (! empty($this->{$type})) {
209
-            $this->{$type} = array_map(function ($field) use ($fields, $attributes) {
208
+        if (!empty($this->{$type})) {
209
+            $this->{$type} = array_map(function($field) use ($fields, $attributes) {
210 210
                 if (in_array($field['name'], (array) $fields)) {
211 211
                     $field = array_merge($field, $attributes);
212 212
                 }
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
                 }
239 239
             }
240 240
 
241
-            return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function ($item) use ($items) {
242
-                return ! in_array($item['name'], $this->sort[$items]);
241
+            return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function($item) use ($items) {
242
+                return !in_array($item['name'], $this->sort[$items]);
243 243
             }));
244 244
         }
245 245
 
@@ -268,15 +268,15 @@  discard block
 block discarded – undo
268 268
     {
269 269
         $relationArray = explode('.', $relationString);
270 270
 
271
-        if (! isset($length)) {
271
+        if (!isset($length)) {
272 272
             $length = count($relationArray);
273 273
         }
274 274
 
275
-        if (! isset($model)) {
275
+        if (!isset($model)) {
276 276
             $model = $this->model;
277 277
         }
278 278
 
279
-        $result = array_reduce(array_splice($relationArray, 0, $length), function ($obj, $method) {
279
+        $result = array_reduce(array_splice($relationArray, 0, $length), function($obj, $method) {
280 280
             return $obj->$method()->getRelated();
281 281
         }, $model);
282 282
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         $relation = $model->{$firstRelationName};
324 324
 
325 325
         $results = [];
326
-        if (! empty($relation)) {
326
+        if (!empty($relation)) {
327 327
             if ($relation instanceof Collection) {
328 328
                 $currentResults = $relation->toArray();
329 329
             } else {
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
             array_shift($relationArray);
334 334
 
335
-            if (! empty($relationArray)) {
335
+            if (!empty($relationArray)) {
336 336
                 foreach ($currentResults as $currentResult) {
337 337
                     $results = array_merge($results, $this->getRelationModelInstances($currentResult, implode('.', $relationArray)));
338 338
                 }
Please login to merge, or discard this patch.
Unused Use Statements   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -2,28 +2,28 @@
 block discarded – undo
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;
24
-use Illuminate\Database\Eloquent\Collection;
25 20
 use Backpack\CRUD\PanelTraits\RequiredFields;
21
+use Backpack\CRUD\PanelTraits\Search;
22
+use Backpack\CRUD\PanelTraits\Tabs;
23
+use Backpack\CRUD\PanelTraits\Update;
24
+use Backpack\CRUD\PanelTraits\Views;
26 25
 use Backpack\CRUD\PanelTraits\ViewsAndRestoresRevisions;
26
+use Illuminate\Database\Eloquent\Collection;
27 27
 
28 28
 class CrudPanel
29 29
 {
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/Update.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -15,6 +15,7 @@
 block discarded – undo
15 15
      *
16 16
      * @param  [Int] The entity's id
17 17
      * @param  [Request] All inputs to be updated.
18
+     * @param integer $id
18 19
      *
19 20
      * @return [Eloquent Collection]
20 21
      */
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         foreach ($fields as &$field) {
53 53
             // set the value
54
-            if (! isset($field['value'])) {
54
+            if (!isset($field['value'])) {
55 55
                 if (isset($field['subfields'])) {
56 56
                     $field['value'] = [];
57 57
                     foreach ($field['subfields'] as $subfield) {
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         }
65 65
 
66 66
         // always have a hidden input for the entry id
67
-        if (! array_key_exists('id', $fields)) {
67
+        if (!array_key_exists('id', $fields)) {
68 68
             $fields['id'] = [
69 69
                 'name'  => $entry->getKeyName(),
70 70
                 'value' => $entry->getKey(),
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     {
88 88
         if (isset($field['entity'])) {
89 89
             $relationArray = explode('.', $field['entity']);
90
-            $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function ($obj, $method) {
90
+            $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function($obj, $method) {
91 91
                 return $obj->{$method} ? $obj->{$method} : $obj;
92 92
             }, $model);
93 93
 
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.
config/database/migrations/2017_09_08_000000_create_user_roles_table.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('roles', function (Blueprint $table) {
16
+        Schema::create('roles', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('name')->unique();
19 19
             $table->timestamps();
20 20
         });
21 21
 
22
-        Schema::create('user_role', function (Blueprint $table) {
22
+        Schema::create('user_role', function(Blueprint $table) {
23 23
             $table->integer('user_id')->length(10)->unsigned();
24 24
             $table->integer('role_id')->length(10)->unsigned();
25 25
             $table->timestamps();
Please login to merge, or discard this patch.
config/database/migrations/2017_09_08_000001_create_addresses_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('addresses', function (Blueprint $table) {
16
+        Schema::create('addresses', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->integer('account_details_id')->length(10)->unsigned();
19 19
             $table->string('city');
Please login to merge, or discard this patch.