Passed
Pull Request — main (#57)
by Thierry
15:28 queued 13s
created
src/Model/GuestInvite.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,13 +93,13 @@
 block discarded – undo
93 93
     {
94 94
         return Attribute::make(
95 95
             get: function() {
96
-                if($this->status === self::STATUS_PENDING) {
96
+                if ($this->status === self::STATUS_PENDING) {
97 97
                     $label = $this->expires_at < now() ? 'expired' : 'expires';
98 98
                     return trans("tontine.invite.active.$label", [
99 99
                         'date' => $this->expires_at->translatedFormat(trans('tontine.date.format_medium')),
100 100
                     ]);
101 101
                 }
102
-                if($this->status === self::STATUS_ACCEPTED) {
102
+                if ($this->status === self::STATUS_ACCEPTED) {
103 103
                     $label = $this->active ? 'active' : 'inactive';
104 104
                     return trans("tontine.invite.active.$label", [
105 105
                         'date' => $this->updated_at->translatedFormat(trans('tontine.date.format_medium')),
Please login to merge, or discard this patch.
src/Validation/Tontine/GuestInviteValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
             'email' => 'required|email',
20 20
         ]);
21 21
 
22
-        if($validator->fails())
22
+        if ($validator->fails())
23 23
         {
24 24
             throw new ValidationException($validator);
25 25
         }
Please login to merge, or discard this patch.
app/Ajax/CallableSelectClass.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
         $this->response->html('sidebar-menu-tontine', $this->render('parts.sidebar.tontine'));
28 28
         $this->jq('a', '#sidebar-menu-tontine')->css('color', self::$activeMenuColor);
29 29
 
30
-        foreach(config('menu.tontine') as $menuId => $menuClass)
30
+        foreach (config('menu.tontine') as $menuId => $menuClass)
31 31
         {
32 32
             $this->jq($menuId)->click($this->rq($menuClass)->home());
33 33
         }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $this->response->html('sidebar-menu-round', $this->render('parts.sidebar.round'));
50 50
         $this->jq('a', '#sidebar-menu-round')->css('color', self::$activeMenuColor);
51 51
 
52
-        foreach(config('menu.round') as $menuId => $menuClass)
52
+        foreach (config('menu.round') as $menuId => $menuClass)
53 53
         {
54 54
             $this->jq($menuId)->click($this->rq($menuClass)->home());
55 55
         }
Please login to merge, or discard this patch.
app/Ajax/Web/Tontine/Tontine.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
         $this->response->html('section-title', trans('tontine.menus.tontines'));
55 55
         $this->response->html('content-home', $this->render('pages.tontine.home'));
56 56
 
57
-        if(($tontine = $this->tenantService->tontine()))
57
+        if (($tontine = $this->tenantService->tontine()))
58 58
         {
59 59
             $this->selectTontine($tontine);
60 60
         }
61
-        if(($round = $this->tenantService->round()))
61
+        if (($round = $this->tenantService->round()))
62 62
         {
63 63
             $this->selectRound($round);
64 64
         }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $this->jq('#btn-show-select')->click($this->rq(Select::class)->showTontines());
69 69
 
70 70
         $this->page();
71
-        if($this->tontineService->hasGuestTontines())
71
+        if ($this->tontineService->hasGuestTontines())
72 72
         {
73 73
             $this->cl(Guest\Tontine::class)->home();
74 74
         }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             'title' => trans('common.actions.cancel'),
117 117
             'class' => 'btn btn-tertiary',
118 118
             'click' => 'close',
119
-        ],[
119
+        ], [
120 120
             'title' => trans('common.actions.save'),
121 121
             'class' => 'btn btn-primary',
122 122
             'click' => $this->rq()->create(pm()->form('tontine-form')),
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             'title' => trans('common.actions.cancel'),
163 163
             'class' => 'btn btn-tertiary',
164 164
             'click' => 'close',
165
-        ],[
165
+        ], [
166 166
             'title' => trans('common.actions.save'),
167 167
             'class' => 'btn btn-primary',
168 168
             'click' => $this->rq()->update($tontine->id, pm()->form('tontine-form')),
Please login to merge, or discard this patch.
app/Ajax/Web/Tontine/Guest/Invite.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             'title' => trans('common.actions.cancel'),
100 100
             'class' => 'btn btn-tertiary',
101 101
             'click' => 'close',
102
-        ],[
102
+        ], [
103 103
             'title' => trans('common.actions.save'),
104 104
             'class' => 'btn btn-primary',
105 105
             'click' => $this->rq()->create(pm()->form('invite-form')),
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
     public function guestDelete(int $inviteId)
161 161
     {
162
-        if($this->guestService->deleteGuestInvite($inviteId))
162
+        if ($this->guestService->deleteGuestInvite($inviteId))
163 163
         {
164 164
             // The active tontine invite is deleted. Reload the page.
165 165
             $this->response->redirect('/');
Please login to merge, or discard this patch.
app/Ajax/Web/Tontine/Guest/Access.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
     {
47 47
         $inviteId = $this->target()->method() === 'home' ?
48 48
             $this->target()->args()[0] : $this->bag('invite')->get('invite.id');
49
-        if(!($this->invite = $this->guestService->getHostInvite($inviteId)))
49
+        if (!($this->invite = $this->guestService->getHostInvite($inviteId)))
50 50
         {
51 51
             throw new MessageException(trans('tontine.invite.errors.invite_not_found'));
52 52
         }
53 53
         // Do not find the tontine on the home page.
54
-        if($this->target()->method() === 'home')
54
+        if ($this->target()->method() === 'home')
55 55
         {
56 56
             return;
57 57
         }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public function home(int $inviteId)
64 64
     {
65 65
         $tontines = $this->tenantService->user()->tontines;
66
-        if($tontines->count() === 0)
66
+        if ($tontines->count() === 0)
67 67
         {
68 68
             $this->notify->warning(trans('tontine.invite.errors.tontines'), trans('common.titles.warning'));
69 69
             return $this->response;
Please login to merge, or discard this patch.
app/Http/Middleware/TontineTenant.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         // First try to get the current tontine id from the databag.
45 45
         $tontine = null;
46 46
         $tontineId = $tenantDatabag->get('tontine.id', 0);
47
-        if($tontineId > 0 &&
47
+        if ($tontineId > 0 &&
48 48
             ($tontine = $this->tontineService->getUserOrGuestTontine($tontineId)) !== null)
49 49
         {
50 50
             $this->tenantService->setTontine($tontine);
@@ -52,16 +52,16 @@  discard block
 block discarded – undo
52 52
         }
53 53
 
54 54
         // Try to get the latest tontine the user worked on.
55
-        if(($tontineId = $user->properties['latest']['tontine'] ?? 0) > 0)
55
+        if (($tontineId = $user->properties['latest']['tontine'] ?? 0) > 0)
56 56
         {
57 57
             $tontine = $this->tontineService->getUserOrGuestTontine($tontineId);
58 58
         }
59
-        if(!$tontine)
59
+        if (!$tontine)
60 60
         {
61 61
             $tontine = $this->tontineService->getTontines()->first() ??
62 62
                 $this->tontineService->getGuestTontines()->first();
63 63
         }
64
-        if(($tontine))
64
+        if (($tontine))
65 65
         {
66 66
             $tenantDatabag->set('tontine.id', $tontine->id);
67 67
             $tenantDatabag->set('round.id', 0);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         // First try to get the current round id from the databag.
86 86
         $round = null;
87 87
         $roundId = $tenantDatabag->get('round.id', 0);
88
-        if($roundId > 0 &&
88
+        if ($roundId > 0 &&
89 89
             ($round = $tontine->rounds()->find($roundId)) !== null)
90 90
         {
91 91
             $this->tenantService->setRound($round);
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
         }
94 94
 
95 95
         // Try to get the latest round the user worked on.
96
-        if(($roundId = $tontine->user->properties['latest']['round'] ?? 0) > 0)
96
+        if (($roundId = $tontine->user->properties['latest']['round'] ?? 0) > 0)
97 97
         {
98 98
             $round = $tontine->rounds()->find($roundId);
99 99
         }
100
-        if(!$round)
100
+        if (!$round)
101 101
         {
102 102
             $round = $tontine->rounds()->first();
103 103
         }
104
-        if(($round))
104
+        if (($round))
105 105
         {
106 106
             $this->tenantService->setRound($round);
107 107
             $tenantDatabag->set('tontine.id', $tontine->id);
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         $user = auth()->user();
125 125
         $this->tenantService->setUser($user);
126 126
 
127
-        if(($tontine = $this->setLatestTontine($user)) !== null)
127
+        if (($tontine = $this->setLatestTontine($user)) !== null)
128 128
         {
129 129
             $this->setLatestRound($tontine);
130 130
         }
Please login to merge, or discard this patch.
src/Validation/Tontine/GuestAccessValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             'report.round' => 'sometimes|required|in:1',
32 32
         ]);
33 33
 
34
-        if($validator->fails())
34
+        if ($validator->fails())
35 35
         {
36 36
             throw new ValidationException($validator);
37 37
         }
Please login to merge, or discard this patch.
src/Service/Tontine/ChargeService.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@
 block discarded – undo
128 128
                 $charge->delete();
129 129
             });
130 130
         }
131
-        catch(Exception)
131
+        catch (Exception)
132 132
         {
133 133
             throw new MessageException(trans('tontine.charge.errors.cannot_delete'));
134 134
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -128,8 +128,7 @@
 block discarded – undo
128 128
                 Bill::whereIn('id', $billIds)->delete();
129 129
                 $charge->delete();
130 130
             });
131
-        }
132
-        catch(Exception)
131
+        } catch(Exception)
133 132
         {
134 133
             throw new MessageException(trans('tontine.charge.errors.cannot_delete'));
135 134
         }
Please login to merge, or discard this patch.