Passed
Push — main ( ccbeb2...45ea91 )
by Thierry
05:34
created
src/Service/Meeting/Pool/AuctionService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                         $query->where('session_id', $sessionId);
44 44
                     });
45 45
                 });
46
-                if($prevSessions->count() === 0)
46
+                if ($prevSessions->count() === 0)
47 47
                 {
48 48
                     return;
49 49
                 }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     public function toggleAuctionPayment(Session $session, int $auctionId)
113 113
     {
114 114
         $auction = $this->getQuery($session)->find($auctionId);
115
-        if(($auction))
115
+        if (($auction))
116 116
         {
117 117
             $auction->update(['paid' => !$auction->paid]);
118 118
         }
Please login to merge, or discard this patch.
src/Service/Meeting/Credit/RefundService.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
                         $query->where('session_id', $sessionId);
54 54
                     });
55 55
                 });
56
-                if($prevSessions->count() === 0)
56
+                if ($prevSessions->count() === 0)
57 57
                 {
58 58
                     return;
59 59
                 }
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
     public function createRefund(Session $session, int $debtId): void
145 145
     {
146 146
         $debt = $this->getDebt($session, $debtId);
147
-        if(!$debt || $debt->refund)
147
+        if (!$debt || $debt->refund)
148 148
         {
149 149
             throw new MessageException(trans('tontine.loan.errors.not_found'));
150 150
         }
151
-        if(!$this->debtCalculator->debtIsEditable($session, $debt))
151
+        if (!$this->debtCalculator->debtIsEditable($session, $debt))
152 152
         {
153 153
             throw new MessageException(trans('meeting.refund.errors.cannot_refund'));
154 154
         }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         DB::transaction(function() use($session, $debt, $refund) {
160 160
             $refund->save();
161 161
             // For simple or compound interest, also save the final amount.
162
-            if($debt->is_interest && !$debt->loan->fixed_interest)
162
+            if ($debt->is_interest && !$debt->loan->fixed_interest)
163 163
             {
164 164
                 $debt->amount = $this->debtCalculator->getDebtAmount($session, $debt);
165 165
                 $debt->save();
@@ -179,15 +179,15 @@  discard block
 block discarded – undo
179 179
     {
180 180
         $refund = Refund::with('debt')->where('session_id', $session->id)
181 181
             ->where('debt_id', $debtId)->first();
182
-        if(!$refund)
182
+        if (!$refund)
183 183
         {
184 184
             throw new MessageException(trans('meeting.refund.errors.not_found'));
185 185
         }
186
-        if((!$refund->editable))
186
+        if ((!$refund->editable))
187 187
         {
188 188
             throw new MessageException(trans('meeting.refund.errors.cannot_delete'));
189 189
         }
190
-        if(!$this->debtCalculator->debtIsEditable($session, $refund->debt))
190
+        if (!$this->debtCalculator->debtIsEditable($session, $refund->debt))
191 191
         {
192 192
             throw new MessageException(trans('meeting.refund.errors.cannot_refund'));
193 193
         }
@@ -260,12 +260,12 @@  discard block
 block discarded – undo
260 260
     public function createPartialRefund(Session $session, int $debtId, int $amount): void
261 261
     {
262 262
         $debt = $this->getDebt($session, $debtId);
263
-        if(!$debt || $debt->refund)
263
+        if (!$debt || $debt->refund)
264 264
         {
265 265
             throw new MessageException(trans('meeting.refund.errors.not_found'));
266 266
         }
267 267
         // A partial refund must not totally refund a debt
268
-        if($amount >= $debt->due_amount)
268
+        if ($amount >= $debt->due_amount)
269 269
         {
270 270
             throw new MessageException(trans('meeting.refund.errors.pr_amount'));
271 271
         }
@@ -289,11 +289,11 @@  discard block
 block discarded – undo
289 289
     {
290 290
         $refund = PartialRefund::where('session_id', $session->id)
291 291
             ->with(['debt.refund'])->find($refundId);
292
-        if(!$refund)
292
+        if (!$refund)
293 293
         {
294 294
             throw new MessageException(trans('meeting.refund.errors.not_found'));
295 295
         }
296
-        if($refund->debt->refund !== null || !$refund->editable)
296
+        if ($refund->debt->refund !== null || !$refund->editable)
297 297
         {
298 298
             throw new MessageException(trans('meeting.refund.errors.cannot_delete'));
299 299
         }
Please login to merge, or discard this patch.