Completed
Push — master ( fb856e...1e152b )
by claudio
04:39
created
app/Http/Controllers/Employees/Calendars/CalendarsController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function __construct()
19 19
     {
20
-        config(['auth.model' => \plunner\Employee::class]);
21
-        config(['jwt.user' => \plunner\Employee::class]);
20
+        config([ 'auth.model' => \plunner\Employee::class ]);
21
+        config([ 'jwt.user' => \plunner\Employee::class ]);
22 22
         $this->middleware('jwt.authandrefresh:mode-en');
23 23
     }
24 24
 
@@ -102,14 +102,14 @@  discard block
 block discarded – undo
102 102
         $this->authorize($calendar);
103 103
         $input = $request->all();
104 104
         $caldav = $calendar->caldav;
105
-        if($caldav)
105
+        if ($caldav)
106 106
             $this->validateCaldav($request);
107 107
         $calendar->update($input);
108 108
         //TODO test
109 109
         //TODO validator
110 110
         //TODO check if caldav exists?
111 111
 
112
-        if($caldav)
112
+        if ($caldav)
113 113
             $caldav->update($input);
114 114
         return $calendar;
115 115
     }
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
             $caldavClient->connect($request->input('url'), $request->input('username'), $request->input('password'));
144 144
             $calendars = $caldavClient->findCalendars();
145 145
             return array_keys($calendars);
146
-        }catch (\it\thecsea\caldav_client_adapter\CaldavException $e)
146
+        } catch (\it\thecsea\caldav_client_adapter\CaldavException $e)
147 147
         {
148
-            return Response::json(['error' => $e->getMessage()],422);
148
+            return Response::json([ 'error' => $e->getMessage() ], 422);
149 149
         }
150 150
     }
151 151
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         $this->validate($request, [
158 158
             'url' => 'required|max:255',
159 159
             'username' => 'required|max:255',
160
-            'password' => ((\Route::current()->getName() == 'companies.calendars.caldav')?'required':''),
160
+            'password' => ((\Route::current()->getName() == 'companies.calendars.caldav') ? 'required' : ''),
161 161
             'calendar_name' => 'required|max:255',
162 162
         ]);
163 163
     }
Please login to merge, or discard this patch.