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 (#334)
by Owen
02:38
created
src/resources/views/columns/model_function.blade.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 {{-- custom return value --}}
2 2
 <td>
3 3
 	<?php
4
-	    echo $entry->{$column['function_name']}();
4
+        echo $entry->{$column['function_name']}();
5 5
     ?>
6 6
 </td>
7 7
\ No newline at end of file
Please login to merge, or discard this patch.
src/PanelTraits/AutoSet.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     {
17 17
         $this->getDbColumnTypes();
18 18
 
19
-        array_map(function ($field) {
19
+        array_map(function($field) {
20 20
             // $this->labels[$field] = $this->makeLabel($field);
21 21
 
22 22
             $new_field = [
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
             $this->create_fields[$field] = $new_field;
31 31
             $this->update_fields[$field] = $new_field;
32 32
 
33
-            if (! in_array($field, $this->model->getHidden())) {
33
+            if (!in_array($field, $this->model->getHidden())) {
34 34
                 $this->columns[$field] = [
35 35
                     'name'  => $field,
36 36
                     'label' => ucfirst($field),
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function getFieldTypeFromDbColumnType($field)
65 65
     {
66
-        if (! array_key_exists($field, $this->db_column_types)) {
66
+        if (!array_key_exists($field, $this->db_column_types)) {
67 67
             return 'text';
68 68
         }
69 69
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         $columns = \Schema::getColumnListing($this->model->getTable());
145 145
         $fillable = $this->model->getFillable();
146 146
 
147
-        if (! empty($fillable)) {
147
+        if (!empty($fillable)) {
148 148
             $columns = array_intersect($columns, $fillable);
149 149
         }
150 150
 
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
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 <?php
5 5
     // if the column has been cast to Carbon or Date (using attribute casting)
6 6
     // get the value as a date string
7
-    if (isset($field['value']) && ( $field['value'] instanceof \Carbon\Carbon || $field['value'] instanceof \Jenssegers\Date\Date ))
7
+    if (isset($field['value']) && ($field['value'] instanceof \Carbon\Carbon || $field['value'] instanceof \Jenssegers\Date\Date))
8 8
     {
9 9
         $field['value'] = $field['value']->toDateString();
10 10
     }
Please login to merge, or discard this patch.
src/PanelTraits/Buttons.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -95,6 +95,12 @@
 block discarded – undo
95 95
     public $type = 'view';
96 96
     public $content;
97 97
 
98
+    /**
99
+     * @param string $stack
100
+     * @param string $name
101
+     * @param string $type
102
+     * @param string $content
103
+     */
98 104
     public function __construct($stack, $name, $type, $content)
99 105
     {
100 106
         $this->stack = $stack;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
     public function removeButton($name)
79 79
     {
80
-        $this->buttons = $this->buttons->reject(function ($button) use ($name) {
80
+        $this->buttons = $this->buttons->reject(function($button) use ($name) {
81 81
             return $button->name == $name;
82 82
         });
83 83
     }
@@ -89,14 +89,14 @@  discard block
 block discarded – undo
89 89
 
90 90
     public function removeAllButtonsFromStack($stack)
91 91
     {
92
-        $this->buttons = $this->buttons->reject(function ($button) use ($stack) {
92
+        $this->buttons = $this->buttons->reject(function($button) use ($stack) {
93 93
             return $button->stack == $stack;
94 94
         });
95 95
     }
96 96
 
97 97
     public function removeButtonFromStack($name, $stack)
98 98
     {
99
-        $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
99
+        $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) {
100 100
             return $button->name == $name && $button->stack == $stack;
101 101
         });
102 102
     }
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
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 <?php
5 5
     // if the column has been cast to Carbon or Date (using attribute casting)
6 6
     // get the value as a date string
7
-    if (isset($field['value']) && ( $field['value'] instanceof \Carbon\Carbon || $field['value'] instanceof \Jenssegers\Date\Date ))
7
+    if (isset($field['value']) && ($field['value'] instanceof \Carbon\Carbon || $field['value'] instanceof \Jenssegers\Date\Date))
8 8
     {
9 9
         $field['value'] = $field['value']->toDateString();
10 10
     }
Please login to merge, or discard this patch.
src/resources/views/reorder.blade.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -20,42 +20,42 @@  discard block
 block discarded – undo
20 20
 
21 21
 @section('content')
22 22
 <?php
23
-  function tree_element($entry, $key, $all_entries, $crud)
24
-  {
23
+    function tree_element($entry, $key, $all_entries, $crud)
24
+    {
25 25
     if (!isset($entry->tree_element_shown)) {
26
-      // mark the element as shown
27
-      $all_entries[$key]->tree_element_shown = true;
28
-      $entry->tree_element_shown = true;
26
+        // mark the element as shown
27
+        $all_entries[$key]->tree_element_shown = true;
28
+        $entry->tree_element_shown = true;
29 29
 
30
-      // show the tree element
31
-      echo '<li id="list_'.$entry->getKey().'">';
32
-      echo '<div><span class="disclose"><span></span></span>'.$entry->{$crud->reorder_label}.'</div>';
30
+        // show the tree element
31
+        echo '<li id="list_'.$entry->getKey().'">';
32
+        echo '<div><span class="disclose"><span></span></span>'.$entry->{$crud->reorder_label}.'</div>';
33 33
 
34
-      // see if this element has any children
35
-      $children = [];
36
-      foreach ($all_entries as $key => $subentry) {
34
+        // see if this element has any children
35
+        $children = [];
36
+        foreach ($all_entries as $key => $subentry) {
37 37
         if ($subentry->parent_id == $entry->getKey()) {
38
-          $children[] = $subentry;
38
+            $children[] = $subentry;
39
+        }
39 40
         }
40
-      }
41 41
 
42
-      $children = collect($children)->sortBy('lft');
42
+        $children = collect($children)->sortBy('lft');
43 43
 
44
-      // if it does have children, show them
45
-      if (count($children)) {
44
+        // if it does have children, show them
45
+        if (count($children)) {
46 46
         echo '<ol>';
47 47
         foreach ($children as $key => $child) {
48
-          $children[$key] = tree_element($child, $child->getKey(), $all_entries, $crud);
48
+            $children[$key] = tree_element($child, $child->getKey(), $all_entries, $crud);
49 49
         }
50 50
         echo '</ol>';
51
-      }
52
-      echo '</li>';
51
+        }
52
+        echo '</li>';
53 53
     }
54 54
 
55 55
     return $entry;
56
-  }
56
+    }
57 57
 
58
- ?>
58
+    ?>
59 59
 <div class="row">
60 60
   <div class="col-md-8 col-md-offset-2">
61 61
     @if ($crud->hasAccess('list'))
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
 
74 74
           <ol class="sortable">
75 75
             <?php
76
-              $all_entries = collect($entries->all())->sortBy('lft')->keyBy($crud->getModel()->getKeyName());
77
-              $root_entries = $all_entries->filter(function($item) {
76
+                $all_entries = collect($entries->all())->sortBy('lft')->keyBy($crud->getModel()->getKeyName());
77
+                $root_entries = $all_entries->filter(function($item) {
78 78
                 return $item->parent_id == 0;
79
-              });
80
-             ?>
79
+                });
80
+                ?>
81 81
             @foreach ($root_entries as $key => $entry)
82 82
               <?php
83 83
                 $root_entries[$key] = tree_element($entry, $key, $all_entries, $crud);
84
-              ?>
84
+                ?>
85 85
             @endforeach
86 86
           </ol>
87 87
 
Please login to merge, or discard this patch.
src/CrudPanel.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function setModel($model_namespace)
72 72
     {
73
-        if (! class_exists($model_namespace)) {
73
+        if (!class_exists($model_namespace)) {
74 74
             throw new \Exception('This model does not exist.', 404);
75 75
         }
76 76
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     {
113 113
         $complete_route = $route.'.index';
114 114
 
115
-        if (! \Route::has($complete_route)) {
115
+        if (!\Route::has($complete_route)) {
116 116
             throw new \Exception('There are no routes for this route name.', 404);
117 117
         }
118 118
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     public function getFirstOfItsTypeInArray($type, $array)
164 164
     {
165
-        return array_first($array, function ($item) use ($type) {
165
+        return array_first($array, function($item) use ($type) {
166 166
             return $item['type'] == $type;
167 167
         });
168 168
     }
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
 
180 180
     public function sync($type, $fields, $attributes)
181 181
     {
182
-        if (! empty($this->{$type})) {
183
-            $this->{$type} = array_map(function ($field) use ($fields, $attributes) {
182
+        if (!empty($this->{$type})) {
183
+            $this->{$type} = array_map(function($field) use ($fields, $attributes) {
184 184
                 if (in_array($field['name'], (array) $fields)) {
185 185
                     $field = array_merge($field, $attributes);
186 186
                 }
@@ -206,8 +206,8 @@  discard block
 block discarded – undo
206 206
                 }
207 207
             }
208 208
 
209
-            return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function ($item) use ($items) {
210
-                return ! in_array($item['name'], $this->sort[$items]);
209
+            return $this->{$items} = array_merge($elements, array_filter($this->{$items}, function($item) use ($items) {
210
+                return !in_array($item['name'], $this->sort[$items]);
211 211
             }));
212 212
         }
213 213
 
Please login to merge, or discard this patch.
Unused Use Statements   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,21 +2,21 @@
 block discarded – undo
2 2
 
3 3
 namespace Backpack\CRUD;
4 4
 
5
-use Backpack\CRUD\PanelTraits\Read;
6
-use Backpack\CRUD\PanelTraits\Query;
7 5
 use Backpack\CRUD\PanelTraits\Access;
8
-use Backpack\CRUD\PanelTraits\Create;
9
-use Backpack\CRUD\PanelTraits\Delete;
10
-use Backpack\CRUD\PanelTraits\Fields;
11
-use Backpack\CRUD\PanelTraits\Update;
6
+use Backpack\CRUD\PanelTraits\AutoFocus;
12 7
 use Backpack\CRUD\PanelTraits\AutoSet;
13 8
 use Backpack\CRUD\PanelTraits\Buttons;
14 9
 use Backpack\CRUD\PanelTraits\Columns;
10
+use Backpack\CRUD\PanelTraits\Create;
11
+use Backpack\CRUD\PanelTraits\Delete;
12
+use Backpack\CRUD\PanelTraits\FakeColumns;
13
+use Backpack\CRUD\PanelTraits\FakeFields;
14
+use Backpack\CRUD\PanelTraits\Fields;
15 15
 use Backpack\CRUD\PanelTraits\Filters;
16
+use Backpack\CRUD\PanelTraits\Query;
17
+use Backpack\CRUD\PanelTraits\Read;
16 18
 use Backpack\CRUD\PanelTraits\Reorder;
17
-use Backpack\CRUD\PanelTraits\AutoFocus;
18
-use Backpack\CRUD\PanelTraits\FakeFields;
19
-use Backpack\CRUD\PanelTraits\FakeColumns;
19
+use Backpack\CRUD\PanelTraits\Update;
20 20
 use Backpack\CRUD\PanelTraits\ViewsAndRestoresRevisions;
21 21
 
22 22
 class CrudPanel
Please login to merge, or discard this patch.
src/PanelTraits/Read.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     public function hasUploadFields($form)
76 76
     {
77 77
         $fields = $this->getFields($form);
78
-        $upload_fields = array_where($fields, function ($value, $key) {
78
+        $upload_fields = array_where($fields, function($value, $key) {
79 79
             return isset($value['upload']) && $value['upload'] == true;
80 80
         });
81 81
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
      */
174 174
     public function getCellView($column, $entry)
175 175
     {
176
-        if (! isset($column['type'])) {
176
+        if (!isset($column['type'])) {
177 177
             return \View::make('crud::columns.text')->with('crud', $this)->with('column', $column)->with('entry', $entry)->render();
178 178
         } else {
179 179
             if (view()->exists('vendor.backpack.crud.columns.'.$column['type'])) {
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -33,6 +33,7 @@
 block discarded – undo
33 33
      * Get all fields needed for the EDIT ENTRY form.
34 34
      *
35 35
      * @param  [integer] The id of the entry that is being edited.
36
+     * @param integer $id
36 37
      *
37 38
      * @return [array] The fields with attributes, fake attributes and values.
38 39
      */
Please login to merge, or discard this patch.
src/CrudServiceProvider.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -89,33 +89,33 @@
 block discarded – undo
89 89
         Route::post($name.'/search', [
90 90
             'as' => 'crud.'.$name.'.search',
91 91
             'uses' => $controller.'@search',
92
-          ]);
92
+            ]);
93 93
         Route::get($name.'/reorder', [
94 94
             'as' => 'crud.'.$name.'.reorder',
95 95
             'uses' => $controller.'@reorder',
96
-          ]);
96
+            ]);
97 97
         Route::post($name.'/reorder', [
98 98
             'as' => 'crud.'.$name.'.save.reorder',
99 99
             'uses' => $controller.'@saveReorder',
100
-          ]);
100
+            ]);
101 101
         Route::get($name.'/{id}/details', [
102 102
             'as' => 'crud.'.$name.'.showDetailsRow',
103 103
             'uses' => $controller.'@showDetailsRow',
104
-          ]);
104
+            ]);
105 105
         Route::get($name.'/{id}/translate/{lang}', [
106 106
             'as' => 'crud.'.$name.'.translateItem',
107 107
             'uses' => $controller.'@translateItem',
108
-          ]);
108
+            ]);
109 109
 
110 110
         Route::get($name.'/{id}/revisions', [
111 111
             'as' => 'crud.'.$name.'.listRevisions',
112 112
             'uses' => $controller.'@listRevisions',
113
-          ]);
113
+            ]);
114 114
 
115 115
         Route::post($name.'/{id}/revisions/{revisionId}/restore', [
116 116
             'as' => 'crud.'.$name.'.restoreRevision',
117 117
             'uses' => $controller.'@restoreRevision',
118
-          ]);
118
+            ]);
119 119
 
120 120
         $options_with_default_route_names = array_merge([
121 121
             'names' => [
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function register()
65 65
     {
66
-        $this->app->bind('CRUD', function ($app) {
66
+        $this->app->bind('CRUD', function($app) {
67 67
             return new CRUD($app);
68 68
         });
69 69
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         $loader->alias('Image', \Intervention\Image\Facades\Image::class);
82 82
 
83 83
         // map the elfinder prefix
84
-        if (! \Config::get('elfinder.route.prefix')) {
84
+        if (!\Config::get('elfinder.route.prefix')) {
85 85
             \Config::set('elfinder.route.prefix', \Config::get('backpack.base.route_prefix').'/elfinder');
86 86
         }
87 87
     }
Please login to merge, or discard this patch.