Passed
Pull Request — main (#54)
by Thierry
13:54
created
src/Validation/Meeting/LoanValidator.php 1 patch
Spacing   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             'fund_id' => 'required|integer|min:0',
33 33
         ]);
34 34
         $validator->after(function($validator) use($values) {
35
-            if((float)$values['principal'] <= 0)
35
+            if ((float) $values['principal'] <= 0)
36 36
             {
37 37
                 $validator->errors()->add('principal', trans('validation.gt.numeric', [
38 38
                     'attribute' => trans('meeting.loan.labels.principal'),
@@ -40,19 +40,18 @@  discard block
 block discarded – undo
40 40
                 ]));
41 41
             }
42 42
         });
43
-        if($validator->fails())
43
+        if ($validator->fails())
44 44
         {
45 45
             throw new ValidationException($validator);
46 46
         }
47 47
 
48 48
         $validated = $validator->validated();
49
-        $validated['principal'] = $this->localeService->convertMoneyToInt((float)$validated['principal']);
49
+        $validated['principal'] = $this->localeService->convertMoneyToInt((float) $validated['principal']);
50 50
         // Interest rates must be saved as int, so the value is multiplied by 100.
51 51
         $validated['interest_rate'] = $validated['interest_type'] === 'f' ?
52
-            0 : (int)(100 * $validated['interest']);
52
+            0 : (int) (100 * $validated['interest']);
53 53
         $validated['interest'] = $validated['interest_type'] === 'f' ?
54
-            $this->localeService->convertMoneyToInt((float)$validated['interest']) :
55
-            (int)($validated['principal'] * $validated['interest'] / 100);
54
+            $this->localeService->convertMoneyToInt((float) $validated['interest']) : (int) ($validated['principal'] * $validated['interest'] / 100);
56 55
 
57 56
         return $validated;
58 57
     }
Please login to merge, or discard this patch.
src/Validation/Meeting/SavingValidator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@
 block discarded – undo
34 34
             'amount' => 'required|regex:/^\d+(\.\d{1,2})?$/',
35 35
             'fund_id' => 'required|integer|min:0',
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'] = $this->localeService->convertMoneyToInt((float)$validated['amount']);
43
+        $validated['amount'] = $this->localeService->convertMoneyToInt((float) $validated['amount']);
44 44
         return $validated;
45 45
     }
46 46
 }
Please login to merge, or discard this patch.
src/Validation/Meeting/ClosingValidator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,13 +32,13 @@
 block discarded – undo
32 32
         $validator = Validator::make($this->values($values), [
33 33
             'amount' => 'required|regex:/^\d+(\.\d{1,2})?$/',
34 34
         ]);
35
-        if($validator->fails())
35
+        if ($validator->fails())
36 36
         {
37 37
             throw new ValidationException($validator);
38 38
         }
39 39
 
40 40
         $validated = $validator->validated();
41
-        $validated['amount'] = $this->localeService->convertMoneyToInt((float)$validated['amount']);
41
+        $validated['amount'] = $this->localeService->convertMoneyToInt((float) $validated['amount']);
42 42
         return $validated;
43 43
     }
44 44
 }
Please login to merge, or discard this patch.
app/Ajax/Web/Tontine/Fund.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             'title' => trans('common.actions.cancel'),
59 59
             'class' => 'btn btn-tertiary',
60 60
             'click' => 'close',
