@@ -100,7 +100,7 @@ |
||
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; |
@@ -27,7 +27,7 @@ |
||
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 | { |
@@ -46,18 +46,18 @@ discard block |
||
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 |
||
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 | } |
@@ -22,8 +22,7 @@ |
||
22 | 22 | $page = $this->browser->createPage(); |
23 | 23 | $page->setHtml($html); |
24 | 24 | return $page->pdf($config)->getBase64(); |
25 | - } |
|
26 | - finally |
|
25 | + } finally |
|
27 | 26 | { |
28 | 27 | $this->browser->close(); |
29 | 28 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | $config = [ |
24 | 24 | ...$this->config, |
25 | 25 | ...$config, |
26 | - 'headerTemplate' => (string)view("$templatePath.tpl.header"), |
|
27 | - 'footerTemplate' => (string)view("$templatePath.tpl.footer"), |
|
26 | + 'headerTemplate' => (string) view("$templatePath.tpl.header"), |
|
27 | + 'footerTemplate' => (string) view("$templatePath.tpl.footer"), |
|
28 | 28 | ]; |
29 | - return GeneratorFacade::getPdf((string)view($templatePath), $config); |
|
29 | + return GeneratorFacade::getPdf((string) view($templatePath), $config); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -20,7 +20,7 @@ |
||
20 | 20 | 'reports.template' => 'required|string|in:default,raptor', |
21 | 21 | ]); |
22 | 22 | |
23 | - if($validator->fails()) |
|
23 | + if ($validator->fails()) |
|
24 | 24 | { |
25 | 25 | throw new ValidationException($validator); |
26 | 26 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | 'title' => trans('common.actions.cancel'), |
49 | 49 | 'class' => 'btn btn-tertiary', |
50 | 50 | 'click' => 'close', |
51 | - ],[ |
|
51 | + ], [ |
|
52 | 52 | 'title' => trans('common.actions.save'), |
53 | 53 | 'class' => 'btn btn-primary', |
54 | 54 | 'click' => $this->rq()->saveOptions(pm()->form('options-form')), |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | public function selectCurrencies(string $countryCode) |
17 | 17 | { |
18 | - $html= $this->render('pages.tontine.currency', [ |
|
18 | + $html = $this->render('pages.tontine.currency', [ |
|
19 | 19 | 'currencies' => $this->localeService->getCountryCurrencies($countryCode) |
20 | 20 | ]); |
21 | 21 | $this->response->html('select_currency_container', $html); |
@@ -53,25 +53,25 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function getRemitmentCount(int $sessionCount, int $subscriptionCount, int $sessionPosition): int |
55 | 55 | { |
56 | - if($sessionCount === 0 || $subscriptionCount === 0) |
|
56 | + if ($sessionCount === 0 || $subscriptionCount === 0) |
|
57 | 57 | { |
58 | 58 | return 0; |
59 | 59 | } |
60 | 60 | |
61 | 61 | // Greatest common divisor |
62 | - $gcd = (int)gmp_gcd($sessionCount, $subscriptionCount); |
|
63 | - $sessionsInLoop = (int)($sessionCount / $gcd); |
|
62 | + $gcd = (int) gmp_gcd($sessionCount, $subscriptionCount); |
|
63 | + $sessionsInLoop = (int) ($sessionCount / $gcd); |
|
64 | 64 | $positionInLoop = $sessionPosition % $sessionsInLoop; |
65 | - $subscriptionsInLoop = (int)($subscriptionCount / $gcd); |
|
65 | + $subscriptionsInLoop = (int) ($subscriptionCount / $gcd); |
|
66 | 66 | $extraSubscriptionsInLoop = $subscriptionsInLoop % $sessionsInLoop; |
67 | 67 | |
68 | 68 | // There's is an extra remitment when the modulo decreases compared to the previous session. |
69 | 69 | $prevModulo = ($positionInLoop * $extraSubscriptionsInLoop) % $sessionsInLoop; |
70 | - if($prevModulo > ($prevModulo + $extraSubscriptionsInLoop) % $sessionsInLoop) |
|
70 | + if ($prevModulo > ($prevModulo + $extraSubscriptionsInLoop) % $sessionsInLoop) |
|
71 | 71 | { |
72 | - return (int)floor($subscriptionCount / $sessionCount) + 1; |
|
72 | + return (int) floor($subscriptionCount / $sessionCount) + 1; |
|
73 | 73 | } |
74 | - return (int)floor($subscriptionCount / $sessionCount); |
|
74 | + return (int) floor($subscriptionCount / $sessionCount); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -109,15 +109,14 @@ discard block |
||
109 | 109 | $position = 0; |
110 | 110 | $cashier = 0; |
111 | 111 | $expectedFigures = []; |
112 | - foreach($sessions as $session) |
|
112 | + foreach ($sessions as $session) |
|
113 | 113 | { |
114 | 114 | $figures = $this->makeFigures(0); |
115 | 115 | $figures->cashier->start = $cashier; |
116 | 116 | $figures->cashier->recv = $cashier + $depositAmount; |
117 | 117 | $figures->deposit->count = $depositCount; |
118 | 118 | $figures->deposit->amount = $depositAmount; |
119 | - $figures->remitment->count = !$pool->deposit_fixed ? 1 : |
|
120 | - $this->getRemitmentCount($sessionCount, $subscriptionCount, $position++); |
|
119 | + $figures->remitment->count = !$pool->deposit_fixed ? 1 : $this->getRemitmentCount($sessionCount, $subscriptionCount, $position++); |
|
121 | 120 | $figures->remitment->amount = $remitmentAmount * $figures->remitment->count; |
122 | 121 | $figures->cashier->end = $cashier + $depositAmount - $figures->remitment->amount; |
123 | 122 | $cashier = $figures->cashier->end; |