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/resources/lang/ar/crud.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     |
14 14
     */
15 15
 
16
- return [
16
+    return [
17 17
     'infoFiltered' => '(filtered from _MAX_ total entries)',
18 18
     'thousands' => ',',
19 19
     'admin' => 'المشرف',
Please login to merge, or discard this patch.
src/public/ckeditor/samples/old/assets/posteddata.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@
 block discarded – undo
25 25
 		</thead>
26 26
 <?php
27 27
 
28
-if (! empty($_POST)) {
28
+if (!empty($_POST)) {
29 29
     foreach ($_POST as $key => $value) {
30
-        if ((! is_string($value) && ! is_numeric($value)) || ! is_string($key)) {
30
+        if ((!is_string($value) && !is_numeric($value)) || !is_string($key)) {
31 31
             continue;
32 32
         }
33 33
 
Please login to merge, or discard this patch.
src/PanelTraits/Access.php 2 patches
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.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -14,11 +14,17 @@
 block discarded – undo
14 14
     |--------------------------------------------------------------------------
15 15
     */
16 16
 
17
+    /**
18
+     * @param string $access
19
+     */
17 20
     public function allowAccess($access)
18 21
     {
19 22
         return $this->access = array_merge(array_diff((array) $access, $this->access), $this->access);
20 23
     }
21 24
 
25
+    /**
26
+     * @param string $access
27
+     */
22 28
     public function denyAccess($access)
23 29
     {
24 30
         return $this->access = array_diff($this->access, (array) $access);
Please login to merge, or discard this patch.
src/app/Console/Commands/Install.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
                     $this->executeProcess('mkdir -p public/uploads');
54 54
                     break;
55 55
                 case '\\': // windows
56
-                    if (! file_exists('public\uploads')) {
56
+                    if (!file_exists('public\uploads')) {
57 57
                         $this->executeProcess('mkdir public\uploads');
58 58
                     }
59 59
                     break;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     /**
31 31
      * Execute the console command.
32 32
      *
33
-     * @return mixed
33
+     * @return false|null
34 34
      */
35 35
     public function handle()
36 36
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Backpack\CRUD\app\Console\Commands;
4 4
 
5
-use Illuminate\Console\Command;
6 5
 use Backpack\Base\app\Console\Commands\Install as BaseInstall;
7 6
 
8 7
 class Install extends BaseInstall
Please login to merge, or discard this patch.
src/app/Console/Commands/Publish.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $sourceFile = $this->sourcePath.$file.'.blade.php';
74 74
         $copiedFile = $this->destinationPath.$file.'.blade.php';
75 75
 
76
-        if (! file_exists($sourceFile)) {
76
+        if (!file_exists($sourceFile)) {
77 77
             return $this->error(
78 78
                 'Cannot find source view file at '
79 79
                 .$sourceFile.
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             if ($canCopy) {
94 94
                 $path = pathinfo($copiedFile);
95 95
 
96
-                if (! file_exists($path['dirname'])) {
96
+                if (!file_exists($path['dirname'])) {
97 97
                     mkdir($path['dirname'], 0755, true);
98 98
                 }
99 99
 
Please login to merge, or discard this patch.
src/PanelTraits/Search.php 4 patches
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.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -210,10 +210,10 @@
 block discarded – undo
210 210
         // add the details_row button to the first column
211 211
         if ($this->get('list.detailsRow')) {
212 212
             $details_row_button = \View::make('crud::columns.details_row_button')
213
-                                           ->with('crud', $this)
214
-                                           ->with('entry', $entry)
215
-                                           ->with('row_number', $rowNumber)
216
-                                           ->render();
213
+                                            ->with('crud', $this)
214
+                                            ->with('entry', $entry)
215
+                                            ->with('row_number', $rowNumber)
216
+                                            ->render();
217 217
             $row_items[0] = $details_row_button.$row_items[0];
218 218
         }
219 219
 
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/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.
tests/Unit/CrudPanel/CrudPanelTabsTest.php 1 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\Tests\Unit\CrudPanel;
4 4
 
5
-use Illuminate\Support\Facades\DB;
6 5
 use Backpack\CRUD\Tests\Unit\Models\Article;
6
+use Illuminate\Support\Facades\DB;
7 7
 
8 8
 class CrudPanelTabsTest extends BaseDBCrudPanelTest
9 9
 {
Please login to merge, or discard this patch.