Completed
Branchmaster (1db7ad)
by Rocco
06:17
created
src/Domain/Model/Shift/ShiftCoworkersFinder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@
 block discarded – undo
23 23
 
24 24
         $employee = $shift->getEmployee();
25 25
 
26
-        $shifts = array_filter($shifts, function ($shift) use ($employee) {
26
+        $shifts = array_filter($shifts, function($shift) use ($employee) {
27 27
             return $shift->getEmployee()->getId() !== $employee->getId();
28 28
         });
29 29
 
30
-        $coworkers = array_map(function ($shift) {
30
+        $coworkers = array_map(function($shift) {
31 31
             return $shift->getEmployee();
32 32
         }, $shifts);
33 33
 
Please login to merge, or discard this patch.
src/Domain/Model/Shift/HoursWorkedCalculator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         list($start, $end) = $this->getWeekStartAndEndDates($weekOf);
24 24
 
25 25
         $shifts = $this->shiftMapper->findShiftsInTimePeriodByEmployeeId($start, $end, $employee->getId());
26
-        $hours = array_reduce($shifts, function ($total, $shift) {
26
+        $hours = array_reduce($shifts, function($total, $shift) {
27 27
             return $total + $shift->getHours();
28 28
         });
29 29
 
Please login to merge, or discard this patch.
src/Domain/Model/Shift/Shift.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@
 block discarded – undo
30 30
         DateTimeInterface $startTime, DateTimeInterface $endTime,
31 31
         DateTimeInterface $created = null, DateTimeInterface $updated = null)
32 32
     {
33
-        if (isset($id) && ! is_int($id)) {
33
+        if (isset($id) && !is_int($id)) {
34 34
             throw new \InvalidArgumentException("The id must be an integer");
35 35
         }
36 36
 
37
-        if (! is_float($break)) {
37
+        if (!is_float($break)) {
38 38
             throw new \InvalidArgumentException("The break must be a float");
39 39
         }
40 40
 
Please login to merge, or discard this patch.
src/Application/Service/UpdateShift.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
         if ($shift === null) {
61 61
             return $this->payload->setStatus(Payload::NOT_FOUND)
62
-                                 ->setMessages(self::SHIFT_NOT_FOUND_MESSAGE);
62
+                                    ->setMessages(self::SHIFT_NOT_FOUND_MESSAGE);
63 63
         }
64 64
 
65 65
         if ($employeeId !== null) {
@@ -67,19 +67,19 @@  discard block
 block discarded – undo
67 67
 
68 68
             if ($employee instanceof NullUser) {
69 69
                 return $this->payload->setStatus(Payload::NOT_FOUND)
70
-                                     ->setMessages(self::USER_NOT_FOUND_MESSAGE);
70
+                                        ->setMessages(self::USER_NOT_FOUND_MESSAGE);
71 71
             }
72 72
 
73 73
             $shift = $shift->assignTo($employee);
74 74
         }
75 75
 
76 76
         $shift = $shift->changeStartTime($start)
77
-                       ->changeEndTime($end)
78
-                       ->changeBreak($break);
77
+                        ->changeEndTime($end)
78
+                        ->changeBreak($break);
79 79
 
80 80
         $this->shiftMapper->update($shift);
81 81
 
82 82
         return $this->payload->setStatus(Payload::UPDATED)
83
-                             ->setOutput($shift);
83
+                                ->setOutput($shift);
84 84
     }
85 85
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     }
28 28
 
29 29
     public function __invoke(User $currentUser, $shiftId, $employeeId, $start, $end, $break) {
30
-        if (! $currentUser->isAuthenticated()) {
30
+        if (!$currentUser->isAuthenticated()) {
31 31
             return $this->payload->setStatus(Payload::NOT_AUTHENTICATED);
32 32
         }
33 33
 
Please login to merge, or discard this patch.
src/Application/Service/GetShiftsInTimePeriod.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,6 +53,6 @@
 block discarded – undo
53 53
         $shifts = $this->shiftMapper->findShiftsInTimePeriod($start, $end);
54 54
 
55 55
         return $this->payload->setStatus(Payload::SUCCESS)
56
-                             ->setOutput($shifts);
56
+                                ->setOutput($shifts);
57 57
     }
58 58
 }
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
     public function __invoke(User $user, $start, $end)
24 24
     {
25
-        if (! $user->isAuthenticated()) {
25
+        if (!$user->isAuthenticated()) {
26 26
             return $this->payload->setStatus(Payload::NOT_AUTHENTICATED);
27 27
         }
28 28
 
Please login to merge, or discard this patch.
src/Application/Service/GetShiftsAssignedToEmployee.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
         if (! is_integer($employeeId)) {
29 29
             return $this->payload->setStatus(Payload::NOT_VALID)
30
-                                 ->setMessages(["employee_id" => self::INVALID_ID_MESSAGE]);
30
+                                    ->setMessages(["employee_id" => self::INVALID_ID_MESSAGE]);
31 31
         }
32 32
 
33 33
         if ($currentUser->getId() !== $employeeId) {
@@ -37,6 +37,6 @@  discard block
 block discarded – undo
37 37
         $shifts = $this->shiftMapper->findShiftsByEmployeeId($currentUser->getId());
38 38
 
39 39
         return $this->payload->setStatus(Payload::SUCCESS)
40
-                             ->setOutput($shifts);
40
+                                ->setOutput($shifts);
41 41
     }
42 42
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@
 block discarded – undo
21 21
 
22 22
     public function __invoke(User $currentUser, $employeeId)
23 23
     {
24
-        if (! $currentUser->isAuthenticated()) {
24
+        if (!$currentUser->isAuthenticated()) {
25 25
             return $this->payload->setStatus(Payload::NOT_AUTHENTICATED);
26 26
         }
27 27
 
28
-        if (! is_integer($employeeId)) {
28
+        if (!is_integer($employeeId)) {
29 29
             return $this->payload->setStatus(Payload::NOT_VALID)
30 30
                                  ->setMessages(["employee_id" => self::INVALID_ID_MESSAGE]);
31 31
         }
Please login to merge, or discard this patch.
src/Application/Service/GetShift.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,6 +41,6 @@
 block discarded – undo
41 41
         }
42 42
 
43 43
         return $this->payload->setStatus(Payload::SUCCESS)
44
-                             ->setOutput($shift);
44
+                                ->setOutput($shift);
45 45
     }
46 46
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
     public function __invoke($currentUser, $shiftId, $withCoworkers)
26 26
     {
27
-        if (! $currentUser->isAuthenticated()) {
27
+        if (!$currentUser->isAuthenticated()) {
28 28
             return $this->payload->setStatus(Payload::NOT_AUTHENTICATED);
29 29
         }
30 30
 
Please login to merge, or discard this patch.
src/Application/Service/GetEmployee.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,6 +31,6 @@
 block discarded – undo
31 31
         }
32 32
 
33 33
         return $this->payload->setStatus(Payload::SUCCESS)
34
-                             ->setOutput($employee);
34
+                                ->setOutput($employee);
35 35
     }
36 36
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
     public function __invoke(User $currentUser, $employeeId)
22 22
     {
23
-        if (! $currentUser->isAuthenticated()) {
23
+        if (!$currentUser->isAuthenticated()) {
24 24
             return $this->payload->setStatus(Payload::NOT_AUTHENTICATED);
25 25
         }
26 26
 
Please login to merge, or discard this patch.
src/Application/Service/CreateShift.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 
47 47
         if (count($invalid)) {
48 48
             return $this->payload->setStatus(Payload::NOT_VALID)
49
-                                 ->setMessages($invalid);
49
+                                    ->setMessages($invalid);
50 50
         }
51 51
 
52 52
         $employee = new NullUser();
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
     public function __invoke($currentUser, $start, $end, $break)
25 25
     {
26
-        if (! $currentUser->isAuthenticated()) {
26
+        if (!$currentUser->isAuthenticated()) {
27 27
             return $this->payload->setStatus(Payload::NOT_AUTHENTICATED);
28 28
         }
29 29
 
Please login to merge, or discard this patch.