Passed
Pull Request — main (#53)
by Thierry
09:04 queued 02:22
created
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.