Test Failed
Push — vue-test ( 225db2...556454 )
by Tony
04:05
created
app/Http/Controllers/HomeController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@
 block discarded – undo
36 36
         if (Dashboard::find($request->route('dashboard_id'))) {
37 37
             $dash    = Api::be(auth()->user())->get('/api/dashboard/'.$request->route('dashboard_id'));
38 38
             $widgets = Api::be(auth()->user())->get('/api/widget');
39
-        } else {
39
+        }
40
+        else {
40 41
             return redirect()->route('home');
41 42
         }
42 43
         return view('home', ['dashboards' => $dashboards, 'request' => $request, 'dash_widgets' => $dash['widgets'], 'token' => $token, 'dash_details' => $dash['dashboard'], 'widgets' => $widgets]);
Please login to merge, or discard this patch.
app/Models/Notification.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,8 @@
 block discarded – undo
87 87
             $read->value = 1;
88 88
             $this->attribs()->save($read);
89 89
             return true;
90
-        } else {
90
+        }
91
+        else {
91 92
             return $this->attribs()->where('key', $name)->delete();
92 93
         }
93 94
     }
Please login to merge, or discard this patch.
app/Models/DbConfig.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,8 @@
 block discarded – undo
115 115
             } catch (\Exception $e) {
116 116
                 if (str_contains($e->getMessage(), 'unserialize():')) {
117 117
                     return $value;
118
-                } else {
118
+                }
119
+                else {
119 120
                     throw $e;
120 121
                 }
121 122
             }
Please login to merge, or discard this patch.
app/Models/DeviceGroup.php 1 patch
Braces   +20 added lines, -10 removed lines patch added patch discarded remove patch
@@ -126,7 +126,8 @@  discard block
 block discarded – undo
126 126
                     // can't build sql
127 127
                     return [];
128 128
                 }
129
-            } else {
129
+            }
130
+            else {
130 131
                 $params = $this->params;
131 132
             }
132 133
         }
@@ -137,7 +138,8 @@  discard block
 block discarded – undo
137 138
         $query = null;
138 139
         if (count($tables) == 1) {
139 140
             $query = DB::table($tables[0])->select('device_id')->distinct();
140
-        } else {
141
+        }
142
+        else {
141 143
             $query = DB::table('devices')->select('devices.device_id')->distinct();
142 144
 
143 145
             foreach ($tables as $table) {
@@ -153,7 +155,8 @@  discard block
 block discarded – undo
153 155
         // match the device ids
154 156
         if (is_null($params)) {
155 157
             return $query->whereRaw($statement)->pluck('device_id')->toArray();
156
-        } else {
158
+        }
159
+        else {
157 160
             return $query->whereRaw($statement, $params)->pluck('device_id')->toArray();
158 161
         }
159 162
     }
@@ -181,7 +184,8 @@  discard block
 block discarded – undo
181 184
         if (str_contains($pattern, 'macros.')) {
182 185
             if (++$x < 30) {
183 186
                 $pattern = self::applyGroupMacros($pattern, $x);
184
-            } else {
187
+            }
188
+            else {
185 189
                 return false;
186 190
             }
187 191
         }
@@ -225,7 +229,8 @@  discard block
 block discarded – undo
225 229
             if (starts_with($cur, '%')) {
226 230
                 // table and column or macro
227 231
                 $out .= substr($cur, 1).' ';
228
-            } elseif (substr($cur, -1) == '~') {
232
+            }
233
+            elseif (substr($cur, -1) == '~') {
229 234
                 // like operator
230 235
                 $content = $parts[++$i]; // grab the content so we can format it
231 236
 
@@ -235,14 +240,18 @@  discard block
 block discarded – undo
235 240
                 }
236 241
 
237 242
                 $out .= "LIKE('".$this->convertRegexToLike($content)."') ";
238
-            } elseif ($cur == '&&') {
243
+            }
244
+            elseif ($cur == '&&') {
239 245
                 $out .= 'AND ';
240
-            } elseif ($cur == '||') {
246
+            }
247
+            elseif ($cur == '||') {
241 248
                 $out .= 'OR ';
242
-            } elseif (in_array($cur, $ops)) {
249
+            }
250
+            elseif (in_array($cur, $ops)) {
243 251
                 // pass-through operators
244 252
                 $out .= $cur.' ';
245
-            } else {
253
+            }
254
+            else {
246 255
                 // user supplied input
247 256
                 $out .= "'".trim($cur, '"\'')."' "; // TODO: remove trim, only needed with invalid input
248 257
             }
