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 ( 907f0d...5fa371 )
by Cristian
03:54 queued 11s
created
src/PanelTraits/Search.php 4 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -119,10 +119,10 @@
 block discarded – undo
119 119
         // add the details_row button to the first column
120 120
         if ($this->details_row) {
121 121
             $details_row_button = \View::make('crud::columns.details_row_button')
122
-                                           ->with('crud', $this)
123
-                                           ->with('entry', $entry)
124
-                                           ->with('row_number', $rowNumber)
125
-                                           ->render();
122
+                                            ->with('crud', $this)
123
+                                            ->with('entry', $entry)
124
+                                            ->with('row_number', $rowNumber)
125
+                                            ->render();
126 126
             $row_items[0] = $details_row_button.$row_items[0];
127 127
         }
128 128
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
      */
20 20
     public function applySearchTerm($searchTerm)
21 21
     {
22
-        return $this->query->where(function ($query) use ($searchTerm) {
22
+        return $this->query->where(function($query) use ($searchTerm) {
23 23
             foreach ($this->getColumns() as $column) {
24
-                if (! isset($column['type'])) {
24
+                if (!isset($column['type'])) {
25 25
                     abort(400, 'Missing column type when trying to apply search term.');
26 26
                 }
27 27
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
                 case 'select':
62 62
                 case 'select_multiple':
63
-                    $query->orWhereHas($column['entity'], function ($q) use ($column, $searchTerm) {
63
+                    $query->orWhereHas($column['entity'], function($q) use ($column, $searchTerm) {
64 64
                         $q->where($column['attribute'], 'like', '%'.$searchTerm.'%');
65 65
                     });
66 66
                     break;
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     private function renderCellView($view, $column, $entry, $rowNumber = false)
179 179
     {
180
-        if (! view()->exists($view)) {
180
+        if (!view()->exists($view)) {
181 181
             $view = 'crud::columns.text'; // fallback to text column
182 182
         }
183 183
 
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,6 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
     /**
37 37
      * Apply the search logic for each CRUD column.
38
+     * @param string $searchTerm
38 39
      */
39 40
     public function applySearchLogicForColumn($query, $column, $searchTerm)
40 41
     {
@@ -230,7 +231,7 @@  discard block
 block discarded – undo
230 231
      *
231 232
      * @param string   $view
232 233
      * @param array    $column
233
-     * @param object   $entry
234
+     * @param \Illuminate\Database\Eloquent\Model   $entry
234 235
      * @param bool|int $rowNumber The number shown to the user as row number (index)
235 236
      *
236 237
      * @return string
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace Backpack\CRUD\PanelTraits;
4 4
 
5
-use Validator;
6 5
 use Carbon\Carbon;
6
+use Validator;
7 7
 
8 8
 trait Search
9 9
 {
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
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     public function isRequired($inputName, $operation)
44 44
     {
45
-        if (! isset($this->requiredFields[$operation])) {
45
+        if (!isset($this->requiredFields[$operation])) {
46 46
             return false;
47 47
         }
48 48
 
Please login to merge, or discard this patch.
src/app/Http/Controllers/Operations/SaveActions.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 
23 23
         $saveOptions = collect($permissions)
24 24
             // Restrict list to allowed actions.
25
-            ->filter(function ($action, $permission) {
25
+            ->filter(function($action, $permission) {
26 26
                 return $this->crud->hasAccess($permission);
27 27
             })
28 28
             // Generate list of possible actions.
29
-            ->mapWithKeys(function ($action, $permission) {
29
+            ->mapWithKeys(function($action, $permission) {
30 30
                 return [$action => $this->getSaveActionButtonName($action)];
31 31
             })
32 32
             ->all();
@@ -61,8 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function setSaveAction($forceSaveAction = null)
63 63
     {
64
-        $saveAction = $forceSaveAction ?:
65
-            \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back'));
64
+        $saveAction = $forceSaveAction ?: \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back'));
66 65
 
67 66
         if (config('backpack.crud.show_save_action_change', true) &&
68 67
             session('save_action', 'save_and_back') !== $saveAction) {
Please login to merge, or discard this patch.
src/PanelTraits/HeadingsAndTitle.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.
src/CrudUsageStats.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
      * Check if the application is running in normal conditions
11 11
      * (production env, not in console, not in unit tests).
12 12
      *
13
-     * @return void
13
+     * @return boolean
14 14
      */
15 15
     private function runningInProduction()
16 16
     {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      * @param  string $method  HTTP Method to use for the request.
87 87
      * @param  string $url     URL to point the request at.
88 88
      * @param  array $payload  The data you want sent to the URL.
89
-     * @return void
89
+     * @return boolean
90 90
      */
91 91
     private function makeCurlRequest($method, $url, $payload)
92 92
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     private function sendUsageStats()
39 39
     {
40 40
         // only send usage stats in production
41
-        if (! $this->runningInProduction()) {
41
+        if (!$this->runningInProduction()) {
42 42
             return;
43 43
         }
44 44
 
Please login to merge, or discard this patch.
src/resources/views/columns/array_count.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 <span>
3 3
     <?php
4 4
     $array = $entry->{$column['name']};
5
-    $suffix = isset($column['suffix'])?$column['suffix']:'items';
5
+    $suffix = isset($column['suffix']) ? $column['suffix'] : 'items';
6 6
 
7 7
     // the value should be an array wether or not attribute casting is used
8 8
     if (!is_array($array)) {
Please login to merge, or discard this patch.
src/PanelTraits/Columns.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     /**
144 144
      * Move the most recently added column after the given target column.
145 145
      *
146
-     * @param string|array $targetColumn The target column name or array.
146
+     * @param string $targetColumn The target column name or array.
147 147
      */
148 148
     public function afterColumn($targetColumn)
149 149
     {
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
     /**
164 164
      * Move this column to be first in the columns list.
165
-     * @return bool|null
165
+     * @return false|null
166 166
      */
167 167
     public function makeFirstColumn()
168 168
     {
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
     /**
282 282
      * Change attributes for multiple columns.
283 283
      *
284
-     * @param array $columns
284
+     * @param string[] $columns
285 285
      * @param array $attributes
286 286
      */
287 287
     public function setColumnsDetails($columns, $attributes)
Please login to merge, or discard this patch.
Spacing   +16 added lines, -17 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     public function addColumn($column)
69 69
     {
70 70
         // if a string was passed, not an array, change it to an array
71
-        if (! is_array($column)) {
71
+        if (!is_array($column)) {
72 72
             $column = ['name' => $column];
73 73
         }
74 74
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         $column_with_details = $this->addDefaultLabel($column);
77 77
 
78 78
         // make sure the column has a name
79
-        if (! array_key_exists('name', $column_with_details)) {
79
+        if (!array_key_exists('name', $column_with_details)) {
80 80
             $column_with_details['name'] = 'anonymous_column_'.str_random(5);
81 81
         }
82 82
 
@@ -84,27 +84,27 @@  discard block
 block discarded – undo
84 84
         $columnExistsInDb = $this->hasColumn($this->model->getTable(), $column_with_details['name']);
85 85
 
86 86
         // make sure the column has a type
87
-        if (! array_key_exists('type', $column_with_details)) {
87
+        if (!array_key_exists('type', $column_with_details)) {
88 88
             $column_with_details['type'] = 'text';
89 89
         }
90 90
 
91 91
         // make sure the column has a key
92
-        if (! array_key_exists('key', $column_with_details)) {
92
+        if (!array_key_exists('key', $column_with_details)) {
93 93
             $column_with_details['key'] = $column_with_details['name'];
94 94
         }
95 95
 
96 96
         // make sure the column has a tableColumn boolean
97
-        if (! array_key_exists('tableColumn', $column_with_details)) {
97
+        if (!array_key_exists('tableColumn', $column_with_details)) {
98 98
             $column_with_details['tableColumn'] = $columnExistsInDb ? true : false;
99 99
         }
100 100
 
101 101
         // make sure the column has a orderable boolean
102
-        if (! array_key_exists('orderable', $column_with_details)) {
102
+        if (!array_key_exists('orderable', $column_with_details)) {
103 103
             $column_with_details['orderable'] = $columnExistsInDb ? true : false;
104 104
         }
105 105
 
106 106
         // make sure the column has a searchLogic
107
-        if (! array_key_exists('searchLogic', $column_with_details)) {
107
+        if (!array_key_exists('searchLogic', $column_with_details)) {
108 108
             $column_with_details['searchLogic'] = $columnExistsInDb ? true : false;
109 109
         }
110 110
 
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
 
113 113
         // make sure the column has a priority in terms of visibility
114 114
         // if no priority has been defined, use the order in the array plus one
115
-        if (! array_key_exists('priority', $column_with_details)) {
115
+        if (!array_key_exists('priority', $column_with_details)) {
116 116
             $position_in_columns_array = (int) array_search($column_with_details['key'], array_keys($this->columns));
117 117
             $this->columns[$column_with_details['key']]['priority'] = $position_in_columns_array + 1;
118 118
         }
119 119
 
120 120
         // if this is a relation type field and no corresponding model was specified, get it from the relation method
121 121
         // defined in the main model
122
-        if (isset($column_with_details['entity']) && ! isset($column_with_details['model'])) {
122
+        if (isset($column_with_details['entity']) && !isset($column_with_details['model'])) {
123 123
             $column_with_details['model'] = $this->getRelationModel($column_with_details['entity']);
124 124
         }
125 125
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      */
167 167
     public function makeFirstColumn()
168 168
     {
169
-        if (! $this->columns) {
169
+        if (!$this->columns) {
170 170
             return false;
171 171
         }
172 172
 
@@ -187,8 +187,7 @@  discard block
 block discarded – undo
187 187
         $targetColumnName = is_array($targetColumn) ? $targetColumn['name'] : $targetColumn;
188 188
 
189 189
         if (array_key_exists($targetColumnName, $this->columns)) {
190
-            $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) :
191
-                array_search($targetColumnName, array_keys($this->columns)) + 1;
190
+            $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : array_search($targetColumnName, array_keys($this->columns)) + 1;
192 191
 
193 192
             $element = array_pop($this->columns);
194 193
             $beginningPart = array_slice($this->columns, 0, $targetColumnPosition, true);
@@ -225,7 +224,7 @@  discard block
 block discarded – undo
225 224
      */
226 225
     public function addDefaultLabel($array)
227 226
     {
228
-        if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
227
+        if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
229 228
             $array = array_merge(['label' => mb_ucfirst($this->makeLabel($array['name']))], $array);
230 229
 
231 230
             return $array;
@@ -251,7 +250,7 @@  discard block
 block discarded – undo
251 250
      */
252 251
     public function removeColumns($columns)
253 252
     {
254
-        if (! empty($columns)) {
253
+        if (!empty($columns)) {
255 254
             foreach ($columns as $columnName) {
256 255
                 $this->removeColumn($columnName);
257 256
             }
@@ -273,8 +272,8 @@  discard block
 block discarded – undo
273 272
      */
274 273
     public function remove($entity, $fields)
275 274
     {
276
-        return array_values(array_filter($this->{$entity}, function ($field) use ($fields) {
277
-            return ! in_array($field['name'], (array) $fields);
275
+        return array_values(array_filter($this->{$entity}, function($field) use ($fields) {
276
+            return !in_array($field['name'], (array) $fields);
278 277
         }));
279 278
     }
280 279
 
@@ -331,7 +330,7 @@  discard block
 block discarded – undo
331 330
     {
332 331
         $columns = $this->getColumns();
333 332
 
334
-        return collect($columns)->pluck('entity')->reject(function ($value, $key) {
333
+        return collect($columns)->pluck('entity')->reject(function($value, $key) {
335 334
             return $value == null;
336 335
         })->toArray();
337 336
     }
Please login to merge, or discard this patch.
src/PanelTraits/Buttons.php 2 patches
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.
Doc Comments   +13 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,6 +62,9 @@  discard block
 block discarded – undo
62 62
         $this->addButton($stack, $name, 'model_function', $model_function_name, $position);
63 63
     }
64 64
 
65
+    /**
66
+     * @param string $view
67
+     */
65 68
     public function addButtonFromView($stack, $name, $view, $position = false)
66 69
     {
67 70
         $view = 'vendor.backpack.crud.buttons.'.$view;
@@ -98,7 +101,7 @@  discard block
 block discarded – undo
98 101
      * @param  string $name          The button name.
99 102
      * @param  array  $modifications The attributes and their new values.
100 103
      *
101
-     * @return CrudButton                The button that has suffered the changes, for daisychaining methods.
104
+     * @return Collection                The button that has suffered the changes, for daisychaining methods.
102 105
      */
103 106
     public function modifyButton($name, $modifications = null)
104 107
     {
@@ -138,6 +141,9 @@  discard block
 block discarded – undo
138 141
         $this->buttons = collect([]);
139 142
     }
140 143
 
144
+    /**
145
+     * @param string $stack
146
+     */
141 147
     public function removeAllButtonsFromStack($stack)
142 148
     {
143 149
         $this->buttons = $this->buttons->reject(function ($button) use ($stack) {
@@ -160,6 +166,12 @@  discard block
 block discarded – undo
160 166
     public $type = 'view';
161 167
     public $content;
162 168
 
169
+    /**
170
+     * @param string $stack
171
+     * @param string $name
172
+     * @param string $type
173
+     * @param string $content
174
+     */
163 175
     public function __construct($stack, $name, $type, $content)
164 176
     {
165 177
         $this->stack = $stack;
Please login to merge, or discard this patch.
src/PanelTraits/Tabs.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function tabsDisabled()
37 37
     {
38
-        return ! $this->tabsEnabled;
38
+        return !$this->tabsEnabled;
39 39
     }
40 40
 
41 41
     public function setTabsType($type)
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
     {
117 117
         $all_fields = $this->getCurrentFields();
118 118
 
119
-        $fields_without_a_tab = collect($all_fields)->filter(function ($value, $key) {
120
-            return ! isset($value['tab']);
119
+        $fields_without_a_tab = collect($all_fields)->filter(function($value, $key) {
120
+            return !isset($value['tab']);
121 121
         });
122 122
 
123 123
         return $fields_without_a_tab;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         if ($this->tabExists($label)) {
134 134
             $all_fields = $this->getCurrentFields();
135 135
 
136
-            $fields_for_current_tab = collect($all_fields)->filter(function ($value, $key) use ($label) {
136
+            $fields_for_current_tab = collect($all_fields)->filter(function($value, $key) use ($label) {
137 137
                 return isset($value['tab']) && $value['tab'] == $label;
138 138
             });
139 139
 
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
         $fields = $this->getCurrentFields();
153 153
 
154 154
         $fields_with_tabs = collect($fields)
155
-            ->filter(function ($value, $key) {
155
+            ->filter(function($value, $key) {
156 156
                 return isset($value['tab']);
157 157
             })
158
-            ->each(function ($value, $key) use (&$tabs) {
159
-                if (! in_array($value['tab'], $tabs)) {
158
+            ->each(function($value, $key) use (&$tabs) {
159
+                if (!in_array($value['tab'], $tabs)) {
160 160
                     $tabs[] = $value['tab'];
161 161
                 }
162 162
             });
Please login to merge, or discard this patch.