Passed
Pull Request — main (#53)
by Thierry
09:04 queued 02:22
created
app/Ajax/Web/Meeting/Pool/Remitment/Pool.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             $this->target()->args()[0] : $this->bag('meeting')->get('pool.id');
78 78
         $this->pool = $this->remitmentService->getPool($poolId);
79 79
 
80
-        if(!$this->session || !$this->pool || $this->session->disabled($this->pool))
80
+        if (!$this->session || !$this->pool || $this->session->disabled($this->pool))
81 81
         {
82 82
             $this->notify->error(trans('tontine.session.errors.disabled'), trans('common.titles.error'));
83 83
             $this->pool = null;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         ]);
98 98
         $this->response->html('meeting-remitments', $html);
99 99
 
100
-        if(!$this->pool->remit_planned)
100
+        if (!$this->pool->remit_planned)
101 101
         {
102 102
             $this->jq('#btn-new-remitment')->click($this->rq()->addRemitment(0));
103 103
         }
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 
126 126
     public function createRemitment(int $payableId)
127 127
     {
128
-        if($this->session->closed)
128
+        if ($this->session->closed)
129 129
         {
130 130
             $this->notify->warning(trans('meeting.warnings.session.closed'));
131 131
             return $this->response;
132 132
         }
133
-        if(!$this->pool->remit_planned || $this->pool->remit_auction)
133
+        if (!$this->pool->remit_planned || $this->pool->remit_auction)
134 134
         {
135 135
             // Only when remitments are planned and without auctions.
136 136
             return $this->response;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
     public function addRemitment(int $payableId)
149 149
     {
150
-        if($this->session->closed)
150
+        if ($this->session->closed)
151 151
         {
152 152
             $this->notify->warning(trans('meeting.warnings.session.closed'));
153 153
             return $this->response;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             'title' => trans('common.actions.cancel'),
169 169
             'class' => 'btn btn-tertiary',
170 170
             'click' => 'close',
171
-        ],[
171
+        ], [
172 172
             'title' => trans('common.actions.save'),
173 173
             'class' => 'btn btn-primary',
174 174
             'click' => $this->rq()->saveRemitment(pm()->form('remitment-form')),
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
      */
184 184
     public function saveRemitment(array $formValues)
185 185
     {
186
-        if($this->session->closed)
186
+        if ($this->session->closed)
187 187
         {
188 188
             $this->notify->warning(trans('meeting.warnings.session.closed'));
189 189
             $this->dialog->hide();
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      */
218 218
     public function deleteRemitment(int $payableId)
219 219
     {
220
-        if($this->session->closed)
220
+        if ($this->session->closed)
221 221
         {
222 222
             $this->notify->warning(trans('meeting.warnings.session.closed'));
223 223
             return $this->response;
Please login to merge, or discard this patch.
app/Ajax/Web/Meeting/Pool/Auction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
      */
101 101
     public function togglePayment(string $auctionId)
102 102
     {
103
-        if($this->session->closed)
103
+        if ($this->session->closed)
104 104
         {
105 105
             $this->notify->warning(trans('meeting.warnings.session.closed'));
106 106
             return $this->response;
Please login to merge, or discard this patch.
app/Ajax/Web/Meeting/Credit/Loan.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function addLoan()
106 106
     {
107
-        if($this->session->closed)
107
+        if ($this->session->closed)
108 108
         {
109 109
             $this->notify->warning(trans('meeting.warnings.session.closed'));
110 110
             return $this->response;
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
             'title' => trans('common.actions.cancel'),
124 124
             'class' => 'btn btn-tertiary',
125 125
             'click' => 'close',
126
-        ],[
126
+        ], [
127 127
             'title' => trans('common.actions.save'),
128 128
             'class' => 'btn btn-primary',
129 129
             'click' => $this->rq()->createLoan(pm()->form('loan-form')),
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     public function createLoan(array $formValues)
141 141
     {
142
-        if($this->session->closed)
142
+        if ($this->session->closed)
143 143
         {
144 144
             $this->notify->warning(trans('meeting.warnings.session.closed'));
145 145
             return $this->response;
@@ -163,19 +163,19 @@  discard block
 block discarded – undo
163 163
      */
164 164
     public function editLoan(int $loanId)
165 165
     {
166
-        if($this->session->closed)
166
+        if ($this->session->closed)
167 167
         {
168 168
             $this->notify->warning(trans('meeting.warnings.session.closed'));
169 169
             return $this->response;
170 170
         }
171 171
         $loan = $this->loanService->getSessionLoan($this->session, $loanId);
172
-        if(!$loan)
172
+        if (!$loan)
173 173
         {
174 174
             $this->notify->warning(trans('meeting.loan.errors.not_found'));
175 175
             return $this->response;
176 176
         }
177 177
         // A refunded loan, or that was created from a remitment cannot be updated.
178
-        if($loan->refunds_count > 0 || $loan->remitment_id)
178
+        if ($loan->refunds_count > 0 || $loan->remitment_id)
179 179
         {
180 180
             $this->notify->warning(trans('meeting.loan.errors.update'));
181 181
             return $this->response;
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
             'title' => trans('common.actions.cancel'),
192 192
             'class' => 'btn btn-tertiary',
193 193
             'click' => 'close',
194
-        ],[
194
+        ], [
195 195
             'title' => trans('common.actions.save'),
196 196
             'class' => 'btn btn-primary',
197 197
             'click' => $this->rq()->updateLoan($loanId, pm()->form('loan-form')),
@@ -207,19 +207,19 @@  discard block
 block discarded – undo
207 207
      */
208 208
     public function updateLoan(int $loanId, array $formValues)
209 209
     {
210
-        if($this->session->closed)
210
+        if ($this->session->closed)
211 211
         {
212 212
             $this->notify->warning(trans('meeting.warnings.session.closed'));
213 213
             return $this->response;
214 214
         }
215 215
         $loan = $this->loanService->getSessionLoan($this->session, $loanId);
216
-        if(!$loan)
216
+        if (!$loan)
217 217
         {
218 218
             $this->notify->warning(trans('meeting.loan.errors.not_found'));
219 219
             return $this->response;
220 220
         }
221 221
         // A refunded loan, or that was created from a remitment cannot be updated.
222
-        if($loan->refunds_count > 0 || $loan->remitment_id)
222
+        if ($loan->refunds_count > 0 || $loan->remitment_id)
223 223
         {
224 224
             $this->notify->warning(trans('meeting.loan.errors.update'));
225 225
             return $this->response;
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
     public function deleteLoan(int $loanId)
241 241
     {
242
-        if($this->session->closed)
242
+        if ($this->session->closed)
243 243
         {
244 244
             $this->notify->warning(trans('meeting.warnings.session.closed'));
245 245
             return $this->response;
Please login to merge, or discard this patch.
app/Console/Commands/CreateAnnotationsDir.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     /**
28 28
      * Execute the console command.
29 29
      *
30
-      * @return int
30
+     * @return int
31 31
      */
32 32
     public function handle()
33 33
     {
Please login to merge, or discard this patch.
src/Validation/Planning/SessionValidator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,18 +46,18 @@  discard block
 block discarded – undo
46 46
             'host_id' => 'integer|min:0',
47 47
         ]);
48 48
         $validator->after(function($validator) use($values) {
49
-            if($this->sessionDateExists($values['date'], $values['id'] ?? 0))
49
+            if ($this->sessionDateExists($values['date'], $values['id'] ?? 0))
50 50
             {
51 51
                 $validator->errors()->add('date', trans('tontine.session.errors.date_dup'));
52 52
             }
53 53
         });
54
-        if($validator->fails())
54
+        if ($validator->fails())
55 55
         {
56 56
             throw new ValidationException($validator);
57 57
         }
58 58
 
59 59
         $validated = $validator->validated();
60
-        if(!$validated['host_id'])
60
+        if (!$validated['host_id'])
61 61
         {
62 62
             $validated['host_id'] = null;
63 63
         }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             'venue' => 'nullable|string',
76 76
             'notes' => 'nullable|string',
77 77
         ]);
78
-        if($validator->fails())
78
+        if ($validator->fails())
79 79
         {
80 80
             throw new ValidationException($validator);
81 81
         }
Please login to merge, or discard this patch.
app/Ajax/Web/Planning/Session.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             'title' => trans('common.actions.cancel'),
97 97
             'class' => 'btn btn-tertiary',
98 98
             'click' => 'close',
99
-        ],[
99
+        ], [
100 100
             'title' => trans('common.actions.save'),
101 101
             'class' => 'btn btn-primary',
102 102
             'click' => $this->rq()->create(pm()->form('session-form')),
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
             'title' => trans('common.actions.cancel'),
128 128
             'class' => 'btn btn-tertiary',
129 129
             'click' => 'close',
130
-        ],[
130
+        ], [
131 131
             'title' => trans('common.actions.year'),
132 132
             'class' => 'btn btn-primary',
133 133
             'click' => $this->rq()->years(),
134
-        ],[
134
+        ], [
135 135
             'title' => trans('common.actions.save'),
136 136
             'class' => 'btn btn-primary',
137 137
             'click' => $this->rq()->createList(pm()->form('session-list')),
@@ -160,12 +160,12 @@  discard block
 block discarded – undo
160 160
     private function parseSessionList(string $sessions): array
161 161
     {
162 162
         $sessions = array_map(function($value) {
163
-            if(!($value = trim($value, " \t\n\r;")))
163
+            if (!($value = trim($value, " \t\n\r;")))
164 164
             {
165 165
                 return [];
166 166
             }
167 167
             $values = explode(";", $value);
168
-            if(count($values) !== 2)
168
+            if (count($values) !== 2)
169 169
             {
170 170
                 return []; // Todo: throw an exception
171 171
             }
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
         // Check uniqueness of session dates
184 184
         $sessionDates = array_unique(array_map(fn($session) => $session['date'], $sessions));
185
-        if(count($sessions) !== count($sessionDates))
185
+        if (count($sessions) !== count($sessionDates))
186 186
         {
187 187
             throw new MessageException(trans('tontine.session.errors.date_dup'));
188 188
         }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
             'title' => trans('common.actions.cancel'),
216 216
             'class' => 'btn btn-tertiary',
217 217
             'click' => 'close',
218
-        ],[
218
+        ], [
219 219
             'title' => trans('common.actions.save'),
220 220
             'class' => 'btn btn-primary',
221 221
             'click' => $this->rq()->update($session->id, pm()->form('session-form')),
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
             'title' => trans('common.actions.cancel'),
254 254
             'class' => 'btn btn-tertiary',
255 255
             'click' => 'close',
256
-        ],[
256
+        ], [
257 257
             'title' => trans('common.actions.save'),
258 258
             'class' => 'btn btn-primary',
259 259
             'click' => $this->rq()->saveVenue($session->id, pm()->form('session-form')),
Please login to merge, or discard this patch.