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 (#1997)
by Cristian
03:36
created
src/CrudServiceProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
     public function register()
87 87
     {
88 88
         // Bind the CrudPanel object to Laravel's service container
89
-        $this->app->singleton('crud', function ($app) {
89
+        $this->app->singleton('crud', function($app) {
90 90
             return new CrudPanel($app);
91 91
         });
92 92
 
93 93
         // load a macro for Route,
94 94
         // for developers to be able to load all routes for a CRUD resource in one line
95
-        if (! Route::hasMacro('crud')) {
95
+        if (!Route::hasMacro('crud')) {
96 96
             $this->addRouteMacro();
97 97
         }
98 98
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         $this->commands($this->commands);
104 104
 
105 105
         // map the elfinder prefix
106
-        if (! \Config::get('elfinder.route.prefix')) {
106
+        if (!\Config::get('elfinder.route.prefix')) {
107 107
             \Config::set('elfinder.route.prefix', \Config::get('backpack.base.route_prefix').'/elfinder');
108 108
         }
109 109
     }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     private function addRouteMacro()
118 118
     {
119
-        Route::macro('crud', function ($name, $controller) {
119
+        Route::macro('crud', function($name, $controller) {
120 120
             // put together the route name prefix,
121 121
             // as passed to the Route::group() statements
122 122
             $routeName = '';
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     {
163 163
         $crudPubPath = public_path('vendor/backpack/crud');
164 164
 
165
-        if (! is_dir($crudPubPath)) {
165
+        if (!is_dir($crudPubPath)) {
166 166
             return true;
167 167
         }
168 168
 
Please login to merge, or discard this patch.
src/PanelTraits/SaveActions.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
 
25 25
         $saveOptions = collect($permissions)
26 26
             // Restrict list to allowed actions.
27
-            ->filter(function ($action, $permission) {
27
+            ->filter(function($action, $permission) {
28 28
                 return $this->hasAccess($permission);
29 29
             })
30 30
             // Generate list of possible actions.
31
-            ->mapWithKeys(function ($action, $permission) {
31
+            ->mapWithKeys(function($action, $permission) {
32 32
                 return [$action => $this->getSaveActionButtonName($action)];
33 33
             })
34 34
             ->all();
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function setSaveAction($forceSaveAction = null)
65 65
     {
66
-        $saveAction = $forceSaveAction ?:
67
-            \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back'));
66
+        $saveAction = $forceSaveAction ?: \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back'));
68 67
 
69 68
         if (config('backpack.crud.show_save_action_change', true) &&
70 69
             session('save_action', 'save_and_back') !== $saveAction) {
Please login to merge, or discard this patch.
src/PanelTraits/Views.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -301,6 +301,9 @@  discard block
 block discarded – undo
301 301
         return $this->getShowView();
302 302
     }
303 303
 
304
+    /**
305
+     * @param string $view
306
+     */
304 307
     public function setPreviewView($view)
305 308
     {
306 309
         return $this->setShowView($view);
@@ -311,6 +314,9 @@  discard block
 block discarded – undo
311 314
         return $this->getEditView();
312 315
     }
313 316
 
317
+    /**
318
+     * @param string $view
319
+     */
314 320
     public function setUpdateView($view)
315 321
     {
316 322
         return $this->setEditView($view);
Please login to merge, or discard this patch.
src/CrudPanel.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function setModel($model_namespace)
78 78
     {
79
-        if (! class_exists($model_namespace)) {
79
+        if (!class_exists($model_namespace)) {
80 80
             throw new \Exception('The model does not exist.', 500);
81 81
         }
82 82
 
83
-        if (! method_exists($model_namespace, 'hasCrudTrait')) {
83
+        if (!method_exists($model_namespace, 'hasCrudTrait')) {
84 84
             throw new \Exception('Please use CrudTrait on the model.', 500);
85 85
         }
86 86
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     {
144 144
         $complete_route = $route.'.index';
145 145
 
146
-        if (! \Route::has($complete_route)) {
146
+        if (!\Route::has($complete_route)) {
147 147
             throw new \Exception('There are no routes for this route name.', 404);
148 148
         }
149 149
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
      */
245 245
     public function getFirstOfItsTypeInArray($type, $array)
246 246
     {
247
-        return array_first($array, function ($item) use ($type) {
247
+        return array_first($array, function($item) use ($type) {
248 248
             return $item['type'] == $type;
249 249
         });
250 250
     }
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
 
262 262
     public function sync($type, $fields, $attributes)
263 263
     {
264
-        if (! empty($this->{$type})) {
265
-            $this->{$type} = array_map(function ($field) use ($fields, $attributes) {
264
+        if (!empty($this->{$type})) {
265
+            $this->{$type} = array_map(function($field) use ($fields, $attributes) {
266 266
                 if (in_array($field['name'], (array) $fields)) {
267 267
                     $field = array_merge($field, $attributes);
268 268
                 }
@@ -294,15 +294,15 @@  discard block
 block discarded – undo
294 294
     {
295 295
         $relationArray = explode('.', $relationString);
296 296
 
297
-        if (! isset($length)) {
297
+        if (!isset($length)) {
298 298
             $length = count($relationArray);
299 299
         }
300 300
 
301
-        if (! isset($model)) {
301
+        if (!isset($model)) {
302 302
             $model = $this->model;
303 303
         }
304 304
 
305
-        $result = array_reduce(array_splice($relationArray, 0, $length), function ($obj, $method) {
305
+        $result = array_reduce(array_splice($relationArray, 0, $length), function($obj, $method) {
306 306
             return $obj->$method()->getRelated();
307 307
         }, $model);
308 308
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
         $relation = $model->{$firstRelationName};
353 353
 
354 354
         $results = [];
355
-        if (! empty($relation)) {
355
+        if (!empty($relation)) {
356 356
             if ($relation instanceof Collection) {
357 357
                 $currentResults = $relation->toArray();
358 358
             } else {
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 
362 362
             array_shift($relationArray);
363 363
 
364
-            if (! empty($relationArray)) {
364
+            if (!empty($relationArray)) {
365 365
                 foreach ($currentResults as $currentResult) {
366 366
                     $results = array_merge($results, $this->getRelationModelInstances($currentResult, implode('.', $relationArray)));
367 367
                 }
Please login to merge, or discard this patch.
Unused Use Statements   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -2,31 +2,31 @@
 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;
20
-use Backpack\CRUD\PanelTraits\Reorder;
21
-use Backpack\CRUD\PanelTraits\AutoFocus;
17
+use Backpack\CRUD\PanelTraits\HeadingsAndTitles;
22 18
 use Backpack\CRUD\PanelTraits\Macroable;
23
-use Backpack\CRUD\PanelTraits\FakeFields;
24 19
 use Backpack\CRUD\PanelTraits\Operations;
25
-use Backpack\CRUD\PanelTraits\FakeColumns;
20
+use Backpack\CRUD\PanelTraits\Query;
21
+use Backpack\CRUD\PanelTraits\Read;
22
+use Backpack\CRUD\PanelTraits\Reorder;
23
+use Backpack\CRUD\PanelTraits\RequiredFields;
26 24
 use Backpack\CRUD\PanelTraits\SaveActions;
25
+use Backpack\CRUD\PanelTraits\Search;
27 26
 use Backpack\CRUD\PanelTraits\Settings;
28
-use Backpack\CRUD\PanelTraits\RequiredFields;
29
-use Backpack\CRUD\PanelTraits\HeadingsAndTitles;
27
+use Backpack\CRUD\PanelTraits\Tabs;
28
+use Backpack\CRUD\PanelTraits\Update;
29
+use Backpack\CRUD\PanelTraits\Views;
30 30
 use Backpack\CRUD\PanelTraits\ViewsAndRestoresRevisions;
31 31
 use Illuminate\Database\Eloquent\Collection;
32 32
 
Please login to merge, or discard this patch.
src/PanelTraits/Read.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -175,6 +175,7 @@
 block discarded – undo
175 175
 
176 176
     /**
177 177
      * Set the number of rows that should be show on the list view.
178
+     * @param integer $value
178 179
      */
179 180
     public function setDefaultPageLength($value)
180 181
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     {
39 39
         $id = $this->getCurrentEntryId();
40 40
 
41
-        if (! $id) {
41
+        if (!$id) {
42 42
             return false;
43 43
         }
44 44
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function getEntry($id)
56 56
     {
57
-        if (! $this->entry) {
57
+        if (!$this->entry) {
58 58
             $this->entry = $this->model->findOrFail($id);
59 59
             $this->entry = $this->entry->withFakes();
60 60
         }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     {
200 200
         // If the default Page Length isn't in the menu's values, Add it the beginnin and resort all to show a croissant list.
201 201
         // assume both arrays are the same length.
202
-        if (! in_array($this->getDefaultPageLength(), $this->get('list.pageLengthMenu')[0])) {
202
+        if (!in_array($this->getDefaultPageLength(), $this->get('list.pageLengthMenu')[0])) {
203 203
             // Loop through 2 arrays of prop. page_length_menu
204 204
             foreach ($this->get('list.pageLengthMenu') as $key => &$page_length_choices) {
205 205
                 // This is a condition that should be always true.
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     public function getPageLengthMenu()
231 231
     {
232 232
         // if already set, use that
233
-        if (! $this->get('list.pageLengthMenu')) {
233
+        if (!$this->get('list.pageLengthMenu')) {
234 234
             // try to get the menu settings from the config file
235 235
             $this->set('list.pageLengthMenu', config('backpack.crud.page_length_menu') ?? [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'backpack::crud.all']]);
236 236
 
Please login to merge, or discard this patch.
src/PanelTraits/RequiredFields.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
      */
49 49
     public function isRequired($inputName, $operation)
50 50
     {
51
-        if (! $this->has($operation.'.requiredFields')) {
51
+        if (!$this->has($operation.'.requiredFields')) {
52 52
             return false;
53 53
         }
54 54
 
Please login to merge, or discard this patch.
src/PanelTraits/HeadingsAndTitles.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function getTitle($action = false)
23 23
     {
24
-        if (! $action) {
24
+        if (!$action) {
25 25
             $action = $this->getActionMethod();
26 26
         }
27 27
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function setTitle($string, $action = false)
40 40
     {
41
-        if (! $action) {
41
+        if (!$action) {
42 42
             $action = $this->getActionMethod();
43 43
         }
44 44
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function getHeading($action = false)
60 60
     {
61
-        if (! $action) {
61
+        if (!$action) {
62 62
             $action = $this->getActionMethod();
63 63
         }
64 64
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function setHeading($string, $action = false)
77 77
     {
78
-        if (! $action) {
78
+        if (!$action) {
79 79
             $action = $this->getActionMethod();
80 80
         }
81 81
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function getSubheading($action = false)
97 97
     {
98
-        if (! $action) {
98
+        if (!$action) {
99 99
             $action = $this->getActionMethod();
100 100
         }
101 101
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     public function setSubheading($string, $action = false)
114 114
     {
115
-        if (! $action) {
115
+        if (!$action) {
116 116
             $action = $this->getActionMethod();
117 117
         }
118 118
 
Please login to merge, or discard this patch.