Completed
Pull Request — develop (#143)
by Tony
03:52
created
app/DataTables/DeviceDataTable.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,6 @@
 block discarded – undo
25 25
 
26 26
 namespace App\DataTables;
27 27
 
28
-use App\Models\DeviceGroup;
29 28
 use App\Models\Device;
30 29
 
31 30
 class DeviceDataTable extends BaseDataTable
Please login to merge, or discard this patch.
app/Http/Controllers/DeviceController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace App\Http\Controllers;
4 4
 
5 5
 use App\DataTables\DeviceDataTable;
6
-use App\DataTables\DeviceGroupDataTable;
7 6
 use App\Models\DeviceGroup;
8 7
 use Dingo\Api\Http;
9 8
 use Dingo\Api\Routing\Helpers;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
      *
19 19
      * @return \Illuminate\Http\JsonResponse|\Illuminate\View\View
20 20
      */
21
-    public function index(DeviceDataTable $dataTable, $group_id=-1)
21
+    public function index(DeviceDataTable $dataTable, $group_id = -1)
22 22
     {
23 23
         $group_name = "";
24
-        if($group_id >= 0) {
24
+        if ($group_id >= 0) {
25 25
             $dataTable->addScope(new \App\DataTables\Scopes\DeviceGroup($group_id));
26 26
             $group_name = DeviceGroup::find($group_id)->name;
27 27
         }
Please login to merge, or discard this patch.
app/Http/Controllers/DeviceGroupController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace App\Api\Controllers;
4 4
 
5 5
 use DB;
6
-use App\Http\Requests;
7 6
 use Illuminate\Http\Request;
8 7
 
9 8
 class ApiController extends Controller
Please login to merge, or discard this patch.
app/Models/DeviceGroup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         $related = $this->getRelation('deviceCountRelation')->first();
94 94
 
95 95
         // then return the count directly
96
-        return ($related) ? (int)$related->count : 0;
96
+        return ($related) ? (int) $related->count : 0;
97 97
     }
98 98
 
99 99
     /**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         }
177 177
 
178 178
         foreach (Settings::get('alert.macros.group', []) as $macro => $value) {
179
-            $value = str_replace(['%', '&&', '||'], ['', 'AND', 'OR'], $value);  // this might need something more complex
179
+            $value = str_replace(['%', '&&', '||'], ['', 'AND', 'OR'], $value); // this might need something more complex
180 180
             if (!str_contains($macro, ' ')) {
181 181
                 $pattern = str_replace('macros.'.$macro, '('.$value.')', $pattern);
182 182
             }
Please login to merge, or discard this patch.