@@ -35,13 +35,13 @@ discard block |
||
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 |
||
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 | } |
@@ -36,13 +36,13 @@ |
||
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 | } |
@@ -18,7 +18,7 @@ |
||
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 | } |
@@ -35,12 +35,11 @@ |
||
35 | 35 | { |
36 | 36 | $icon = '<i class="fa fa-toggle-off"></i>'; |
37 | 37 | $linkClass = "btn-add-$name"; |
38 | - if(($payment)) |
|
38 | + if (($payment)) |
|
39 | 39 | { |
40 | 40 | $icon = '<i class="fa fa-toggle-on"></i>'; |
41 | 41 | $linkClass = "btn-del-$name"; |
42 | 42 | } |
43 | 43 | |
44 | - return $disableLink ? $icon : |
|
45 | - '<a href="javascript:void(0)" class="' . $linkClass . '">' . $icon . '</a>'; |
|
44 | + return $disableLink ? $icon : '<a href="javascript:void(0)" class="' . $linkClass . '">' . $icon . '</a>'; |
|
46 | 45 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function addSettlement(int $billId) |
118 | 118 | { |
119 | - if($this->session->closed) |
|
119 | + if ($this->session->closed) |
|
120 | 120 | { |
121 | 121 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
122 | 122 | return $this->response; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function delSettlement(int $billId) |
137 | 137 | { |
138 | - if($this->session->closed) |
|
138 | + if ($this->session->closed) |
|
139 | 139 | { |
140 | 140 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
141 | 141 | return $this->response; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function addSettlement(int $billId) |
124 | 124 | { |
125 | - if($this->session->closed) |
|
125 | + if ($this->session->closed) |
|
126 | 126 | { |
127 | 127 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
128 | 128 | return $this->response; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function delSettlement(int $billId) |
146 | 146 | { |
147 | - if($this->session->closed) |
|
147 | + if ($this->session->closed) |
|
148 | 148 | { |
149 | 149 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
150 | 150 | return $this->response; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | public function addAllSettlements() |
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 |
||
184 | 184 | */ |
185 | 185 | public function delAllSettlements() |
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; |
@@ -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 | } |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function createSessions(array $values): bool |
65 | 65 | { |
66 | - foreach($values as &$value) |
|
66 | + foreach ($values as &$value) |
|
67 | 67 | { |
68 | 68 | $value['start_at'] = $value['date'] . ' ' . $value['start'] . ':00'; |
69 | 69 | $value['end_at'] = $value['date'] . ' ' . $value['end'] . ':00'; |
70 | 70 | } |
71 | 71 | DB::transaction(function() use($values) { |
72 | 72 | $sessions = $this->tenantService->round()->sessions()->createMany($values); |
73 | - foreach($sessions as $session) |
|
73 | + foreach ($sessions as $session) |
|
74 | 74 | { |
75 | 75 | $this->disableSessionOnPools($session); |
76 | 76 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | // Make sure the host belongs to the same tontine |
95 | 95 | $hostId = intval($values['host_id']); |
96 | 96 | $values['host_id'] = null; |
97 | - if($hostId > 0) |
|
97 | + if ($hostId > 0) |
|
98 | 98 | { |
99 | 99 | $values['host_id'] = $this->tenantService->tontine()->members()->find($hostId)->id; |
100 | 100 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $session->delete(); |
136 | 136 | }); |
137 | 137 | } |
138 | - catch(Exception $e) |
|
138 | + catch (Exception $e) |
|
139 | 139 | { |
140 | 140 | throw new MessageException(trans('tontine.session.errors.delete')); |
141 | 141 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $year = now()->format('Y'); |
150 | 150 | $date = Carbon::createFromDate($year, 1, 5, 'Africa/Douala')->locale('fr'); |
151 | 151 | $sessions = []; |
152 | - for($i = 0; $i < 12; $i++) |
|
152 | + for ($i = 0; $i < 12; $i++) |
|
153 | 153 | { |
154 | 154 | $session = new \stdClass(); |
155 | 155 | $session->title = 'Séance de ' . $date->isoFormat('MMMM YYYY'); |
@@ -36,13 +36,13 @@ |
||
36 | 36 | 'amount' => 'required|regex:/^\d+(\.\d{1,2})?$/', |
37 | 37 | 'deadline' => 'required|integer|min:1', |
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 | } |
@@ -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')); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * @return Builder|Relation |
26 | 26 | */ |
27 | - private function getQuery(): Builder|Relation |
|
27 | + private function getQuery(): Builder | Relation |
|
28 | 28 | { |
29 | 29 | return Pool::ofRound($this->tenantService->round()); |
30 | 30 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $pool->delete(); |
123 | 123 | }); |
124 | 124 | } |
125 | - catch(Exception $e) |
|
125 | + catch (Exception $e) |
|
126 | 126 | { |
127 | 127 | throw new MessageException(trans('tontine.errors.action') . |
128 | 128 | '<br/>' . trans('tontine.pool.errors.subscription')); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | // return; |
213 | 213 | // } |
214 | 214 | $session = $pool->sessions()->find($sessionId); |
215 | - if(!$session || $session->enabled($pool)) |
|
215 | + if (!$session || $session->enabled($pool)) |
|
216 | 216 | { |
217 | 217 | return; |
218 | 218 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | // return; |
240 | 240 | // } |
241 | 241 | $session = $pool->sessions()->find($sessionId); |
242 | - if(!$session || $session->disabled($pool)) |
|
242 | + if (!$session || $session->disabled($pool)) |
|
243 | 243 | { |
244 | 244 | return; |
245 | 245 | } |