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 (#1987)
by Cristian
02:26
created
src/resources/views/columns/array_count.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 
6 6
 <span>
7 7
     <?php
8
-    $suffix = isset($column['suffix'])?$column['suffix']:'items';
8
+    $suffix = isset($column['suffix']) ? $column['suffix'] : 'items';
9 9
 
10 10
     // the value should be an array wether or not attribute casting is used
11 11
     if (!is_array($array)) {
Please login to merge, or discard this patch.
src/PanelTraits/Buttons.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
          */
109 109
         $button = $this->buttons()->firstWhere('name', $name);
110 110
 
111
-        if (! $button) {
111
+        if (!$button) {
112 112
             abort(500, 'CRUD Button "'.$name.'" not found. Please check the button exists before you modify it.');
113 113
         }
114 114
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      */
130 130
     public function removeButton($name, $stack = null)
131 131
     {
132
-        $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
132
+        $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) {
133 133
             return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name);
134 134
         });
135 135
     }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     public function removeButtons($names, $stack = null)
142 142
     {
143
-        if (! empty($names)) {
143
+        if (!empty($names)) {
144 144
             foreach ($names as $name) {
145 145
                 $this->removeButton($name, $stack);
146 146
             }
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
 
155 155
     public function removeAllButtonsFromStack($stack)
156 156
     {
157
-        $this->buttons = $this->buttons->reject(function ($button) use ($stack) {
157
+        $this->buttons = $this->buttons->reject(function($button) use ($stack) {
158 158
             return $button->stack == $stack;
159 159
         });
160 160
     }
161 161
 
162 162
     public function removeButtonFromStack($name, $stack)
163 163
     {
164
-        $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
164
+        $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) {
165 165
             return $button->name == $name && $button->stack == $stack;
166 166
         });
167 167
     }
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('square_brackets_to_dots')) {
3
+if (!function_exists('square_brackets_to_dots')) {
4 4
     /**
5 5
      * Turns a string from bracket-type array to dot-notation array.
6 6
      * Ex: array[0][property] turns into array.0.property.
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     }
18 18
 }
19 19
 
20
-if (! function_exists('is_countable')) {
20
+if (!function_exists('is_countable')) {
21 21
     /**
22 22
      * We need this because is_countable was only introduced in PHP 7.3,
23 23
      * and in PHP 7.2 you should check if count() argument is really countable.
Please login to merge, or discard this patch.
src/PanelTraits/AutoSet.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function setFromDb()
19 19
     {
20
-        if (! $this->driverIsMongoDb()) {
20
+        if (!$this->driverIsMongoDb()) {
21 21
             $this->setDoctrineTypesMapping();
22 22
             $this->getDbColumnTypes();
23 23
         }
24 24
 
25
-        array_map(function ($field) {
25
+        array_map(function($field) {
26 26
             $new_field = [
27 27
                 'name'       => $field,
28 28
                 'label'      => $this->makeLabel($field),
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
                 'attributes' => [],
34 34
                 'autoset'    => true,
35 35
             ];
36
-            if (! isset($this->create_fields[$field])) {
36
+            if (!isset($this->create_fields[$field])) {
37 37
                 $this->create_fields[$field] = $new_field;
38 38
             }
39
-            if (! isset($this->update_fields[$field])) {
39
+            if (!isset($this->update_fields[$field])) {
40 40
                 $this->update_fields[$field] = $new_field;
41 41
             }
42 42
 
43
-            if (! in_array($field, $this->model->getHidden()) && ! isset($this->columns[$field])) {
43
+            if (!in_array($field, $this->model->getHidden()) && !isset($this->columns[$field])) {
44 44
                 $this->addColumn([
45 45
                     'name'  => $field,
46 46
                     'label' => $this->makeLabel($field),
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      */
97 97
     public function getFieldTypeFromDbColumnType($field)
98 98
     {
99
-        if (! array_key_exists($field, $this->db_column_types)) {
99
+        if (!array_key_exists($field, $this->db_column_types)) {
100 100
             return 'text';
101 101
         }
102 102
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         $types = ['enum' => 'string'];
163 163
         $platform = \DB::getDoctrineConnection()->getDatabasePlatform();
164 164
         foreach ($types as $type_key => $type_value) {
165
-            if (! $platform->hasDoctrineTypeMappingFor($type_key)) {
165
+            if (!$platform->hasDoctrineTypeMappingFor($type_key)) {
166 166
                 $platform->registerDoctrineTypeMapping($type_key, $type_value);
167 167
             }
168 168
         }
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             // Automatically-set columns should be both in the database, and in the $fillable variable on the Eloquent Model
222 222
             $columns = $this->model->getConnection()->getSchemaBuilder()->getColumnListing($this->model->getTable());
223 223
 
224
-            if (! empty($fillable)) {
224
+            if (!empty($fillable)) {
225 225
                 $columns = array_intersect($columns, $fillable);
226 226
             }
227 227
         }
Please login to merge, or discard this patch.
src/PanelTraits/Fields.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -28,28 +28,28 @@  discard block
 block discarded – undo
28 28
 
29 29
         // if this is a relation type field and no corresponding model was specified, get it from the relation method
30 30
         // defined in the main model
31
-        if (isset($completeFieldsArray['entity']) && ! isset($completeFieldsArray['model'])) {
31
+        if (isset($completeFieldsArray['entity']) && !isset($completeFieldsArray['model'])) {
32 32
             $completeFieldsArray['model'] = $this->getRelationModel($completeFieldsArray['entity']);
33 33
         }
34 34
 
35 35
         // if the label is missing, we should set it
36
-        if (! isset($completeFieldsArray['label'])) {
36
+        if (!isset($completeFieldsArray['label'])) {
37 37
             $completeFieldsArray['label'] = mb_ucfirst(str_replace('_', ' ', $completeFieldsArray['name']));
38 38
         }
39 39
 
40 40
         // if the field type is missing, we should set it
41
-        if (! isset($completeFieldsArray['type'])) {
41
+        if (!isset($completeFieldsArray['type'])) {
42 42
             $completeFieldsArray['type'] = $this->getFieldTypeFromDbColumnType($completeFieldsArray['name']);
43 43
         }
44 44
 
45 45
         // if a tab was mentioned, we should enable it
46 46
         if (isset($completeFieldsArray['tab'])) {
47
-            if (! $this->tabsEnabled()) {
47
+            if (!$this->tabsEnabled()) {
48 48
                 $this->enableTabs();
49 49
             }
50 50
         }
51 51
 
52
-        $this->transformFields($form, function ($fields) use ($completeFieldsArray) {
52
+        $this->transformFields($form, function($fields) use ($completeFieldsArray) {
53 53
             $fields[$completeFieldsArray['name']] = $completeFieldsArray;
54 54
 
55 55
             return $fields;
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function afterField($targetFieldName, $form = 'both')
83 83
     {
84
-        $this->transformFields($form, function ($fields) use ($targetFieldName) {
84
+        $this->transformFields($form, function($fields) use ($targetFieldName) {
85 85
             return $this->moveField($fields, $targetFieldName, false);
86 86
         });
87 87
     }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function beforeField($targetFieldName, $form = 'both')
96 96
     {
97
-        $this->transformFields($form, function ($fields) use ($targetFieldName) {
97
+        $this->transformFields($form, function($fields) use ($targetFieldName) {
98 98
             return $this->moveField($fields, $targetFieldName, true);
99 99
         });
100 100
     }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      */
138 138
     public function removeField($name, $form = 'both')
139 139
     {
140
-        $this->transformFields($form, function ($fields) use ($name) {
140
+        $this->transformFields($form, function($fields) use ($name) {
141 141
             array_forget($fields, $name);
142 142
 
143 143
             return $fields;
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      */
153 153
     public function removeFields($array_of_names, $form = 'both')
154 154
     {
155
-        if (! empty($array_of_names)) {
155
+        if (!empty($array_of_names)) {
156 156
             foreach ($array_of_names as $name) {
157 157
                 $this->removeField($name, $form);
158 158
             }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     public function removeAllFields($form = 'both')
168 168
     {
169 169
         $current_fields = $this->getCurrentFields();
170
-        if (! empty($current_fields)) {
170
+        if (!empty($current_fields)) {
171 171
             foreach ($current_fields as $field) {
172 172
                 $this->removeField($field['name'], $form);
173 173
             }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
                 $jsonCastables = ['array', 'object', 'json'];
258 258
                 $fieldCasting = $casted_attributes[$field['name']];
259 259
 
260
-                if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && ! empty($data[$field['name']]) && ! is_array($data[$field['name']])) {
260
+                if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && !empty($data[$field['name']]) && !is_array($data[$field['name']])) {
261 261
                     try {
262 262
                         $data[$field['name']] = json_decode($data[$field['name']]);
263 263
                     } catch (\Exception $e) {
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
      */
292 292
     public function orderFields($order, $form = 'both')
293 293
     {
294
-        $this->transformFields($form, function ($fields) use ($order) {
294
+        $this->transformFields($form, function($fields) use ($order) {
295 295
             return $this->applyOrderToFields($fields, $order);
296 296
         });
297 297
     }
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
         $alreadyLoaded = $this->loadedFieldTypes;
420 420
         $type = $this->getFieldTypeWithNamespace($field);
421 421
 
422
-        if (! in_array($type, $this->getLoadedFieldTypes(), true)) {
422
+        if (!in_array($type, $this->getLoadedFieldTypes(), true)) {
423 423
             $alreadyLoaded[] = $type;
424 424
             $this->loadedFieldTypes = $alreadyLoaded;
425 425
 
@@ -460,6 +460,6 @@  discard block
 block discarded – undo
460 460
      */
461 461
     public function fieldTypeNotLoaded($field)
462 462
     {
463
-        return ! in_array($this->getFieldTypeWithNamespace($field), $this->getLoadedFieldTypes());
463
+        return !in_array($this->getFieldTypeWithNamespace($field), $this->getLoadedFieldTypes());
464 464
     }
465 465
 }
Please login to merge, or discard this patch.
src/resources/views/reorder.blade.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,10 +68,10 @@
 block discarded – undo
68 68
             <ol class="sortable mt-0">
69 69
             <?php
70 70
                 $all_entries = collect($entries->all())->sortBy('lft')->keyBy($crud->getModel()->getKeyName());
71
-                $root_entries = $all_entries->filter(function ($item) {
71
+                $root_entries = $all_entries->filter(function($item) {
72 72
                     return $item->parent_id == 0;
73 73
                 });
74
-                foreach ($root_entries as $key => $entry){
74
+                foreach ($root_entries as $key => $entry) {
75 75
                     $root_entries[$key] = tree_element($entry, $key, $all_entries, $crud);
76 76
                 }
77 77
             ?>
Please login to merge, or discard this patch.
src/resources/views/fields/datetime.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 <?php
4 4
 // if the column has been cast to Carbon or Date (using attribute casting)
5 5
 // get the value as a date string
6
-if (isset($field['value']) && ( $field['value'] instanceof \Carbon\CarbonInterface )) {
6
+if (isset($field['value']) && ($field['value'] instanceof \Carbon\CarbonInterface)) {
7 7
     $field['value'] = $field['value']->toDateTimeString();
8 8
 }
9 9
 ?>
Please login to merge, or discard this patch.
src/resources/views/fields/date_picker.blade.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@
 block discarded – undo
3 3
 <?php
4 4
     // if the column has been cast to Carbon or Date (using attribute casting)
5 5
     // get the value as a date string
6
-    if (isset($field['value']) && ( $field['value'] instanceof \Carbon\CarbonInterface )) {
6
+    if (isset($field['value']) && ($field['value'] instanceof \Carbon\CarbonInterface)) {
7 7
         $field['value'] = $field['value']->format('Y-m-d');
8 8
     }
9 9
 
10
-    $field_language = isset($field['date_picker_options']['language'])?$field['date_picker_options']['language']:\App::getLocale();
10
+    $field_language = isset($field['date_picker_options']['language']) ? $field['date_picker_options']['language'] : \App::getLocale();
11 11
 
12 12
     if (!isset($field['attributes']['style'])) {
13 13
         $field['attributes']['style'] = 'background-color: white!important;';
Please login to merge, or discard this patch.
src/resources/views/fields/date.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 <?php
4 4
 // if the column has been cast to Carbon or Date (using attribute casting)
5 5
 // get the value as a date string
6
-if (isset($field['value']) && ( $field['value'] instanceof \Carbon\CarbonInterface )) {
6
+if (isset($field['value']) && ($field['value'] instanceof \Carbon\CarbonInterface)) {
7 7
     $field['value'] = $field['value']->toDateString();
8 8
 }
9 9
 ?>
Please login to merge, or discard this patch.