Completed
Pull Request — master (#2)
by claudio
03:56
created
app/Http/Controllers/Employees/GroupsController.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -112,6 +112,9 @@
 block discarded – undo
112 112
         return $this->respondOK();
113 113
     }
114 114
 
115
+    /**
116
+     * @param Request $request
117
+     */
115 118
     private function validateGroupUpdates($request)
116 119
     {
117 120
         $this->validate($request, [
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
         $input = $request->all();
51 51
 
52 52
         $g = Group::create([
53
-            'name' => $input['group_name'],
54
-            'description' => isset($input['description']) ? $input['description'] : ''
53
+            'name' => $input[ 'group_name' ],
54
+            'description' => isset($input[ 'description' ]) ? $input[ 'description' ] : ''
55 55
         ]);
56
-        $employees = Employee::whereIn('name', $input['employees'])->get();
56
+        $employees = Employee::whereIn('name', $input[ 'employees' ])->get();
57 57
 
58 58
         $g->addEmployees($employees);
59 59
 
@@ -94,15 +94,15 @@  discard block
 block discarded – undo
94 94
         $this->validateGroupUpdates($request);
95 95
         $input = $request->all();
96 96
 
97
-        $employees = Employee::whereIn('name', $input['employees'])->get();
97
+        $employees = Employee::whereIn('name', $input[ 'employees' ])->get();
98 98
 
99 99
         try {
100
-            $group = Group::findOrFail($input['group_name']);
100
+            $group = Group::findOrFail($input[ 'group_name' ]);
101 101
         } catch (ModelNotFoundException $e) {
102 102
             return $this->responder->respond(
103 103
                 [
104 104
                     'message' => 'Group not found',
105
-                    'group_name' => $input['group_name']
105
+                    'group_name' => $input[ 'group_name' ]
106 106
                 ],
107 107
                 404
108 108
             );
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
     private function respondOK()
124 124
     {
125
-        return $this->responder->respond([], 200);
125
+        return $this->responder->respond([ ], 200);
126 126
     }
127 127
 
128 128
     /**
Please login to merge, or discard this patch.
app/Services/ResponseCreator/ResponseCreatorBinder.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,6 @@
 block discarded – undo
9 9
 
10 10
 namespace Services\ResponseCreator;
11 11
 
12
-use Illuminate\Support\ServiceProvider;
13
-
14 12
 class ResponseCreatorBinder
15 13
 {
16 14
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     {
23 23
         $app = $this->app;
24 24
 
25
-        $app->singleton('Services\ServiceCreator\ResponseCreator', function ($app) {
25
+        $app->singleton('Services\ServiceCreator\ResponseCreator', function($app) {
26 26
             return new services\serviceCreator\JsonResponseCreator();
27 27
         });
28 28
     }
Please login to merge, or discard this patch.