Completed
Pull Request — develop (#38)
by Neil
07:53
created
app/Providers/RouteServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      */
38 38
     public function map(Router $router)
39 39
     {
40
-        $router->group(['namespace' => $this->namespace], function ($router) {
40
+        $router->group(['namespace' => $this->namespace], function($router) {
41 41
             require app_path('Http/routes.php');
42 42
         });
43 43
     }
Please login to merge, or discard this patch.
app/Api/Controllers/DeviceController.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@  discard block
 block discarded – undo
19 19
     public function list_devices(Request $request) {
20 20
         if ($request->user()->level >= 10 || $request->user()->level == 5) {
21 21
             return Device::all();
22
-        }
23
-        else {
22
+        } else {
24 23
             return User::find($request->user()->user_id)->devices()->get();
25 24
         }
26 25
     }
@@ -31,8 +30,7 @@  discard block
 block discarded – undo
31 30
     public function list_ports(Request $request) {
32 31
         if ($request->user()->level >= 10 || $request->user()->level == 5) {
33 32
             return Port::all();
34
-        }
35
-        else {
33
+        } else {
36 34
             return User::find($request->user()->user_id)->ports()->get();
37 35
         }
38 36
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
         }
68 68
         else {
69 69
             $user = User::find($request->user()->user_id);
70
-            $device =  $user->devices()->find($id);
70
+            $device = $user->devices()->find($id);
71 71
         }
72 72
         // morph the data as required
73 73
         if ($request->query('displayFormat') == 'link') {
Please login to merge, or discard this patch.
app/User.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     /**
32 32
      * Test if the User is an admin or demo.
33 33
      *
34
-     * @return \Illuminate\Database\Eloquent\Builder
34
+     * @return boolean
35 35
      */
36 36
     public function isAdmin()
37 37
     {
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      * Test if this user has global read access
43 43
      * these users have a level of 5, 10 or 11 (demo).
44 44
      *
45
-     * @return \Illuminate\Database\Eloquent\Builder
45
+     * @return boolean
46 46
      */
47 47
     public function hasGlobalRead()
48 48
     {
Please login to merge, or discard this patch.
app/Api/Controllers/PortController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use App\User;
7 7
 use App\Port;
8 8
 use App\Api\Transformers\PortTransformer;
9
-
10 9
 use Illuminate\Http\Request;
11 10
 use Dingo\Api\Routing\Helpers;
12 11
 use Illuminate\Support\Facades\Input;
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,14 +30,12 @@  discard block
 block discarded – undo
30 30
             $includes = explode(',', Input::get('include'));
31 31
             if (in_array('device', $includes)) {
32 32
                 $ports = Port::with('device')->get();
33
-            }
34
-            else {
33
+            } else {
35 34
                 $ports = Port::all();
36 35
             }
37 36
             return $this->response->collection($ports, new PortTransformer);
38 37
             return $ports;
39
-        }
40
-        else {
38
+        } else {
41 39
             return Auth::user()->ports()->get();
42 40
         }
43 41
     }
@@ -73,8 +71,7 @@  discard block
 block discarded – undo
73 71
     {
74 72
         if ($request->user()->hasGlobalRead()) {
75 73
             return Port::find($id);
76
-        }
77
-        else {
74
+        } else {
78 75
             $user = User::find($request->user()->user_id);
79 76
             return $user->ports()->find($id);
80 77
         }
Please login to merge, or discard this patch.
app/Http/Controllers/NotificationController.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
17 17
     public function list_devices(Request $request) {
18 18
         if ($request->user()->level >= 10 || $request->user()->level == 5) {
19 19
             return Devices::all();
20
-        }
21
-        else {
20
+        } else {
22 21
             return User::find($request->user()->user_id)->devices()->get();
23 22
         }
24 23
     }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Illuminate\Contracts\Auth\Guard;
6 6
 use Dingo\Api\Http;
7 7
 use Dingo\Api\Routing\Helpers;
8
-use Illuminate\Http\Request;
9 8
 
10 9
 class SetViewVariable
11 10
 {
Please login to merge, or discard this patch.
app/Api/Controllers/NotificationController.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@  discard block
 block discarded – undo
27 27
         if ($type === 'archive')
28 28
         {
29 29
             $notifications = Notification::read([$request->user()->user_id])->limit()->get();
30
-        }
31
-        else {
30
+        } else {
32 31
             $notifications = Notification::unread()->limit()->get();
33 32
         }
34 33
 
@@ -51,19 +50,16 @@  discard block
 block discarded – undo
51 50
                 if ($read->save())
52 51
                 {
53 52
                     return $this->response->array(array('statusText'=>'OK'));
54
-                }
55
-                else {
53
+                } else {
56 54
                     return $this->response->errorInternal();
57 55
                 }
58 56
             }
59
-        }
60
-        elseif ($action === 'unread' || $action === 'unsticky')
57
+        } elseif ($action === 'unread' || $action === 'unsticky')
61 58
         {
62 59
             if (NotificationAttrib::where('notifications_id', $id)->delete() >= 0)
63 60
             {
64 61
                 return $this->response->array(array('statusText'=>'OK'));
65
-            }
66
-            else {
62
+            } else {
67 63
                 return $this->response->errorInternal();
68 64
             }
69 65
         }
Please login to merge, or discard this patch.
app/Notification.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,11 +41,11 @@
 block discarded – undo
41 41
 
42 42
     public function scopeLimit($query)
43 43
     {
44
-        return $query->select('notifications.*','key');
44
+        return $query->select('notifications.*', 'key');
45 45
     }
46 46
 
47 47
     public function users() {
48
-        return $this->belongsToMany('App\User')->withPivot('notifications_id','user_id');
48
+        return $this->belongsToMany('App\User')->withPivot('notifications_id', 'user_id');
49 49
     }
50 50
 
51 51
 }
Please login to merge, or discard this patch.