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 (#1116)
by Oliver
04:14
created
config/database/migrations/2017_09_06_000001_create_column_types_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
         // uncomment the next statement to map strings to enum types in doctrine and get over the 'Unknown database type enum' DBAL error
16 16
         // Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
17 17
 
18
-        Schema::create('column_types', function ($table) {
18
+        Schema::create('column_types', function($table) {
19 19
             $table->bigInteger('bigIntegerCol');
20 20
             $table->binary('binaryCol');
21 21
             $table->boolean('booleanCol');
Please login to merge, or discard this patch.
tests/Unit/CrudPanel/CrudPanelButtonsTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -217,7 +217,7 @@
 block discarded – undo
217 217
 
218 218
     private function getButtonByName($name)
219 219
     {
220
-        return $this->crudPanel->buttons->first(function ($value) use ($name) {
220
+        return $this->crudPanel->buttons->first(function($value) use ($name) {
221 221
             return $value->name == $name;
222 222
         });
223 223
     }
Please login to merge, or discard this patch.
src/resources/views/columns/select_from_array.blade.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 {{-- select_from_array column --}}
2 2
 <td>
3 3
 	<?php
4
-		if ($entry->{$column['name']} !== null) {
5
-	    	echo $column['options'][$entry->{$column['name']}];
6
-	    } else {
7
-	    	echo "-";
8
-	    }
9
-	?>
4
+        if ($entry->{$column['name']} !== null) {
5
+            echo $column['options'][$entry->{$column['name']}];
6
+        } else {
7
+            echo "-";
8
+        }
9
+    ?>
10 10
 </td>
Please login to merge, or discard this patch.
src/PanelTraits/Columns.php 2 patches
Doc Comments   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     /**
95 95
      * Move the most recently added column after the given target column.
96 96
      *
97
-     * @param string|array $targetColumn The target column name or array.
97
+     * @param string $targetColumn The target column name or array.
98 98
      */
99 99
     public function afterColumn($targetColumn)
100 100
     {
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     /**
105 105
      * Move the most recently added column before the given target column.
106 106
      *
107
-     * @param string|array $targetColumn The target column name or array.
107
+     * @param string $targetColumn The target column name or array.
108 108
      */
109 109
     public function beforeColumn($targetColumn)
110 110
     {
@@ -227,6 +227,7 @@  discard block
 block discarded – undo
227 227
      *
228 228
      * @param [string] Column name.
229 229
      * @param [attributes and values array]
230
+     * @param string $column
230 231
      */
231 232
     public function setColumnDetails($column, $attributes)
232 233
     {
Please login to merge, or discard this patch.
Spacing   +11 added lines, -12 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     public function addColumn($column)
65 65
     {
66 66
         // if a string was passed, not an array, change it to an array
67
-        if (! is_array($column)) {
67
+        if (!is_array($column)) {
68 68
             $column = ['name' => $column];
69 69
         }
70 70
 
@@ -72,17 +72,17 @@  discard block
 block discarded – undo
72 72
         $column_with_details = $this->addDefaultLabel($column);
73 73
 
74 74
         // make sure the column has a name
75
-        if (! array_key_exists('name', $column_with_details)) {
75
+        if (!array_key_exists('name', $column_with_details)) {
76 76
             $column_with_details['name'] = 'anonymous_column_'.str_random(5);
77 77
         }
78 78
 
79 79
         // make sure the column has a type
80
-        if (! array_key_exists('type', $column_with_details)) {
80
+        if (!array_key_exists('type', $column_with_details)) {
81 81
             $column_with_details['type'] = 'text';
82 82
         }
83 83
 
84 84
         // make sure the column has a key
85
-        if (! array_key_exists('key', $column_with_details)) {
85
+        if (!array_key_exists('key', $column_with_details)) {
86 86
             $column_with_details['key'] = $column_with_details['name'];
87 87
         }
88 88
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
         // if this is a relation type field and no corresponding model was specified, get it from the relation method
101 101
         // defined in the main model
102
-        if (isset($column_with_details['entity']) && ! isset($column_with_details['model'])) {
102
+        if (isset($column_with_details['entity']) && !isset($column_with_details['model'])) {
103 103
             $column_with_details['model'] = $this->getRelationModel($column_with_details['entity']);
104 104
         }
105 105
 
@@ -153,8 +153,7 @@  discard block
 block discarded – undo
153 153
         $targetColumnName = is_array($targetColumn) ? $targetColumn['name'] : $targetColumn;
154 154
 
155 155
         if (array_key_exists($targetColumnName, $this->columns)) {
156
-            $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) :
157
-                array_search($targetColumnName, array_keys($this->columns)) + 1;
156
+            $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : array_search($targetColumnName, array_keys($this->columns)) + 1;
158 157
 
159 158
             $element = array_pop($this->columns);
160 159
             $beginningPart = array_slice($this->columns, 0, $targetColumnPosition, true);
@@ -188,7 +187,7 @@  discard block
 block discarded – undo
188 187
      */
189 188
     public function addDefaultLabel($array)
190 189
     {
191
-        if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
190
+        if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) {
192 191
             $array = array_merge(['label' => ucfirst($this->makeLabel($array['name']))], $array);
193 192
 
194 193
             return $array;
@@ -214,7 +213,7 @@  discard block
 block discarded – undo
214 213
      */
215 214
     public function removeColumns($columns)
216 215
     {
217
-        if (! empty($columns)) {
216
+        if (!empty($columns)) {
218 217
             foreach ($columns as $columnName) {
219 218
                 $this->removeColumn($columnName);
220 219
             }
@@ -235,8 +234,8 @@  discard block
 block discarded – undo
235 234
      */
236 235
     public function remove($entity, $fields)
237 236
     {
238
-        return array_values(array_filter($this->{$entity}, function ($field) use ($fields) {
239
-            return ! in_array($field['name'], (array) $fields);
237
+        return array_values(array_filter($this->{$entity}, function($field) use ($fields) {
238
+            return !in_array($field['name'], (array) $fields);
240 239
         }));
241 240
     }
242 241
 
@@ -281,7 +280,7 @@  discard block
 block discarded – undo
281 280
     {
282 281
         $columns = $this->getColumns();
283 282
 
284
-        return collect($columns)->pluck('entity')->reject(function ($value, $key) {
283
+        return collect($columns)->pluck('entity')->reject(function($value, $key) {
285 284
             return $value == null;
286 285
         })->toArray();
287 286
     }
Please login to merge, or discard this patch.
src/PanelTraits/Read.php 2 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -89,6 +89,7 @@  discard block
 block discarded – undo
89 89
      * Upload fields are the ones that have "upload" => true defined on them.
90 90
      * @param  [form] create / update / both - defaults to 'both'
91 91
      * @param  [id] id of the entity - defaults to false
92
+     * @param string $form
92 93
      * @return bool
93 94
      */
94 95
     public function hasUploadFields($form, $id = false)
@@ -122,6 +123,7 @@  discard block
 block discarded – undo
122 123
 
123 124
     /**
124 125
      * Set the number of rows that should be show on the table page (list view).
126
+     * @param integer $value
125 127
      */
126 128
     public function setDefaultPageLength($value)
127 129
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 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
 
Please login to merge, or discard this patch.
src/PanelTraits/Fields.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -26,28 +26,28 @@  discard block
 block discarded – undo
26 26
 
27 27
         // if this is a relation type field and no corresponding model was specified, get it from the relation method
28 28
         // defined in the main model
29
-        if (isset($completeFieldsArray['entity']) && ! isset($completeFieldsArray['model'])) {
29
+        if (isset($completeFieldsArray['entity']) && !isset($completeFieldsArray['model'])) {
30 30
             $completeFieldsArray['model'] = $this->getRelationModel($completeFieldsArray['entity']);
31 31
         }
32 32
 
33 33
         // if the label is missing, we should set it
34
-        if (! isset($completeFieldsArray['label'])) {
34
+        if (!isset($completeFieldsArray['label'])) {
35 35
             $completeFieldsArray['label'] = ucfirst($completeFieldsArray['name']);
36 36
         }
37 37
 
38 38
         // if the field type is missing, we should set it
39
-        if (! isset($completeFieldsArray['type'])) {
39
+        if (!isset($completeFieldsArray['type'])) {
40 40
             $completeFieldsArray['type'] = $this->getFieldTypeFromDbColumnType($completeFieldsArray['name']);
41 41
         }
42 42
 
43 43
         // if a tab was mentioned, we should enable it
44 44
         if (isset($completeFieldsArray['tab'])) {
45
-            if (! $this->tabsEnabled()) {
45
+            if (!$this->tabsEnabled()) {
46 46
                 $this->enableTabs();
47 47
             }
48 48
         }
49 49
 
50
-        $this->transformFields($form, function ($fields) use ($completeFieldsArray) {
50
+        $this->transformFields($form, function($fields) use ($completeFieldsArray) {
51 51
             $fields[$completeFieldsArray['name']] = $completeFieldsArray;
52 52
 
53 53
             return $fields;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function afterField($targetFieldName, $form = 'both')
81 81
     {
82
-        $this->transformFields($form, function ($fields) use ($targetFieldName) {
82
+        $this->transformFields($form, function($fields) use ($targetFieldName) {
83 83
             return $this->moveField($fields, $targetFieldName, false);
84 84
         });
85 85
     }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function beforeField($targetFieldName, $form = 'both')
94 94
     {
95
-        $this->transformFields($form, function ($fields) use ($targetFieldName) {
95
+        $this->transformFields($form, function($fields) use ($targetFieldName) {
96 96
             return $this->moveField($fields, $targetFieldName, true);
97 97
         });
98 98
     }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      */
135 135
     public function removeField($name, $form = 'both')
136 136
     {
137
-        $this->transformFields($form, function ($fields) use ($name) {
137
+        $this->transformFields($form, function($fields) use ($name) {
138 138
             array_forget($fields, $name);
139 139
 
140 140
             return $fields;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function removeFields($array_of_names, $form = 'both')
151 151
     {
152
-        if (! empty($array_of_names)) {
152
+        if (!empty($array_of_names)) {
153 153
             foreach ($array_of_names as $name) {
154 154
                 $this->removeField($name, $form);
155 155
             }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                 $jsonCastables = ['array', 'object', 'json'];
213 213
                 $fieldCasting = $casted_attributes[$field['name']];
214 214
 
215
-                if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && ! empty($data[$field['name']]) && ! is_array($data[$field['name']])) {
215
+                if (in_array($fieldCasting, $jsonCastables) && isset($data[$field['name']]) && !empty($data[$field['name']]) && !is_array($data[$field['name']])) {
216 216
                     try {
217 217
                         $data[$field['name']] = json_decode($data[$field['name']]);
218 218
                     } catch (\Exception $e) {
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
      */
244 244
     public function orderFields($order, $form = 'both')
245 245
     {
246
-        $this->transformFields($form, function ($fields) use ($order) {
246
+        $this->transformFields($form, function($fields) use ($order) {
247 247
             return $this->applyOrderToFields($fields, $order);
248 248
         });
249 249
     }
Please login to merge, or discard this patch.
src/PanelTraits/Search.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -116,9 +116,9 @@
 block discarded – undo
116 116
         // add the details_row buttons as the first column
117 117
         if ($this->details_row) {
118 118
             array_unshift($row_items, \View::make('crud::columns.details_row_button')
119
-                                           ->with('crud', $this)
120
-                                           ->with('entry', $entry)
121
-                                           ->render());
119
+                                            ->with('crud', $this)
120
+                                            ->with('entry', $entry)
121
+                                            ->render());
122 122
         }
123 123
 
124 124
         return $row_items;
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;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     public function getCellView($column, $entry)
134 134
     {
135 135
         // if column type not set, show as text
136
-        if (! isset($column['type'])) {
136
+        if (!isset($column['type'])) {
137 137
             return \View::make('crud::columns.text')
138 138
                             ->with('crud', $this)
139 139
                             ->with('column', $column)
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 if applicable 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)) && $this->model->shouldEncodeFake($value)) {
40
+            if (!(property_exists($this->model, 'translatable') && in_array($value, $this->model->getTranslatableAttributes(), true)) && $this->model->shouldEncodeFake($value)) {
41 41
                 $requestInput[$value] = json_encode($requestInput[$value]);
42 42
             }
43 43
         }
Please login to merge, or discard this patch.