@@ -273,7 +282,8 @@  discard block
 block discarded – undo
273 282
         // add ends appropriately
274 283
         if ($startAnchor && !$endAnchor) {
275 284
             $pattern .= '%';
276
-        } elseif (!$startAnchor && $endAnchor) {
285
+        }
286
+        elseif (!$startAnchor && $endAnchor) {
277 287
             $pattern = '%'.$pattern;
278 288
         }
279 289
 
Please login to merge, or discard this patch.
app/Api/Controllers/Alerting/AlertsController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,8 @@
 block discarded – undo
97 97
         $alert->state  = $request->input('state');
98 98
         if ($alert->save()) {
99 99
             return $this->response->array(array('statusText' => 'OK'));
100
-        } else {
100
+        }
101
+        else {
101 102
             return $this->response->errorInternal();
102 103
         }
103 104
     }
Please login to merge, or discard this patch.
app/Api/Controllers/WidgetController.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,7 +58,8 @@  discard block
 block discarded – undo
58 58
         $user_widget->dashboard_id = $request->dashboard_id;
59 59
         if ($user_widget->save()) {
60 60
             return $this->response->array(array('statusText' => 'OK', 'user_widget_id' => $user_widget->user_widget_id));
61
-        } else {
61
+        }
62
+        else {
62 63
             return $this->response->errorInternal();
63 64
         }
64 65
     }
@@ -99,7 +100,8 @@  discard block
 block discarded – undo
99 100
         if ($request->input('settings')) {
100 101
             $users_widgets = UsersWidgets::find($id);
101 102
             $users_widgets->settings = json_encode($request->input('settings'));
102
-        } else {
103
+        }
104
+        else {
103 105
             $users_widgets = UsersWidgets::find($id);
104 106
             $users_widgets->col = $request->input('x');
105 107
             $users_widgets->row = $request->input('y');
@@ -109,7 +111,8 @@  discard block
 block discarded – undo
109 111
 
110 112
         if ($users_widgets->save()) {
111 113
             return $this->response->array(array('statusText' => 'OK'));
112
-        } else {
114
+        }
115
+        else {
113 116
             return $this->response->errorInternal();
114 117
         }
115 118
     }
@@ -124,7 +127,8 @@  discard block
 block discarded – undo
124 127
     {
125 128
         if (UsersWidgets::destroy($id)) {
126 129
             return $this->response->array(array('statusText' => 'OK'));
127
-        } else {
130
+        }
131
+        else {
128 132
             return $this->response->errorInternal();
129 133
         }
130 134
     }
Please login to merge, or discard this patch.
app/Console/Commands/MigrateSettings.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,8 @@
 block discarded – undo
93 93
 
94 94
         if ($this->option('dry-run')) {
95 95
             $this->warn(trans('commands.migrate-settings.nochanges'));
96
-        } else {
96
+        }
97
+        else {
97 98
             Settings::flush(); // clear the settings cache
98 99
             DbConfig::updateOrCreate(['config_name' => 'settings.migrated'], ['config_value' => true]);
99 100
         }
Please login to merge, or discard this patch.
app/Console/Commands/DeleteUser.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,8 @@
 block discarded – undo
74 74
         }
75 75
         if (count($names) > 1) {
76 76
             $name = $this->choice('Who would you like to remove?', $names);
77
-        } else {
77
+        }
78
+        else {
78 79
             $name = $names[0];
79 80
         }
80 81
         if ($this->confirm('Do you wish to remove '.$name.'?')) {
Please login to merge, or discard this patch.
app/Util.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,8 @@
 block discarded – undo
44 44
                 if (array_key_exists($key, $out)) {
45 45
                     // concat the values
46 46
                     $out[$key] = $out[$key].$arr[$key];
47
-                } else {
47
+                }
48
+                else {
48 49
                     $out[$key] = $arr[$key];
49 50
                 }
50 51
             }
Please login to merge, or discard this patch.