Passed
Pull Request — main (#53)
by Thierry
09:04 queued 02:22
created
src/Validation/Tontine/MemberValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
             'registered_at' => 'nullable|date_format:Y-m-d',
42 42
             'birthday' => 'nullable|date_format:Y-m-d',
43 43
         ]);
44
-        if($validator->fails())
44
+        if ($validator->fails())
45 45
         {
46 46
             throw new ValidationException($validator);
47 47
         }
Please login to merge, or discard this patch.
src/Validation/Tontine/TontineValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
             'country_code' => ['required', new CountryCode()],
30 30
             'currency_code' => ['required', new CurrencyCode()],
31 31
         ]);
32
-        if($validator->fails())
32
+        if ($validator->fails())
33 33
         {
34 34
             throw new ValidationException($validator);
35 35
         }
Please login to merge, or discard this patch.
src/Validation/Tontine/ChargeValidator.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,20 +35,19 @@
 block discarded – undo
35 35
             'period' => 'required|integer|between:0,3',
36 36
             'name' => 'required|string|min:1',
37 37
             'fixed' => [
38
-                Rule::requiredIf((int)$values['type'] === 0 && (int)$values['period'] > 0),
38
+                Rule::requiredIf((int) $values['type'] === 0 && (int) $values['period'] > 0),
39 39
                 'in:1',
40 40
                 'exclude',
41 41
             ],
42 42
             'amount' => 'required_if:fixed,1|regex:/^\d+(\.\d{1,2})?$/',
43 43
         ]);
44
-        if($validator->fails())
44
+        if ($validator->fails())
45 45
         {
46 46
             throw new ValidationException($validator);
47 47
         }
48 48
 
49 49
         $validated = $validator->validated();
50
-        $validated['amount'] = empty($values['fixed']) ? 0 :
51
-            $this->localeService->convertMoneyToInt((float)$validated['amount']);
50
+        $validated['amount'] = empty($values['fixed']) ? 0 : $this->localeService->convertMoneyToInt((float) $validated['amount']);
52 51
         $validated['lendable'] = isset($values['lendable']);
53 52
 
54 53
         return $validated;
Please login to merge, or discard this patch.
src/Validation/Meeting/RemitmentValidator.php 1 patch
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,16 +34,14 @@
 block discarded – undo
34 34
             'amount' => 'required_if:remit_amount,1|regex:/^\d+(\.\d{1,2})?$/',
35 35
             'auction' => 'required_if:remit_auction,1|regex:/^\d+(\.\d{1,2})?$/',
36 36
         ]);
37
-        if($validator->fails())
37
+        if ($validator->fails())
38 38
         {
39 39
             throw new ValidationException($validator);
40 40
         }
41 41
 
42 42
         $validated = $validator->validated();
43
-        $validated['amount'] = empty($validated['amount']) ? 0 :
44
-            $this->localeService->convertMoneyToInt((float)$validated['amount']);
45
-        $validated['auction'] = empty($validated['auction']) ? 0 :
46
-            $this->localeService->convertMoneyToInt((float)$validated['auction']);
43
+        $validated['amount'] = empty($validated['amount']) ? 0 : $this->localeService->convertMoneyToInt((float) $validated['amount']);
44
+        $validated['auction'] = empty($validated['auction']) ? 0 : $this->localeService->convertMoneyToInt((float) $validated['auction']);
47 45
         return $validated;
48 46
     }
49 47
 }
Please login to merge, or discard this patch.
src/Validation/Meeting/DebtValidator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
             'debt' => 'required|integer|min:1',
36 36
             'amount' => 'required|regex:/^\d+(\.\d{1,2})?$/',
37 37
         ]);
38
-        if($validator->fails())
38
+        if ($validator->fails())
39 39
         {
40 40
             throw new ValidationException($validator);
41 41
         }
42 42
 
43 43
         $validated = $validator->validated();
44
-        $validated['amount'] = $this->localeService->convertMoneyToInt((float)$validated['amount']);
44
+        $validated['amount'] = $this->localeService->convertMoneyToInt((float) $validated['amount']);
45 45
         return $validated;
46 46
     }
