@@ -35,14 +35,15 @@ |
||
35 | 35 | try |
36 | 36 | { |
37 | 37 | return parent::handle($request, $next); |
38 | - } |
|
39 | - catch(TokenMismatchException $e) |
|
38 | + } catch(TokenMismatchException $e) |
|
40 | 39 | { |
41 | 40 | $jaxon = App::make(Jaxon::class); |
42 | - if($jaxon->canProcessRequest()) // We have an ajax request with Jaxon |
|
41 | + if($jaxon->canProcessRequest()) { |
|
42 | + // We have an ajax request with Jaxon |
|
43 | 43 | { |
44 | 44 | throw new AuthenticationException(); |
45 | 45 | } |
46 | + } |
|
46 | 47 | |
47 | 48 | throw $e; |
48 | 49 | } |
@@ -21,10 +21,12 @@ |
||
21 | 21 | protected function unauthenticated($request, array $guards) |
22 | 22 | { |
23 | 23 | $jaxon = App::make(Jaxon::class); |
24 | - if($jaxon->canProcessRequest()) // We have an ajax request with Jaxon |
|
24 | + if($jaxon->canProcessRequest()) { |
|
25 | + // We have an ajax request with Jaxon |
|
25 | 26 | { |
26 | 27 | throw new \Siak\Tontine\Exception\AuthenticationException(); |
27 | 28 | } |
29 | + } |
|
28 | 30 | |
29 | 31 | throw new AuthenticationException( |
30 | 32 | 'Unauthenticated.', $guards, $this->redirectTo($request) |
@@ -196,13 +196,17 @@ |
||
196 | 196 | $this->response; |
197 | 197 | } |
198 | 198 | // Set the missing field in each item of the charge array. |
199 | - if($group === self::GROUP_FIXED) // Fixed charge |
|
199 | + if($group === self::GROUP_FIXED) { |
|
200 | + // Fixed charge |
|
200 | 201 | { |
201 | 202 | $formValues['type'] = ChargeModel::TYPE_FEE; |
202 | 203 | } |
203 | - if($group === self::GROUP_VARIABLE) // Variable charge |
|
204 | + } |
|
205 | + if($group === self::GROUP_VARIABLE) { |
|
206 | + // Variable charge |
|
204 | 207 | { |
205 | 208 | $formValues['period'] = ChargeModel::PERIOD_NONE; |
209 | + } |
|
206 | 210 | if(empty($formValues['fixed'])) |
207 | 211 | { |
208 | 212 | $formValues['amount'] = 0; |
@@ -230,8 +230,7 @@ discard block |
||
230 | 230 | { |
231 | 231 | $disbursement->charge_lendable = $charge->lendable; |
232 | 232 | $disbursement->charge()->associate($charge); |
233 | - } |
|
234 | - else |
|
233 | + } else |
|
235 | 234 | { |
236 | 235 | $disbursement->charge_lendable = true; |
237 | 236 | } |
@@ -269,8 +268,7 @@ discard block |
||
269 | 268 | if(($member)) |
270 | 269 | { |
271 | 270 | $disbursement->member()->associate($member); |
272 | - } |
|
273 | - else |
|
271 | + } else |
|
274 | 272 | { |
275 | 273 | $disbursement->member()->dissociate(); |
276 | 274 | } |
@@ -278,8 +276,7 @@ discard block |
||
278 | 276 | { |
279 | 277 | $disbursement->charge_lendable = $charge->lendable; |
280 | 278 | $disbursement->charge()->associate($charge); |
281 | - } |
|
282 | - else |
|
279 | + } else |
|
283 | 280 | { |
284 | 281 | $disbursement->charge_lendable = true; |
285 | 282 | $disbursement->charge()->dissociate(); |
@@ -97,8 +97,7 @@ |
||
97 | 97 | if($pool->remit_auction) |
98 | 98 | { |
99 | 99 | $subscriptions = collect([]); |
100 | - } |
|
101 | - else |
|
100 | + } else |
|
102 | 101 | { |
103 | 102 | $subscriptions = $subscriptions->pluck('member.name', 'id')->sort(); |
104 | 103 | $subscriptions->prepend('', 0); |
@@ -178,8 +178,7 @@ |
||
178 | 178 | $session->disabledPools()->detach(); |
179 | 179 | $session->delete(); |
180 | 180 | }); |
181 | - } |
|
182 | - catch(Exception $e) |
|
181 | + } catch(Exception $e) |
|
183 | 182 | { |
184 | 183 | throw new MessageException(trans('tontine.session.errors.delete')); |
185 | 184 | } |
@@ -142,8 +142,7 @@ |
||
142 | 142 | $pool->subscriptions()->delete(); |
143 | 143 | $pool->delete(); |
144 | 144 | }); |
145 | - } |
|
146 | - catch(Exception $e) |
|
145 | + } catch(Exception $e) |
|
147 | 146 | { |
148 | 147 | throw new MessageException(trans('tontine.errors.action') . |
149 | 148 | '<br/>' . trans('tontine.pool.errors.subscription')); |
@@ -155,8 +155,7 @@ |
||
155 | 155 | if($fund !== null) |
156 | 156 | { |
157 | 157 | $saving->fund()->associate($fund); |
158 | - } |
|
159 | - else |
|
158 | + } else |
|
160 | 159 | { |
161 | 160 | $saving->fund()->dissociate(); |
162 | 161 | } |
@@ -228,8 +228,7 @@ |
||
228 | 228 | if($fund !== null) |
229 | 229 | { |
230 | 230 | $loan->fund()->associate($fund); |
231 | - } |
|
232 | - else |
|
231 | + } else |
|
233 | 232 | { |
234 | 233 | $loan->fund()->dissociate(); |
235 | 234 | } |