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 (#1026)
by Guilherme
04:42
created
src/PanelTraits/Tabs.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
     public function tabsDisabled()
31 31
     {
32
-        return ! $this->tabsEnabled;
32
+        return !$this->tabsEnabled;
33 33
     }
34 34
 
35 35
     public function setTabsType($type)
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
         if ($this->tabExists($label)) {
93 93
             $all_fields = $this->getCurrentFields();
94 94
 
95
-            $fields_for_current_tab = collect($all_fields)->filter(function ($value, $key) use ($label) {
95
+            $fields_for_current_tab = collect($all_fields)->filter(function($value, $key) use ($label) {
96 96
                 return isset($value['tab']) && $value['tab'] == $label;
97 97
             });
98 98
 
99 99
             if ($this->isLastTab($label)) {
100
-                $fields_without_a_tab = collect($all_fields)->filter(function ($value, $key) {
101
-                    return ! isset($value['tab']);
100
+                $fields_without_a_tab = collect($all_fields)->filter(function($value, $key) {
101
+                    return !isset($value['tab']);
102 102
                 });
103 103
 
104 104
                 $fields_for_current_tab = $fields_for_current_tab->merge($fields_without_a_tab);
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
         $fields = $this->getCurrentFields();
117 117
 
118 118
         $fields_with_tabs = collect($fields)
119
-            ->filter(function ($value, $key) {
119
+            ->filter(function($value, $key) {
120 120
                 return isset($value['tab']);
121 121
             })
122
-            ->each(function ($value, $key) use (&$tabs) {
123
-                if (! in_array($value['tab'], $tabs)) {
122
+            ->each(function($value, $key) use (&$tabs) {
123
+                if (!in_array($value['tab'], $tabs)) {
124 124
                     $tabs[] = $value['tab'];
125 125
                 }
126 126
             });
Please login to merge, or discard this patch.
src/PanelTraits/Read.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
      */
20 20
     public function getEntry($id)
21 21
     {
22
-        if (! $this->entry) {
22
+        if (!$this->entry) {
23 23
             $this->entry = $this->model->findOrFail($id);
24 24
             $this->entry = $this->entry->withFakes();
25 25
         }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     public function hasUploadFields($form, $id = false)
95 95
     {
96 96
         $fields = $this->getFields($form, $id);
97
-        $upload_fields = array_where($fields, function ($value, $key) {
97
+        $upload_fields = array_where($fields, function($value, $key) {
98 98
             return isset($value['upload']) && $value['upload'] == true;
99 99
         });
100 100
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      */
193 193
     public function getCellView($column, $entry)
194 194
     {
195
-        if (! isset($column['type'])) {
195
+        if (!isset($column['type'])) {
196 196
             return \View::make('crud::columns.text')->with('crud', $this)->with('column', $column)->with('entry', $entry)->render();
197 197
         } else {
198 198
             if (view()->exists('vendor.backpack.crud.columns.'.$column['type'])) {
Please login to merge, or discard this patch.
src/resources/views/fields/date_range.blade.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,15 +3,15 @@
 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($entry) && ($entry->{$field['start_name']} instanceof \Carbon\Carbon || $entry->{$field['start_name']} instanceof \Jenssegers\Date\Date) ) {
7
-        $start_name = $entry->{$field['start_name']}->format( 'Y-m-d H:i:s' );
6
+    if (isset($entry) && ($entry->{$field['start_name']} instanceof \Carbon\Carbon || $entry->{$field['start_name']} instanceof \Jenssegers\Date\Date)) {
7
+        $start_name = $entry->{$field['start_name']}->format('Y-m-d H:i:s');
8 8
     } else {
9 9
         $start_name = null;
10 10
     }
11 11
 
12 12
     //Do the same as the above but for the range end field
13
-    if ( isset($entry) && ($entry->{$field['end_name']} instanceof \Carbon\Carbon || $entry->{$field['end_name']} instanceof \Jenssegers\Date\Date) ) {
14
-        $end_name = $entry->{$field['end_name']}->format( 'Y-m-d H:i:s' );
13
+    if (isset($entry) && ($entry->{$field['end_name']} instanceof \Carbon\Carbon || $entry->{$field['end_name']} instanceof \Jenssegers\Date\Date)) {
14
+        $end_name = $entry->{$field['end_name']}->format('Y-m-d H:i:s');
15 15
     } else {
16 16
         $end_name = null;
17 17
     }
Please login to merge, or discard this patch.
src/CrudPanel.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function setModel($model_namespace)
86 86
     {
87
-        if (! class_exists($model_namespace)) {
87
+        if (!class_exists($model_namespace)) {
88 88
             throw new \Exception('This model does not exist.', 404);
89 89
         }
90 90
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     {
126 126
         $complete_route = $route.'.index';
127 127
 
128
-        if (! \Route::has($complete_route)) {
128
+        if (!\Route::has($complete_route)) {
129 129
             throw new \Exception('There are no routes for this route name.', 404);
130 130
         }
131 131
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
      */
176 176
     public function getFirstOfItsTypeInArray($type, $array)
177 177
     {
178
-        return array_first($array, function ($item) use ($type) {
178
+        return array_first($array, function($item) use ($type) {
179 179
             return $item['type'] == $type;
180 180
         });
181 181
     }
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
 
193 193
     public function sync($type, $fields, $attributes)
194 194
     {
195
-        if (! empty($this->{$type})) {
196
-            $this->{$type} = array_map(function ($field) use ($fields, $attributes) {
195
+        if (!empty($this->{$type})) {
196
+            $this->{$type} = array_map(function($field) use ($fields, $attributes) {
197 197
                 if (in_array($field['name'], (array) $fields)) {
198 198
                     $field = array_merge($field, $attributes);
199 199
                 }
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
                 }
220 220
             }
221 221
 
222
-            return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function ($item) use ($items) {
223
-                return ! in_array($item['name'], $this->sort[$items]);
222
+            return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function($item) use ($items) {
223
+                return !in_array($item['name'], $this->sort[$items]);
224 224
             }));
225 225
         }
226 226
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
      */
244 244
     private function getRelationModel($relationString)
245 245
     {
246
-        $result = array_reduce(explode('.', $relationString), function ($obj, $method) {
246
+        $result = array_reduce(explode('.', $relationString), function($obj, $method) {
247 247
             return $obj->$method()->getRelated();
248 248
         }, $this->model);
249 249
 
Please login to merge, or discard this patch.
src/PanelTraits/Fields.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,23 +25,23 @@  discard block
 block discarded – undo
25 25
 
26 26
         // if this is a relation type field and no corresponding model was specified, get it from the relation method
27 27
         // defined in the main model
28
-        if (isset($complete_field_array['entity']) && ! isset($complete_field_array['model'])) {
28
+        if (isset($complete_field_array['entity']) && !isset($complete_field_array['model'])) {
29 29
             $complete_field_array['model'] = $this->getRelationModel($complete_field_array['entity']);
30 30
         }
31 31
 
32 32
         // if the label is missing, we should set it
33
-        if (! isset($complete_field_array['label'])) {
33
+        if (!isset($complete_field_array['label'])) {
34 34
             $complete_field_array['label'] = ucfirst($complete_field_array['name']);
35 35
         }
36 36
 
37 37
         // if the field type is missing, we should set it
38
-        if (! isset($complete_field_array['type'])) {
38
+        if (!isset($complete_field_array['type'])) {
39 39
             $complete_field_array['type'] = $this->getFieldTypeFromDbColumnType($complete_field_array['name']);
40 40
         }
41 41
 
42 42
         // if a tab was mentioned, we should enable it
43 43
         if (isset($complete_field_array['tab'])) {
44
-            if (! $this->tabsEnabled()) {
44
+            if (!$this->tabsEnabled()) {
45 45
                 $this->enableTabs();
46 46
             }
47 47
         }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public function removeFields($array_of_names, $form = 'both')
156 156
     {
157
-        if (! empty($array_of_names)) {
157
+        if (!empty($array_of_names)) {
158 158
             foreach ($array_of_names as $name) {
159 159
                 $this->removeField($name, $form);
160 160
             }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
                 $jsonCastables = ['array', 'object', 'json'];
219 219
                 $fieldCasting = $casted_attributes[$field['name']];
220 220
 
221
-                if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && ! empty($data[$field['name']]) && ! is_array($data[$field['name']])) {
221
+                if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && !empty($data[$field['name']]) && !is_array($data[$field['name']])) {
222 222
                     try {
223 223
                         $data[$field['name']] = json_decode($data[$field['name']]);
224 224
                     } catch (Exception $e) {
Please login to merge, or discard this patch.
src/app/Http/Controllers/CrudFeatures/AjaxTable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
         // create an array with the names of the searchable columns
16 16
         $columns = collect($this->crud->columns)
17
-                    ->reject(function ($column, $key) {
17
+                    ->reject(function($column, $key) {
18 18
                         // the select_multiple, model_function and model_function_attribute columns are not searchable
19 19
                         return isset($column['type']) && ($column['type'] == 'select_multiple' || $column['type'] == 'model_function' || $column['type'] == 'model_function_attribute');
20 20
                     })
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         $dataTable = new \LiveControl\EloquentDataTable\DataTable($this->crud->query, $columns);
30 30
 
31 31
         // make the datatable use the column types instead of just echoing the text
32
-        $dataTable->setFormatRowFunction(function ($entry) {
32
+        $dataTable->setFormatRowFunction(function($entry) {
33 33
             // get the actual HTML for each row's cell
34 34
             $row_items = $this->crud->getRowViews($entry, $this->crud);
35 35
 
Please login to merge, or discard this patch.
src/PanelTraits/FakeColumns.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,19 +24,19 @@
 block discarded – undo
24 24
             if (isset($field['fake']) && $field['fake'] == true) {
25 25
                 // add it to the request in its appropriate variable - the one defined, if defined
26 26
                 if (isset($field['store_in'])) {
27
-                    if (! in_array($field['store_in'], $fakeFieldsColumnsArray, true)) {
27
+                    if (!in_array($field['store_in'], $fakeFieldsColumnsArray, true)) {
28 28
                         array_push($fakeFieldsColumnsArray, $field['store_in']);
29 29
                     }
30 30
                 } else {
31 31
                     //otherwise in the one defined in the $crud variable
32
-                    if (! in_array('extras', $fakeFieldsColumnsArray, true)) {
32
+                    if (!in_array('extras', $fakeFieldsColumnsArray, true)) {
33 33
                         array_push($fakeFieldsColumnsArray, 'extras');
34 34
                     }
35 35
                 }
36 36
             }
37 37
         }
38 38
 
39
-        if (! count($fakeFieldsColumnsArray)) {
39
+        if (!count($fakeFieldsColumnsArray)) {
40 40
             $fakeFieldsColumnsArray = ['extras'];
41 41
         }
42 42
 
Please login to merge, or discard this patch.
src/PanelTraits/FakeFields.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                 $fakeFieldKey = isset($field['store_in']) ? $field['store_in'] : 'extras';
30 30
                 $this->addCompactedField($requestInput, $field['name'], $fakeFieldKey);
31 31
 
32
-                if (! in_array($fakeFieldKey, $compactedFakeFields)) {
32
+                if (!in_array($fakeFieldKey, $compactedFakeFields)) {
33 33
                     $compactedFakeFields[] = $fakeFieldKey;
34 34
                 }
35 35
             }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
         // json_encode all fake_value columns in the database, so they can be properly stored and interpreted
39 39
         foreach ($compactedFakeFields as $value) {
40
-            if (! (property_exists($this->model, 'translatable') && in_array($value, $this->model->getTranslatableAttributes(), true))) {
40
+            if (!(property_exists($this->model, 'translatable') && in_array($value, $this->model->getTranslatableAttributes(), true))) {
41 41
                 $requestInput[$value] = json_encode($requestInput[$value]);
42 42
             }
43 43
         }
Please login to merge, or discard this patch.
src/PanelTraits/Buttons.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function removeButton($name, $stack = null)
96 96
     {
97
-        $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
97
+        $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) {
98 98
             return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name);
99 99
         });
100 100
     }
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
 
107 107
     public function removeAllButtonsFromStack($stack)
108 108
     {
109
-        $this->buttons = $this->buttons->reject(function ($button) use ($stack) {
109
+        $this->buttons = $this->buttons->reject(function($button) use ($stack) {
110 110
             return $button->stack == $stack;
111 111
         });
112 112
     }
113 113
 
114 114
     public function removeButtonFromStack($name, $stack)
115 115
     {
116
-        $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
116
+        $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) {
117 117
             return $button->name == $name && $button->stack == $stack;
118 118
         });
119 119
     }
Please login to merge, or discard this patch.