Completed
Pull Request — master (#1882)
by Rico
18:58 queued 10:07
created
app/Http/Controllers/AccountController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function edit(Tree $tree, User $user): Response
49 49
     {
50
-        $allow_user_themes    = (bool)Site::getPreference('ALLOW_USER_THEMES');
50
+        $allow_user_themes    = (bool) Site::getPreference('ALLOW_USER_THEMES');
51 51
         $my_individual_record = Individual::getInstance($tree->getUserPreference(Auth::user(), 'gedcomid'), $tree);
52 52
         $contact_methods      = FunctionsEdit::optionsContactMethods();
53 53
         $default_individual   = Individual::getInstance($tree->getUserPreference(Auth::user(), 'rootid'), $tree);
@@ -82,16 +82,16 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function update(Request $request, Tree $tree, User $user): RedirectResponse
84 84
     {
85
-        $contact_method = (string)$request->get('contact_method');
86
-        $email          = (string)$request->get('email');
87
-        $language       = (string)$request->get('language');
88
-        $real_name      = (string)$request->get('real_name');
89
-        $password       = (string)$request->get('password');
90
-        $rootid         = (string)$request->get('root_id');
91
-        $theme          = (string)$request->get('theme');
92
-        $time_zone      = (string)$request->get('timezone');
93
-        $user_name      = (string)$request->get('user_name');
94
-        $visible_online = (string)$request->get('visible_online');
85
+        $contact_method = (string) $request->get('contact_method');
86
+        $email          = (string) $request->get('email');
87
+        $language       = (string) $request->get('language');
88
+        $real_name      = (string) $request->get('real_name');
89
+        $password       = (string) $request->get('password');
90
+        $rootid         = (string) $request->get('root_id');
91
+        $theme          = (string) $request->get('theme');
92
+        $time_zone      = (string) $request->get('timezone');
93
+        $user_name      = (string) $request->get('user_name');
94
+        $visible_online = (string) $request->get('visible_online');
95 95
 
96 96
         // Change the password
97 97
         if ($password !== '') {
Please login to merge, or discard this patch.
app/Http/Controllers/EditGedcomRecordController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -290,8 +290,8 @@  discard block
 block discarded – undo
290 290
     public function editRawRecordAction(Request $request, Tree $tree): Response
291 291
     {
292 292
         $xref     = $request->get('xref');
293
-        $facts    = (array)$request->get('fact');
294
-        $fact_ids = (array)$request->get('fact_id');
293
+        $facts    = (array) $request->get('fact');
294
+        $fact_ids = (array) $request->get('fact_id');
295 295
         $record   = GedcomRecord::getInstance($xref, $tree);
296 296
 
297 297
         $this->checkRecordAccess($record, true);
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
         $record = GedcomRecord::getInstance($xref, $tree);
396 396
         $this->checkRecordAccess($record, true);
397 397
 
398
-        $keep_chan = (bool)$request->get('keep_chan');
398
+        $keep_chan = (bool) $request->get('keep_chan');
399 399
 
400 400
         $this->glevels = $request->get('glevels', []);
401 401
         $this->tag     = $request->get('tag', []);
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 
415 415
         $newged = '';
416 416
         if (!empty($_POST['NAME'])) {
417
-            $newged     .= "\n1 NAME " . $_POST['NAME'];
417
+            $newged .= "\n1 NAME " . $_POST['NAME'];
418 418
             $name_facts = [
419 419
                 'TYPE',
420 420
                 'NPFX',
Please login to merge, or discard this patch.
app/Http/Controllers/AutocompleteController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $pages = [];
85 85
 
86 86
         // Escape the query for MySQL and PHP, converting spaces to wildcards.
87
-        $like_query  = strtr($query, [
87
+        $like_query = strtr($query, [
88 88
             '_' => '\\_',
89 89
             '%' => '\\%',
90 90
             ' ' => '%',
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
      */
207 207
     public function select2Family(Request $request, Tree $tree): JsonResponse
208 208
     {
209
-        $page  = (int)$request->get('page');
209
+        $page  = (int) $request->get('page');
210 210
         $query = $request->get('q');
211 211
 
212 212
         return new JsonResponse(Select2::familySearch($tree, $page, $query));
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     public function select2Flag(Request $request): JsonResponse
221 221
     {
222 222
         $page  = $request->get('page');
223
-        $query = (int)$request->get('q');
223
+        $query = (int) $request->get('q');
224 224
 
225 225
         return new JsonResponse(Select2::flagSearch($page, $query));
226 226
     }
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      */
234 234
     public function select2Individual(Request $request, Tree $tree): JsonResponse
235 235
     {
236
-        $page  = (int)$request->get('page');
236
+        $page  = (int) $request->get('page');
237 237
         $query = $request->get('q');
238 238
 
239 239
         return new JsonResponse(Select2::individualSearch($tree, $page, $query));
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      */
248 248
     public function select2MediaObject(Request $request, Tree $tree): JsonResponse
249 249
     {
250
-        $page  = (int)$request->get('page');
250
+        $page  = (int) $request->get('page');
251 251
         $query = $request->get('q');
252 252
 
253 253
         return new JsonResponse(Select2::mediaObjectSearch($tree, $page, $query));
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
      */
262 262
     public function select2Note(Request $request, Tree $tree): JsonResponse
263 263
     {
264
-        $page  = (int)$request->get('page');
264
+        $page  = (int) $request->get('page');
265 265
         $query = $request->get('q');
266 266
 
267 267
         return new JsonResponse(Select2::noteSearch($tree, $page, $query));
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
      */
276 276
     public function select2Place(Request $request, Tree $tree): JsonResponse
277 277
     {
278
-        $page  = (int)$request->get('page');
278
+        $page  = (int) $request->get('page');
279 279
         $query = $request->get('q');
280 280
 
281 281
         return new JsonResponse(Select2::placeSearch($tree, $page, $query, true));
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
      */
290 290
     public function select2Repository(Request $request, Tree $tree): JsonResponse
291 291
     {
292
-        $page  = (int)$request->get('page');
292
+        $page  = (int) $request->get('page');
293 293
         $query = $request->get('q');
294 294
 
295 295
         return new JsonResponse(Select2::repositorySearch($tree, $page, $query));
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
      */
304 304
     public function select2Source(Request $request, Tree $tree): JsonResponse
305 305
     {
306
-        $page  = (int)$request->get('page');
306
+        $page  = (int) $request->get('page');
307 307
         $query = $request->get('q');
308 308
 
309 309
         return new JsonResponse(Select2::sourceSearch($tree, $page, $query));
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
      */
318 318
     public function select2Submitter(Request $request, Tree $tree): JsonResponse
319 319
     {
320
-        $page  = (int)$request->get('page');
320
+        $page  = (int) $request->get('page');
321 321
         $query = $request->get('q');
322 322
 
323 323
         return new JsonResponse(Select2::submitterSearch($tree, $page, $query));
Please login to merge, or discard this patch.
app/Http/Controllers/PendingChangesController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     {
99 99
         $url       = $request->get('url', '');
100 100
         $xref      = $request->get('xref', '');
101
-        $change_id = (int)$request->get('change_id');
101
+        $change_id = (int) $request->get('change_id');
102 102
 
103 103
         $changes = Database::prepare(
104 104
             "SELECT change_id, xref, old_gedcom, new_gedcom" .
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
     {
205 205
         $url       = $request->get('url', '');
206 206
         $xref      = $request->get('xref', '');
207
-        $change_id = (int)$request->get('change_id');
207
+        $change_id = (int) $request->get('change_id');
208 208
 
209 209
         // Reject a change, and subsequent changes to the same record
210 210
         Database::prepare(
Please login to merge, or discard this patch.
app/Module/UserMessagesModule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function postDeleteMessageAction(Request $request, Tree $tree): Response
57 57
     {
58
-        $message_ids = (array)$request->get('message_id', []);
58
+        $message_ids = (array) $request->get('message_id', []);
59 59
 
60 60
         $stmt = Database::prepare("DELETE FROM `##message` WHERE user_id = :user_id AND message_id = :message_id");
61 61
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
         $content = '';
102 102
         if (!empty($users)) {
103
-            $url     = route('user-page', ['ged' => $tree->getName()]);
103
+            $url = route('user-page', ['ged' => $tree->getName()]);
104 104
             $content .= '<form onsubmit="return $(&quot;#to&quot;).val() !== &quot;&quot;">';
105 105
             $content .= '<input type="hidden" name="route" value="message">';
106 106
             $content .= '<input type="hidden" name="ged" value="' . e($tree->getName()) . '">';
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                 $content .= '<td class="list_value_wrap"><a href="#" onclick="return expand_layer(\'message' . $message->message_id . '\');"><i id="message' . $message->message_id . '_img" class="icon-plus"></i> <b dir="auto">' . e($message->subject) . '</b></a></td>';
137 137
                 $content .= '<td class="list_value_wrap">' . FunctionsDate::formatTimestamp($message->created + WT_TIMESTAMP_OFFSET) . '</td>';
138 138
                 $content .= '<td class="list_value_wrap">';
139
-                $user    = User::findByIdentifier($message->sender);
139
+                $user = User::findByIdentifier($message->sender);
140 140
                 if ($user) {
141 141
                     $content .= '<span dir="auto">' . e($user->getRealName()) . '</span> - <span dir="auto">' . $user->getEmail() . '</span>';
142 142
                 } else {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                         'subject' => $message->subject,
159 159
                         'ged'     => $tree->getName(),
160 160
                     ]);
161
-                    $content   .= '<a class="btn btn-primary" href="' . e($reply_url) . '" title="' . I18N::translate('Reply') . '">' . I18N::translate('Reply') . '</a> ';
161
+                    $content .= '<a class="btn btn-primary" href="' . e($reply_url) . '" title="' . I18N::translate('Reply') . '">' . I18N::translate('Reply') . '</a> ';
162 162
                 }
163 163
                 $content .= '<button type="button" class="btn btn-danger" data-confirm="' . I18N::translate('Are you sure you want to delete this message? It cannot be retrieved later.') . '" onclick="if (confirm(this.dataset.confirm)) {$(\'#messageform :checkbox\').prop(\'checked\', false); $(\'#cb_message' . $message->message_id . '\').prop(\'checked\', true); document.messageform.submit();}">' . I18N::translate('Delete') . '</button></div></td></tr>';
164 164
             }
Please login to merge, or discard this patch.
app/Module/UserFavoritesModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@
 block discarded – undo
191 191
      */
192 192
     public function postDeleteFavoriteAction(Request $request, Tree $tree, User $user): RedirectResponse
193 193
     {
194
-        $favorite_id = (int)$request->get('favorite_id');
194
+        $favorite_id = (int) $request->get('favorite_id');
195 195
 
196 196
         if (Auth::check()) {
197 197
             Database::prepare(
Please login to merge, or discard this patch.
app/Module/FrequentlyAskedQuestionsModule.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public function postAdminDeleteAction(Request $request, Tree $tree): RedirectResponse
158 158
     {
159
-        $block_id = (int)$request->get('block_id');
159
+        $block_id = (int) $request->get('block_id');
160 160
 
161 161
         Database::prepare(
162 162
             "DELETE FROM `##block_setting` WHERE block_id = :block_id"
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public function postAdminMoveDownAction(Request $request, Tree $tree): RedirectResponse
186 186
     {
187
-        $block_id = (int)$request->get('block_id');
187
+        $block_id = (int) $request->get('block_id');
188 188
 
189 189
         $block_order = Database::prepare(
190 190
             "SELECT block_order FROM `##block` WHERE block_id = :block_id"
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
      */
238 238
     public function postAdminMoveUpAction(Request $request, Tree $tree): RedirectResponse
239 239
     {
240
-        $block_id = (int)$request->get('block_id');
240
+        $block_id = (int) $request->get('block_id');
241 241
 
242 242
         $block_order = Database::prepare(
243 243
             "SELECT block_order FROM `##block` WHERE block_id = :block_id"
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
     {
293 293
         $this->layout = 'layouts/administration';
294 294
 
295
-        $block_id = (int)$request->get('block_id');
295
+        $block_id = (int) $request->get('block_id');
296 296
 
297 297
         if ($block_id === 0) {
298 298
             // Creating a new faq
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
             )->execute([
304 304
                 'module_name' => $this->getName(),
305 305
             ])->fetchOne();
306
-            $languages   = [];
306
+            $languages = [];
307 307
 
308 308
             $title = I18N::translate('Add an FAQ');
309 309
         } else {
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      */
341 341
     public function postAdminEditAction(Request $request, Tree $tree): RedirectResponse
342 342
     {
343
-        $block_id  = (int)$request->get('block_id');
343
+        $block_id  = (int) $request->get('block_id');
344 344
         $faqbody   = $request->get('faqbody', '');
345 345
         $header    = $request->get('header', '');
346 346
         $languages = $request->get('languages', []);
Please login to merge, or discard this patch.
app/Module/FamilyTreeFavoritesModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -190,7 +190,7 @@
 block discarded – undo
190 190
      */
191 191
     public function postDeleteFavoriteAction(Request $request, Tree $tree, User $user): RedirectResponse
192 192
     {
193
-        $favorite_id = (int)$request->get('favorite_id');
193
+        $favorite_id = (int) $request->get('favorite_id');
194 194
 
195 195
         if (Auth::isManager($tree, $user)) {
196 196
             Database::prepare(
Please login to merge, or discard this patch.
app/Module/StoriesModule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             // Only show this block for certain languages
118 118
             $languages = $this->getBlockSetting($block_id, 'languages', '');
119 119
             if ($languages === '' || in_array(WT_LOCALE, explode(',', $languages))) {
120
-                $stories[] = (object)[
120
+                $stories[] = (object) [
121 121
                     'block_id'   => $block_id,
122 122
                     'title'      => $this->getBlockSetting($block_id, 'title'),
123 123
                     'story_body' => $this->getBlockSetting($block_id, 'story_body'),
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     {
212 212
         $this->layout = 'layouts/administration';
213 213
 
214
-        $block_id = (int)$request->get('block_id');
214
+        $block_id = (int) $request->get('block_id');
215 215
 
216 216
         if ($block_id === 0) {
217 217
             // Creating a new story
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
      */
257 257
     public function postAdminEditAction(Request $request, Tree $tree): RedirectResponse
258 258
     {
259
-        $block_id    = (int)$request->get('block_id');
259
+        $block_id    = (int) $request->get('block_id');
260 260
         $xref        = $request->get('xref', '');
261 261
         $story_body  = $request->get('story_body', '');
262 262
         $story_title = $request->get('story_title', '');
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
      */
303 303
     public function postAdminDeleteAction(Request $request, Tree $tree): Response
304 304
     {
305
-        $block_id = (int)$request->get('block_id');
305
+        $block_id = (int) $request->get('block_id');
306 306
 
307 307
         Database::prepare(
308 308
             "DELETE FROM `##block_setting` WHERE block_id = :block_id"
Please login to merge, or discard this patch.