47 47
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $validator = Validator::make($this->values($values), [
59 59
             'debt' => 'required|integer|min:1',
60 60
         ]);
61
-        if($validator->fails())
61
+        if ($validator->fails())
62 62
         {
63 63
             throw new ValidationException($validator);
64 64
         }
Please login to merge, or discard this patch.
src/Validation/Meeting/DisbursementValidator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,13 +36,13 @@
 block discarded – undo
36 36
             'amount' => 'required|regex:/^\d+(\.\d{1,2})?$/',
37 37
             'comment' => 'present|between:0,150',
38 38
         ]);
39
-        if($validator->fails())
39
+        if ($validator->fails())
40 40
         {
41 41
             throw new ValidationException($validator);
42 42
         }
43 43
 
44 44
         $validated = $validator->validated();
45
-        $validated['amount'] = $this->localeService->convertMoneyToInt((float)$validated['amount']);
45
+        $validated['amount'] = $this->localeService->convertMoneyToInt((float) $validated['amount']);
46 46
         return $validated;
47 47
     }
48 48
 }
Please login to merge, or discard this patch.
src/Validation/Planning/PoolValidator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,13 +42,13 @@
 block discarded – undo
42 42
             'properties.remit.auction' => 'required|boolean',
43 43
             'properties.remit.lendable' => 'required|boolean',
44 44
         ]);
45
-        if($validator->fails())
45
+        if ($validator->fails())
46 46
         {
47 47
             throw new ValidationException($validator);
48 48
         }
49 49
 
50 50
         $validated = $validator->validated();
51
-        $validated['amount'] = $this->localeService->convertMoneyToInt((float)$validated['amount']);
51
+        $validated['amount'] = $this->localeService->convertMoneyToInt((float) $validated['amount']);
52 52
         return $validated;
53 53
     }
54 54
 }
Please login to merge, or discard this patch.
src/Validation/AbstractValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     protected function values(array $values): array
19 19
     {
20 20
         return array_map(function($value) {
21
-            if(!is_string($value))
21
+            if (!is_string($value))
22 22
             {
23 23
                 return $value;
24 24
             }
Please login to merge, or discard this patch.
src/Service/BalanceCalculator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function getReceivableAmount(Receivable $receivable): int
37 37
     {
38
-        if($receivable->subscription->pool->deposit_fixed)
38
+        if ($receivable->subscription->pool->deposit_fixed)
39 39
         {
40 40
             return $receivable->subscription->pool->amount;
41 41
         }
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
     public function getPayableAmount(Payable $payable, Session $session): int
99 99
     {
100 100
         $pool = $payable->subscription->pool;
101
-        if($pool->remit_fixed)
101
+        if ($pool->remit_fixed)
102 102
         {
103
-            if($pool->deposit_fixed)
103
+            if ($pool->deposit_fixed)
104 104
             {
105 105
                 return $pool->amount * $this->tenantService->countEnabledSessions($pool);
106 106
             }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      */
128 128
     public function getPoolRemitmentAmount(Pool $pool, Session $session): int
129 129
     {
130
-        if(!$pool->remit_fixed)
130
+        if (!$pool->remit_fixed)
131 131
         {
132 132
             // Sum the amounts for all remitments
133 133
             return $this->getRemitmentQuery(false)
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
                 ->where('subscriptions.pool_id', $pool->id)
136 136
                 ->sum('remitments.amount');
137 137
         }
138
-        if(!$pool->deposit_fixed)
138
+        if (!$pool->deposit_fixed)
139 139
         {
140 140
             // Sum the amounts for all deposits
141 141
             return $this->getPoolDepositAmount($pool, $session);
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
         return DB::table('partial_refunds')
276 276
             ->join('debts', 'partial_refunds.debt_id', '=', 'debts.id')
277 277
             ->whereIn('partial_refunds.session_id', $sessionIds)
278
-            ->whereNotExists(function (Builder $query) {
278
+            ->whereNotExists(function(Builder $query) {
279 279
                 $query->select(DB::raw(1))->from('refunds')
280 280
                     ->whereColumn('refunds.debt_id', 'debts.id');
281 281
             })
Please login to merge, or discard this patch.