Passed
Pull Request — main (#54)
by Thierry
13:54
created
src/Validation/Tontine/OptionsValidator.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
             'reports.template' => 'required|string|in:default,raptor',
21 21
         ]);
22 22
 
23
-        if($validator->fails())
23
+        if ($validator->fails())
24 24
         {
25 25
             throw new ValidationException($validator);
26 26
         }
Please login to merge, or discard this patch.
app/Ajax/Web/Tontine/Tontine.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
         $this->response->html('section-title', trans('tontine.menus.tontines'));
62 62
         $this->response->html('content-home', $this->render('pages.tontine.home'));
63 63
 
64
-        if(($tontine = $this->tenantService->tontine()))
64
+        if (($tontine = $this->tenantService->tontine()))
65 65
         {
66 66
             $this->selectTontine($tontine);
67 67
         }
68
-        if(($round = $this->tenantService->round()))
68
+        if (($round = $this->tenantService->round()))
69 69
         {
70 70
             $this->selectRound($round);
71 71
         }
@@ -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/Options.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
             'title' => trans('common.actions.cancel'),
49 49
             'class' => 'btn btn-tertiary',
50 50
             'click' => 'close',
51
-        ],[
51
+        ], [
52 52
             'title' => trans('common.actions.save'),
53 53
             'class' => 'btn btn-primary',
54 54
             'click' => $this->rq()->saveOptions(pm()->form('options-form')),
Please login to merge, or discard this patch.
app/Ajax/Web/Planning/Subscription.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -45,8 +45,7 @@  discard block
 block discarded – undo
45 45
         $pools = $this->poolService->getPools();
46 46
         $poolLabels = $pools->keyBy('id')->map(function($pool) {
47 47
             return $pool->title . ' - ' . ($pool->deposit_fixed ?
48
-                $this->localeService->formatMoney($pool->amount) :
49
-                trans('tontine.labels.types.libre'));
48
+                $this->localeService->formatMoney($pool->amount) : trans('tontine.labels.types.libre'));
50 49
         });
