Test Failed
Push — vue-test ( 707e52...f9845c )
by Tony
04:19
created
app/Http/Middleware/Authenticate.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@
 block discarded – undo
20 20
         if (Auth::guard($guard)->guest()) {
21 21
             if ($request->ajax() || $request->wantsJson()) {
22 22
                 return response('Unauthorized.', 401);
23
-            } else {
23
+            }
24
+            else {
24 25
                 return redirect()->guest('login');
25 26
             }
26 27
         }
Please login to merge, or discard this patch.
app/DataTables/Scopes/DeviceGroup.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      */
22 22
     public function apply($query)
23 23
     {
24
-        return $query->whereHas('groups', function ($q) {
24
+        return $query->whereHas('groups', function($q) {
25 25
             $q->where('id', '=', $this->group_id);
26 26
         });
27 27
     }
Please login to merge, or discard this patch.
app/QueryBuilderFilter.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -38,6 +38,9 @@
 block discarded – undo
38 38
         return json_encode(self::generateMacroFilter('alert.macros.rule', self::generateTableFilter()));
39 39
     }
40 40
 
41
+    /**
42
+     * @param string $setting
43
+     */
41 44
     private static function generateMacroFilter($setting, $filter = [])
42 45
     {
43 46
         foreach (Settings::get($setting, []) as $key => $value) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
         }
63 63
 
64 64
         // return the table filter merged with $filter, fetch from cache if available
65
-        return array_merge($filter, Cache::rememberForever('query_builder_table_filter', function () {
65
+        return array_merge($filter, Cache::rememberForever('query_builder_table_filter', function() {
66 66
             $tableFilter = [];
67 67
             $schema = DB::getDoctrineSchemaManager();
68 68
 
Please login to merge, or discard this patch.
app/Providers/RouteServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         Route::group([
55 55
             'middleware' => 'web',
56 56
             'namespace' => $this->namespace,
57
-        ], function ($router) {
57
+        ], function($router) {
58 58
             require base_path('routes/web.php');
59 59
         });
60 60
     }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             'middleware' => ['api', 'jwt-auth'],
73 73
             'namespace' => $this->namespace,
74 74
             'prefix' => 'api',
75
-        ], function ($router) {
75
+        ], function($router) {
76 76
             require base_path('routes/api.php');
77 77
         });
78 78
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Widgets/WidgetDataController.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,6 @@
 block discarded – undo
60 60
     /**
61 61
      * Display the alerts widget.
62 62
      *
63
-     * @param AlertsDataTable $dataTable
64 63
      * @param null $action
65 64
      * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
66 65
      */
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,7 +52,8 @@  discard block
 block discarded – undo
52 52
         if ($request->device_id) {
53 53
             return $EventlogDataTable->forDevice($request->device_id)
54 54
                 ->render('widgets.eventlog', compact(['tableName', 'action']));
55
-        } else {
55
+        }
56
+        else {
56 57
             return $EventlogDataTable->render('widgets.eventlog', compact(['tableName', 'action']));
57 58
         }
58 59
     }
@@ -95,7 +96,8 @@  discard block
 block discarded – undo
95 96
         $uptime = Settings::get('uptime_warning', 84600);
96 97
         if ($request->user()->hasGlobalRead()) {
97 98
             $devices = Device::where('ignore', '=', 0)->get();
98
-        } else {
99
+        }
100
+        else {
99 101
             $devices = User::find($request->user()->user_id)->devices()->where('ignore', '=', 0)->get();
100 102
         }
101 103
         $count = ['warn' => 0, 'up' => 0, 'down' => 0];
@@ -103,10 +105,12 @@  discard block
 block discarded – undo
103 105
             if ($device->status == 1) {
104 106
                 if (($device->uptime < $uptime) && ($device->uptime != '0')) {
105 107
                     $count['warn']++;
106
-                } else {
108
+                }
109
+                else {
107 110
                     $count['up']++;
108 111
                 }
109
-            } else {
112
+            }
113
+            else {
110 114
                 $count['down']++;
111 115
             }
112 116
         }
@@ -137,7 +141,8 @@  discard block
 block discarded – undo
137 141
             $count['ports']['down'] = Port::isDown()->count();
138 142
             $count['ports']['ignored'] = Port::isIgnored()->count();
139 143
             $count['ports']['disabled'] = Port::isDisabled()->count();
140
-        } else {
144
+        }
145
+        else {
141 146
             $user = User::find($request->user()->user_id);
142 147
 
143 148
             $count['devices']['total'] = $user->devices()->count();
Please login to merge, or discard this patch.
app/Models/Device.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -213,11 +213,14 @@
 block discarded – undo
213 213
         $disabled = $this->disabled;
214 214
         if ($disabled == 1) {
215 215
             return 'teal';
216
-        } elseif ($ignore == 1) {
216
+        }
217
+        elseif ($ignore == 1) {
217 218
             return 'yellow';
218
-        } elseif ($status == 0) {
219
+        }
220
+        elseif ($status == 0) {
219 221
             return 'danger';
220
-        } else {
222
+        }
223
+        else {
221 224
             return 'success';
222 225
         }
223 226
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@
 block discarded – undo
150 150
     {
151 151
         parent::boot();
152 152
 
153
-        static::deleting(function (Device $device) {
153
+        static::deleting(function(Device $device) {
154 154
             // delete related data
155 155
             $device->ports()->delete();
156 156
             $device->syslogs()->delete();
Please login to merge, or discard this patch.
app/Data/RRDXport.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,8 @@
 block discarded – undo
64 64
 
65 65
         if ($format == 'json') {
66 66
             return $this->jsonSerialize();
67
-        } elseif ($format == 'csv') {
67
+        }
68
+        elseif ($format == 'csv') {
68 69
             return $this->csvSerialize();
69 70
         }
70 71
         return null;  // shouldn't get here
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
         } elseif ($format == 'csv') {
66 66
             return $this->csvSerialize();
67 67
         }
68
-        return null;  // shouldn't get here
68
+        return null; // shouldn't get here
69 69
     }
70 70
 
71 71
     /**
Please login to merge, or discard this patch.
app/Data/RRD.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
     public static function escape($string, $length = null)
192 192
     {
193 193
         $result = shorten_interface_type($string);
194
-        $result = str_replace("'", '', $result);            # remove quotes
195
-        $result = str_replace('%', '%%', $result);          # double percent signs
194
+        $result = str_replace("'", '', $result); # remove quotes
195
+        $result = str_replace('%', '%%', $result); # double percent signs
196 196
         if (is_numeric($length) && strlen($string) > $length) {
197 197
             $extra = substr_count($string, ':', 0, $length);
198 198
             $result = substr(str_pad($result, $length), 0, ($length + $extra));
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
             }
202 202
         }
203 203
 
204
-        $result = str_replace(':', '\:', $result);          # escape colons
204
+        $result = str_replace(':', '\:', $result); # escape colons
205 205
         return $result.' ';
206 206
     }
207 207
 }
Please login to merge, or discard this patch.
app/Graphs/Device/Storage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     {
34 34
         if ($this->hasIDs()) {
35 35
             return [
36
-                'storage' => function (Builder $query) {
36
+                'storage' => function(Builder $query) {
37 37
                     $query->whereIn('storage_id', $this->getIDs());
38 38
                 },
39 39
             ];
Please login to merge, or discard this patch.