Completed
Push — develop ( 82f9ab...a18085 )
by Francisco
08:13
created
app/Judite/Models/Exchange.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,11 +65,11 @@
 block discarded – undo
65 65
      */
66 66
     public function setExchangeEnrollments(Enrollment $from, Enrollment $to) : Exchange
67 67
     {
68
-        if (! $from->availableForExchange() || is_null($to->shift)) {
68
+        if ( ! $from->availableForExchange() || is_null($to->shift)) {
69 69
             throw new EnrollmentCannotBeExchangedException();
70 70
         }
71 71
 
72
-        if (! $from->course->is($to->course)) {
72
+        if ( ! $from->course->is($to->course)) {
73 73
             throw new ExchangeEnrollmentsOnDifferentCoursesException();
74 74
         }
75 75
 
Please login to merge, or discard this patch.
app/Http/Controllers/EnrollmentExchangeController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
     public function create($id)
32 32
     {
33 33
         try {
34
-            $data = DB::transaction(function () use ($id) {
34
+            $data = DB::transaction(function() use ($id) {
35 35
                 $enrollment = student()->enrollments()->findOrFail($id);
36 36
 
37
-                if (! $enrollment->availableForExchange()) {
37
+                if ( ! $enrollment->availableForExchange()) {
38 38
                     throw new \LogicException('The enrollment is not available for exchange.');
39 39
                 }
40 40
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                 return compact('enrollment', 'matchingEnrollments');
46 46
             });
47 47
 
48
-            $data['matchingEnrollments'] = $data['matchingEnrollments']->map(function ($item) {
48
+            $data['matchingEnrollments'] = $data['matchingEnrollments']->map(function($item) {
49 49
                 return [
50 50
                     'id' => $item->id,
51 51
                     '_toString' => $item->present()->inlineToString(),
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     public function store($id, CreateRequest $request)
72 72
     {
73 73
         try {
74
-            $exchange = DB::transaction(function () use ($id, $request) {
74
+            $exchange = DB::transaction(function() use ($id, $request) {
75 75
                 $this->validate($request, [
76 76
                     'to_enrollment_id' => 'exists:enrollments,id',
77 77
                 ]);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public function destroy($id)
121 121
     {
122
-        DB::transaction(function () use ($id) {
122
+        DB::transaction(function() use ($id) {
123 123
             student()->requestedExchanges()->findOrFail($id)->delete();
124 124
         });
125 125
 
Please login to merge, or discard this patch.
app/Http/Controllers/DashboardController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
      */
36 36
     protected function adminDashboard()
37 37
     {
38
-        $courses = DB::transaction(function () {
38
+        $courses = DB::transaction(function() {
39 39
             return Course::withCount('enrollments')
40 40
                 ->orderedList()
41 41
                 ->get();
42 42
         });
43 43
 
44
-        $courses = $courses->groupBy(function ($course) {
44
+        $courses = $courses->groupBy(function($course) {
45 45
             return $course->present()->getOrdinalYear();
46 46
         });
47 47
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     protected function studentDashboard()
57 57
     {
58
-        $data = DB::transaction(function () {
58
+        $data = DB::transaction(function() {
59 59
             $data['enrollments'] = student()->enrollments()
60 60
                 ->withCount('exchangesAsSource')
61 61
                 ->orderByCourse()
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         // Group all enrollments by the year of their associated course, so
70 70
         // the enrollments listing is organized by year. This will allow
71 71
         // a better experience, since it matches the official order.
72
-        $data['enrollments'] = $data['enrollments']->groupBy(function ($enrollment) {
72
+        $data['enrollments'] = $data['enrollments']->groupBy(function($enrollment) {
73 73
             return $enrollment->course->present()->getOrdinalYear();
74 74
         });
75 75
 
Please login to merge, or discard this patch.
app/Http/Controllers/ExchangeController.php 1 patch
Spacing   +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
     public function confirm($id)
29 29
     {
30
-        $exchange = DB::transaction(function () use ($id) {
30
+        $exchange = DB::transaction(function() use ($id) {
31 31
             $exchange = student()->proposedExchanges()->findOrFail($id);
32 32
 
33 33
             return $exchange->perform();
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function decline($id)
50 50
     {
51
-        $exchange = DB::transaction(function () use ($id) {
51
+        $exchange = DB::transaction(function() use ($id) {
52 52
             $exchange = student()->proposedExchanges()->findOrFail($id);
53 53
             $exchange->delete();
54 54
 
Please login to merge, or discard this patch.
app/Http/Middleware/AuthorizeStudent.php 1 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 handle($request, Closure $next)
22 22
     {
23
-        if (! Auth::user()->isStudent()) {
23
+        if ( ! Auth::user()->isStudent()) {
24 24
             throw new AuthorizationException('Unauthorized.');
25 25
         }
26 26
 
Please login to merge, or discard this patch.
app/Http/Middleware/AuthorizeAdministrator.php 1 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 handle($request, Closure $next)
22 22
     {
23
-        if (! Auth::user()->isAdmin()) {
23
+        if ( ! Auth::user()->isAdmin()) {
24 24
             throw new AuthorizationException('Unauthorized.');
25 25
         }
26 26
 
Please login to merge, or discard this patch.
app/Support/helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('student')) {
3
+if ( ! function_exists('student')) {
4 4
     /**
5 5
      * Get the authenticated student.
6 6
      *
Please login to merge, or discard this patch.
app/Http/Controllers/EnrollmentController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     public function store($courseId)
28 28
     {
29 29
         try {
30
-            $course = DB::transaction(function () use ($courseId) {
30
+            $course = DB::transaction(function() use ($courseId) {
31 31
                 $course = Course::findOrFail($courseId);
32 32
                 Auth::user()->student->enroll($course);
33 33
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function destroy($courseId)
54 54
     {
55
-        $course = DB::transaction(function () use ($courseId) {
55
+        $course = DB::transaction(function() use ($courseId) {
56 56
             $course = Course::findOrFail($courseId);
57 57
             student()->unenroll($course);
58 58
 
Please login to merge, or discard this patch.