61
-        ],[
61
+        ], [
62 62
             'title' => trans('common.actions.save'),
63 63
             'class' => 'btn btn-primary',
64 64
             'click' => $this->rq()->create(pm()->form('fund-form')),
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             'title' => trans('common.actions.cancel'),
90 90
             'class' => 'btn btn-tertiary',
91 91
             'click' => 'close',
92
-        ],[
92
+        ], [
93 93
             'title' => trans('common.actions.save'),
94 94
             'class' => 'btn btn-primary',
95 95
             'click' => $this->rq()->update($fund->id, pm()->form('fund-form')),
Please login to merge, or discard this patch.
app/Ajax/Web/Tontine/Category.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             'title' => trans('common.actions.cancel'),
65 65
             'class' => 'btn btn-tertiary',
66 66
             'click' => 'close',
67
-        ],[
67
+        ], [
68 68
             'title' => trans('common.actions.save'),
69 69
             'class' => 'btn btn-primary',
70 70
             'click' => $this->rq()->create(pm()->form('category-form')),
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             'title' => trans('common.actions.cancel'),
102 102
             'class' => 'btn btn-tertiary',
103 103
             'click' => 'close',
104
-        ],[
104
+        ], [
105 105
             'title' => trans('common.actions.save'),
106 106
             'class' => 'btn btn-primary',
107 107
             'click' => $this->rq()->update($category->id, pm()->form('category-form')),
Please login to merge, or discard this patch.
app/Ajax/Web/Report/Session/Profit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     public function home(int $fundId)
50 50
     {
51 51
         $funds = $this->fundService->getFundList();
52
-        if(!isset($funds[$fundId]))
52
+        if (!isset($funds[$fundId]))
53 53
         {
54 54
             return $this->response;
55 55
         }
Please login to merge, or discard this patch.
app/Ajax/Web/Meeting/Saving/Closing.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 
80 80
     public function editClosing(int $fundId)
81 81
     {
82
-        if($this->session->closed)
82
+        if ($this->session->closed)
83 83
         {
84 84
             $this->notify->warning(trans('meeting.warnings.session.closed'));
85 85
             return $this->response;
86 86
         }
87 87
         $funds = $this->fundService->getFundList();
88
-        if(!isset($funds[$fundId]))
88
+        if (!isset($funds[$fundId]))
89 89
         {
90 90
             return $this->response;
91 91
         }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     public function saveClosing(int $fundId, array $formValues)
116 116
     {
117 117
         $funds = $this->fundService->getFundList();
118
-        if(!isset($funds[$fundId]))
118
+        if (!isset($funds[$fundId]))
119 119
         {
120 120
             return $this->response;
121 121
         }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     public function deleteClosing(int $fundId)
133 133
     {
134 134
         $funds = $this->fundService->getFundList();
135
-        if(!isset($funds[$fundId]))
135
+        if (!isset($funds[$fundId]))
136 136
         {
137 137
             return $this->response;
138 138
         }
Please login to merge, or discard this patch.
app/Ajax/Web/Meeting/Saving/Saving.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
     public function addSaving()
84 84
     {
85
-        if($this->session->closed)
85
+        if ($this->session->closed)
86 86
         {
87 87
             $this->notify->warning(trans('meeting.warnings.session.closed'));
88 88
             return $this->response;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             'title' => trans('common.actions.cancel'),
99 99
             'class' => 'btn btn-tertiary',
100 100
             'click' => 'close',
101
-        ],[
101
+        ], [
102 102
             'title' => trans('common.actions.save'),
103 103
             'class' => 'btn btn-primary',
104 104
             'click' => $this->rq()->createSaving(pm()->form('saving-form')),
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function createSaving(array $formValues)
115 115
     {
116
-        if($this->session->closed)
116
+        if ($this->session->closed)
117 117
         {
118 118
             $this->notify->warning(trans('meeting.warnings.session.closed'));
119 119
             return $this->response;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
     public function editSaving(int $savingId)
135 135
     {
136
-        if($this->session->closed)
136
+        if ($this->session->closed)
137 137
         {
138 138
             $this->notify->warning(trans('meeting.warnings.session.closed'));
139 139
             return $this->response;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             'title' => trans('common.actions.cancel'),
150 150
             'class' => 'btn btn-tertiary',
151 151
             'click' => 'close',
152
-        ],[
152
+        ], [
153 153
             'title' => trans('common.actions.save'),
154 154
             'class' => 'btn btn-primary',
155 155
             'click' => $this->rq()->updateSaving($savingId, pm()->form('saving-form')),
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     public function updateSaving(int $savingId, array $formValues)
166 166
     {
167
-        if($this->session->closed)
167
+        if ($this->session->closed)
168 168
         {
169 169
             $this->notify->warning(trans('meeting.warnings.session.closed'));
170 170
             return $this->response;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
     public function deleteSaving(int $savingId)
186 186
     {
187
-        if($this->session->closed)
187
+        if ($this->session->closed)
188 188
         {
189 189
             $this->notify->warning(trans('meeting.warnings.session.closed'));
190 190
             return $this->response;
Please login to merge, or discard this patch.
app/Ajax/Web/Meeting/Pool/Remitment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
         ]);
64 64
         $this->response->html('meeting-remitments', $html);
65 65
 
66
-        if($hasAuctions)
66
+        if ($hasAuctions)
67 67
         {
68 68
             $this->jq('#btn-remitment-auctions')->click($this->cl(Auction::class)->rq()->home());
69 69
         }
Please login to merge, or discard this patch.