51 50
         $html = $this->render('pages.planning.subscription.home', [
52 51
             'pools' => $poolLabels,
@@ -59,7 +58,7 @@  discard block
 block discarded – undo
59 58
         $this->jq('#btn-pool-select')->click($this->rq()->pool($selectPoolId));
60 59
 
61 60
         $pool = $pools->firstWhere('id', $poolId) ?? ($pools->count() > 0 ? $pools[0] : null);
62
-        if(($pool))
61
+        if (($pool))
63 62
         {
64 63
             return $this->show($pool);
65 64
         }
@@ -90,7 +89,7 @@  discard block
 block discarded – undo
90 89
     public function planning(int $poolId)
91 90
     {
92 91
         $pool = $this->poolService->getPool($poolId);
93
-        if(!$pool || !$pool->remit_planned)
92
+        if (!$pool || !$pool->remit_planned)
94 93
         {
95 94
             return $this->response;
96 95
         }
@@ -115,7 +114,7 @@  discard block
 block discarded – undo
115 114
     public function beneficiaries(int $poolId)
116 115
     {
117 116
         $pool = $this->poolService->getPool($poolId);
118
-        if(!$pool || !$pool->remit_planned)
117
+        if (!$pool || !$pool->remit_planned)
119 118
         {
120 119
             return $this->response;
121 120
         }
@@ -147,12 +146,12 @@  discard block
 block discarded – undo
147 146
         int $currSubscriptionId)
148 147
     {
149 148
         $pool = $this->poolService->getPool($poolId);
150
-        if(!$pool || !$pool->remit_planned || $pool->remit_auction)
149
+        if (!$pool || !$pool->remit_planned || $pool->remit_auction)
151 150
         {
152 151
             return $this->response;
153 152
         }
154 153
 
155
-        if(!$this->subscriptionService->saveBeneficiary($pool, $sessionId,
154
+        if (!$this->subscriptionService->saveBeneficiary($pool, $sessionId,
156 155
             $currSubscriptionId, $nextSubscriptionId))
157 156
         {
158 157
             $message = trans('tontine.beneficiary.errors.cant_change');
Please login to merge, or discard this patch.
app/Ajax/Web/Report/Session.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
         // Don't show the page if there is no session or no member.
35 35
         $sessions = $this->tenantService->getSessions(orderAsc: false)
36 36
             ->filter(fn($session) => $session->opened || $session->closed);
37
-        if($sessions->count() === 0)
37
+        if ($sessions->count() === 0)
38 38
         {
39 39
             return $this->response;
40 40
         }
41 41
         $members = $this->tontineService->getMembers();
42
-        if($members->count() === 0)
42
+        if ($members->count() === 0)
43 43
         {
44 44
             return $this->response;
45 45
         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
     public function showSession(int $sessionId)
81 81
     {
82
-        if(!($session = $this->tenantService->getSession($sessionId)))
82
+        if (!($session = $this->tenantService->getSession($sessionId)))
83 83
         {
84 84
             return $this->response;
85 85
         }
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 
90 90
     public function showMember(int $sessionId, int $memberId)
91 91
     {
92
-        if(!($session = $this->tenantService->getSession($sessionId)))
92
+        if (!($session = $this->tenantService->getSession($sessionId)))
93 93
         {
94 94
             return $this->response;
95 95
         }
96
-        if(!($member = $this->tontineService->getMember($memberId)))
96
+        if (!($member = $this->tontineService->getMember($memberId)))
97 97
         {
98 98
             return $this->response;
99 99
         }
Please login to merge, or discard this patch.
app/Ajax/Web/Meeting/Pool/Deposit/Pool.php 1 patch
Spacing   +14 added lines, -16 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             $this->target()->args()[0] : $this->bag('meeting')->get('pool.id');
69 69
         $this->pool = $this->depositService->getPool($poolId);
70 70
 
71
-        if(!$this->session || !$this->pool || $this->session->disabled($this->pool))
71
+        if (!$this->session || !$this->pool || $this->session->disabled($this->pool))
72 72
         {
73 73
             $this->notify->error(trans('tontine.session.errors.disabled'), trans('common.titles.error'));
74 74
             $this->pool = null;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      */
135 135
     public function addDeposit(int $receivableId)
136 136
     {
137
-        if($this->session->closed)
137
+        if ($this->session->closed)
138 138
         {
139 139
             $this->notify->warning(trans('meeting.warnings.session.closed'));
140 140
             return $this->response;
@@ -153,21 +153,20 @@  discard block
 block discarded – undo
153 153
      */
154 154
     public function editAmount(int $receivableId)
155 155
     {
156
-        if($this->session->closed)
156
+        if ($this->session->closed)
157 157
         {
158 158
             $this->notify->warning(trans('meeting.warnings.session.closed'));
159 159
             return $this->response;
160 160
         }
161 161
         $receivable = $this->depositService->getReceivable($this->pool, $this->session, $receivableId);
162
-        if(!$receivable || !$receivable->deposit)
162
+        if (!$receivable || !$receivable->deposit)
163 163
         {
164 164
             return $this->page();
165 165
         }
166 166
 
167 167
         $html = $this->render('pages.meeting.deposit.libre.edit', [
168 168
             'id' => $receivable->id,
169
-            'amount' => !$receivable->deposit ? '' :
170
-                $this->localeService->getMoneyValue($receivable->deposit->amount),
169
+            'amount' => !$receivable->deposit ? '' : $this->localeService->getMoneyValue($receivable->deposit->amount),
171 170
         ]);
172 171
         $fieldId = 'receivable-' . $receivable->id;
173 172
         $this->response->html($fieldId, $html);
@@ -188,22 +187,21 @@  discard block
 block discarded – undo
188 187
      */
189 188
     public function saveAmount(int $receivableId, string $amount)
190 189
     {
191
-        if($this->session->closed)
190
+        if ($this->session->closed)
192 191
         {
193 192
             $this->notify->warning(trans('meeting.warnings.session.closed'));
194 193
             return $this->response;
195 194
         }
196 195
         $amount = str_replace(',', '.', trim($amount));
197
-        if($amount !== '' && filter_var($amount, FILTER_VALIDATE_FLOAT) === false)
196
+        if ($amount !== '' && filter_var($amount, FILTER_VALIDATE_FLOAT) === false)
198 197
         {
199 198
             $this->notify->error(trans('meeting.errors.amount.invalid', ['amount' => $amount]));
200 199
             return $this->response;
201 200
         }
202
-        $amount = $amount === '' ? 0 : $this->localeService->convertMoneyToInt((float)$amount);
201
+        $amount = $amount === '' ? 0 : $this->localeService->convertMoneyToInt((float) $amount);
203 202
 
204 203
         $amount > 0 ?
205
-            $this->depositService->saveDepositAmount($this->pool, $this->session, $receivableId, $amount):
206
-            $this->depositService->deleteDeposit($this->pool, $this->session, $receivableId);
204
+            $this->depositService->saveDepositAmount($this->pool, $this->session, $receivableId, $amount) : $this->depositService->deleteDeposit($this->pool, $this->session, $receivableId);
207 205
 
208 206
         return $this->page();
209 207
     }
@@ -215,7 +213,7 @@  discard block
 block discarded – undo
215 213
      */
216 214
     public function delDeposit(int $receivableId)
217 215
     {
218
-        if($this->session->closed)
216
+        if ($this->session->closed)
219 217
         {
220 218
             $this->notify->warning(trans('meeting.warnings.session.closed'));
221 219
             return $this->response;
@@ -231,12 +229,12 @@  discard block
 block discarded – undo
231 229
      */
232 230
     public function addAllDeposits()
233 231
     {
234
-        if($this->session->closed)
232
+        if ($this->session->closed)
235 233
         {
236 234
             $this->notify->warning(trans('meeting.warnings.session.closed'));
237 235
             return $this->response;
238 236
         }
239
-        if(!$this->pool->deposit_fixed)
237
+        if (!$this->pool->deposit_fixed)
240 238
         {
241 239
             return $this->response;
242 240
         }
@@ -251,12 +249,12 @@  discard block
 block discarded – undo
251 249
      */
252 250
     public function delAllDeposits()
253 251
     {
254
-        if($this->session->closed)
252
+        if ($this->session->closed)
255 253
         {
256 254
             $this->notify->warning(trans('meeting.warnings.session.closed'));
257 255
             return $this->response;
258 256
         }
259
-        if(!$this->pool->deposit_fixed)
257
+        if (!$this->pool->deposit_fixed)
260 258
         {
261 259
             return $this->response;
262 260
         }
Please login to merge, or discard this patch.
app/Ajax/Web/Locale.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 
16 16
     public function selectCurrencies(string $countryCode)
17 17
     {
18
-        $html= $this->render('pages.tontine.currency', [
18
+        $html = $this->render('pages.tontine.currency', [
19 19
             'currencies' => $this->localeService->getCountryCurrencies($countryCode)
20 20
         ]);
21 21
         $this->response->html('select_currency_container', $html);
Please login to merge, or discard this patch.
app/Http/Controllers/ReportController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $session = $this->tenantService->getSession($sessionId);
40 40
         view()->share($this->reportService->getSessionReport($session));
41 41
         // Show the html page
42
-        if($request->has('html'))
42
+        if ($request->has('html'))
43 43
         {
44 44
             return view("tontine.report.$template.session");
45 45
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $session = $this->tenantService->getSession($sessionId);
84 84
         view()->share($this->reportService->getProfitsReport($session));
85 85
         // Show the html page
86
-        if($request->has('html'))
86
+        if ($request->has('html'))
87 87
         {
88 88
             return view("tontine.report.$template.profits");
89 89
         }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $round = $this->tenantService->getRound($roundId);
113 113
         view()->share($this->reportService->getRoundReport($round));
114 114
         // Show the html page
115
-        if($request->has('html'))
115
+        if ($request->has('html'))
116 116
         {
117 117
             return view("tontine.report.$template.round");
118 118
         }
Please login to merge, or discard this patch.