Completed
Push — master ( 776f21...a315a1 )
by claudio
05:49
created
app/Console/Commands/Optimise/Optimise.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@
 block discarded – undo
9 9
 namespace plunner\Console\Commands\Optimise;
10 10
 
11 11
 use Illuminate\Console\Scheduling\Schedule;
12
-use plunner\company;
13 12
 use plunner\Events\Optimise\ErrorEvent;
13
+use plunner\company;
14 14
 
15 15
 /**
16 16
  * Class Optimise
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -302,8 +302,9 @@  discard block
 block discarded – undo
302 302
     static private function fillTimeSlots(array $array, $id, \Illuminate\Support\Collection $timeSlots, $fill = '0')
303 303
     {
304 304
         foreach ($timeSlots as $timeSlot) {
305
-            if (!isset($array[$id]))
306
-                $array[$id] = [];
305
+            if (!isset($array[$id])) {
306
+                            $array[$id] = [];
307
+            }
307 308
             $array[$id] = self::arrayPadInterval($array[$id], $timeSlot->time_start, $timeSlot->time_end, $fill);
308 309
         }
309 310
         return $array;
@@ -318,8 +319,9 @@  discard block
 block discarded – undo
318 319
      */
319 320
     static private function arrayPadInterval(array $array, $from, $to, $pad = '0')
320 321
     {
321
-        for ($i = $from; $i < $to; $i++)
322
-            $array[$i] = $pad;
322
+        for ($i = $from; $i < $to; $i++) {
323
+                    $array[$i] = $pad;
324
+        }
323 325
         return $array;
324 326
     }
325 327
 
@@ -332,8 +334,9 @@  discard block
 block discarded – undo
332 334
     static private function fillRow(array $array, $id, $until, $fill = '0')
333 335
     {
334 336
         for ($i = 1; $i <= $until; $i++) {
335
-            if (!isset($array[$id][$i]))
336
-                $array[$id][$i] = $fill;
337
+            if (!isset($array[$id][$i])) {
338
+                            $array[$id][$i] = $fill;
339
+            }
337 340
         }
338 341
 
339 342
         return $array;
Please login to merge, or discard this patch.
app/Http/Controllers/Employees/Planners/MeetingTimeslotsController.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
         $meeting = Meeting::findOrFail($meetingId);
38 38
         $this->authorize($meeting);
39 39
 
40
-        if ($meeting->group_id == $groupId)
41
-            return $meeting->timeslots;
40
+        if ($meeting->group_id == $groupId) {
41
+                    return $meeting->timeslots;
42
+        }
42 43
         return Response::json(['error' => 'meeting->group_id <> groupId'], 403);
43 44
     }
44 45
 
@@ -59,8 +60,9 @@  discard block
 block discarded – undo
59 60
         $timeslot = MeetingTimeslot::findOrFail($timeslotId);
60 61
         $this->authorize($timeslot);
61 62
 
62
-        if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId)
63
-            return $timeslot;
63
+        if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId) {
64
+                    return $timeslot;
65
+        }
64 66
         return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403);
65 67
     }
66 68
 
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,11 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace plunner\Http\Controllers\Employees\Planners;
4 4
 
5
-use Illuminate\Http\Request;
6 5
 use Illuminate\Support\Facades\Response;
7 6
 use plunner\Group;
8 7
 use plunner\Http\Controllers\Controller;
9
-use plunner\Http\Requests;
10 8
 use plunner\Http\Requests\Employees\Meeting\MeetingTimeslotRequest;
11 9
 use plunner\Meeting;
12 10
 use plunner\MeetingTimeslot;
Please login to merge, or discard this patch.
app/Http/Controllers/Employees/Calendars/TimeslotsController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace plunner\Http\Controllers\Companies\Employees;
4 4
 
5
-use Illuminate\Http\Request;
6 5
 use plunner\Company;
7 6
 use plunner\Employee;
8 7
 use plunner\Http\Controllers\Controller;
Please login to merge, or discard this patch.
app/Http/Controllers/Companies/Auth/AuthController.php 2 patches
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@
 block discarded – undo
3 3
 namespace plunner\Http\Controllers\Companies\Auth;
4 4
 
5 5
 use Illuminate\Http\Request;
6
-use plunner\Company;
7
-use plunner\Http\Controllers\Controller;
8 6
 use Tymon\JWTAuth\Support\auth\AuthenticatesAndRegistersUsers;
9 7
 use Tymon\JWTAuth\Support\auth\ThrottlesLogins;
10 8
 use Validator;
9
+use plunner\Company;
10
+use plunner\Http\Controllers\Controller;
11 11
 
