Completed
Push — master ( 964799...0d228a )
by claudio
09:13
created
app/Http/Controllers/Employees/Calendars/CalendarsController.php 1 patch
Braces   +10 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,8 +66,9 @@  discard block
 block discarded – undo
66 66
         $employee = \Auth::user();
67 67
         $input = $request->all();
68 68
         $calendar = $employee->calendars()->create($input);
69
-        if(isset($input['password']))
70
-            $input['password'] = \Crypt::encrypt($input['password']);
69
+        if(isset($input['password'])) {
70
+                    $input['password'] = \Crypt::encrypt($input['password']);
71
+        }
71 72
         $calendar->caldav()->create($input);
72 73
         //TODO test
73 74
         //TODO validator
@@ -107,15 +108,17 @@  discard block
 block discarded – undo
107 108
         if($caldav){
108 109
             $this->validateCaldav($request);
109 110
         }
110
-        if(isset($input['password']))
111
-            $input['password'] = \Crypt::encrypt($input['password']);
111
+        if(isset($input['password'])) {
112
+                    $input['password'] = \Crypt::encrypt($input['password']);
113
+        }
112 114
         $calendar->update($input);
113 115
         //TODO test
114 116
         //TODO validator
115 117
         //TODO check if caldav exists?
116 118
 
117
-        if($caldav)
118
-            $caldav->update($input);
119
+        if($caldav) {
120
+                    $caldav->update($input);
121
+        }
119 122
         return $calendar;
120 123
     }
121 124
 
@@ -148,7 +151,7 @@  discard block
 block discarded – undo
148 151
             $caldavClient->connect($request->input('url'), $request->input('username'), $request->input('password'));
149 152
             $calendars = $caldavClient->findCalendars();
150 153
             return array_keys($calendars);
151
-        }catch (\it\thecsea\caldav_client_adapter\CaldavException $e)
154
+        } catch (\it\thecsea\caldav_client_adapter\CaldavException $e)
152 155
         {
153 156
             return Response::json(['error' => $e->getMessage()],422);
154 157
         }
Please login to merge, or discard this patch.