12 12
 /**
13 13
  * Class AuthController
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,9 @@
 block discarded – undo
79 79
         if ($request->input('remember', false)) {
80 80
             config(['jwt.ttl' => '43200']); //30 days
81 81
             $this->custom = array_merge($this->custom, ['remember' => 'true']);
82
-        } else
83
-            $this->custom = array_merge($this->custom, ['remember' => 'false']);
82
+        } else {
83
+                    $this->custom = array_merge($this->custom, ['remember' => 'false']);
84
+        }
84 85
 
85 86
         return $this->postLoginOriginal($request);
86 87
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Employees/Auth/AuthController.php 2 patches
Unused Use Statements   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,13 +3,12 @@
 block discarded – undo
3 3
 namespace plunner\Http\Controllers\Employees\Auth;
4 4
 
5 5
 use Illuminate\Http\Request;
6
-use Log;
7
-use plunner\Company;
8
-use plunner\employee;
9
-use plunner\Http\Controllers\Controller;
10 6
 use Tymon\JWTAuth\Support\auth\AuthenticatesAndRegistersUsers;
11 7
 use Tymon\JWTAuth\Support\auth\ThrottlesLogins;
12 8
 use Validator;
9
+use plunner\Company;
10
+use plunner\Http\Controllers\Controller;
11
+use plunner\employee;
13 12
 
14 13
 /**
15 14
  * Class AuthController
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,9 @@
 block discarded – undo
79 79
         if ($request->input('remember', false)) {
80 80
             config(['jwt.ttl' => '43200']); //30 days
81 81
             $this->custom = array_merge($this->custom, ['remember' => 'true']);
82
-        } else
83
-            $this->custom = array_merge($this->custom, ['remember' => 'false']);
82
+        } else {
83
+                    $this->custom = array_merge($this->custom, ['remember' => 'false']);
84
+        }
84 85
 
85 86
         return $this->postLoginOriginal($request);
86 87
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Employees/Auth/PasswordController.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@
 block discarded – undo
3 3
 namespace plunner\Http\Controllers\Employees\Auth;
4 4
 
5 5
 use Illuminate\Http\Request;
6
+use Tymon\JWTAuth\Support\auth\ResetsPasswords;
6 7
 use plunner\Company;
7 8
 use plunner\Http\Controllers\Controller;
8
-use Tymon\JWTAuth\Support\auth\ResetsPasswords;
9 9
 
10 10
 /**
11 11
  * Class PasswordController
Please login to merge, or discard this patch.
app/Http/Controllers/Employees/Meetings/MeetingsController.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,11 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace plunner\Http\Controllers\Employees\Planners;
4 4
 
5
-use Illuminate\Http\Request;
6 5
 use Illuminate\Support\Facades\Response;
7 6
 use plunner\Group;
8 7
 use plunner\Http\Controllers\Controller;
9
-use plunner\Http\Requests;
10 8
 use plunner\Http\Requests\Employees\Meeting\MeetingTimeslotRequest;
11 9
 use plunner\Meeting;
12 10
 use plunner\MeetingTimeslot;
Please login to merge, or discard this patch.
app/Http/Controllers/Employees/Planners/MeetingsController.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,11 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace plunner\Http\Controllers\Employees\Planners;
4 4
 
5
-use Illuminate\Http\Request;
6 5
 use Illuminate\Support\Facades\Response;
7 6
 use plunner\Group;
8 7
 use plunner\Http\Controllers\Controller;
9
-use plunner\Http\Requests;
10 8
 use plunner\Http\Requests\Employees\Meeting\MeetingTimeslotRequest;
11 9
 use plunner\Meeting;
12 10
 use plunner\MeetingTimeslot;
Please login to merge, or discard this patch.
app/Console/Commands/Optimise/OptimiseCommand.php 1 patch
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -58,10 +58,11 @@  discard block
 block discarded – undo
58 58
         //TODO insert a timeout
59 59
         //TODO try...catch with destruct
60 60
         $companyId = $this->argument('companyId');
61
-        if (is_numeric($companyId))
62
-            $this->makeForeground(Company::findOrFail($companyId));
63
-        else
64
-            $this->syncAll();
61
+        if (is_numeric($companyId)) {
62
+                    $this->makeForeground(Company::findOrFail($companyId));
63
+        } else {
64
+                    $this->syncAll();
65
+        }
65 66
     }
66 67
 
67 68
     /**
@@ -81,13 +82,15 @@  discard block
 block discarded – undo
81 82
         if ($this->option('background')) {
82 83
             \Log::debug(self::BACKGROUND_MOD_MEX);
83 84
             $this->info(self::BACKGROUND_MOD_MEX);
84
-            foreach ($calendars as $calendar)
85
-                $this->makeBackground($calendar);
85
+            foreach ($calendars as $calendar) {
86
+                            $this->makeBackground($calendar);
87
+            }
86 88
             \Log::debug(self::BACKGROUND_COMPLETED_MEX);
87 89
             $this->info(self::BACKGROUND_COMPLETED_MEX);
88
-        } else
89
-            foreach ($calendars as $calendar)
90
+        } else {
91
+                    foreach ($calendars as $calendar)
90 92
                 $this->makeForeground($calendar);
93
+        }
91 94
     }
92 95
 
93 96
     /**
@@ -97,7 +100,8 @@  discard block
 block discarded – undo
97 100
     private function makeBackground(Company $company)
98 101
     {
99 102
         $event = $this->schedule->command('optimise:meetings ' . $company->id)->withoutOverlapping();
100
-        if ($event->isDue($this->laravel))
101
-            $event->run($this->laravel);
103
+        if ($event->isDue($this->laravel)) {
104
+                    $event->run($this->laravel);
105
+        }
102 106
     }
103 107
 }
Please login to merge, or discard this patch.