Completed
Pull Request — master (#1854)
by Rico
09:04
created
app/Http/Controllers/AdminController.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             $user_list[$tmp_user->getUserName()] = $tmp_user->getUserName();
164 164
         }
165 165
 
166
-        $action   = $request->get('action');
166
+        $action = $request->get('action');
167 167
 
168 168
         // @TODO This ought to be a POST action
169 169
         if ($action === 'delete') {
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
      */
230 230
     public function changesLogData(Request $request): Response
231 231
     {
232
-        list($select, , $where, $args1) = $this->changesQuery($request);
232
+        list($select,, $where, $args1) = $this->changesQuery($request);
233 233
         list($order_by, $limit, $args2) = $this->dataTablesPagination($request);
234 234
 
235 235
         $rows = Database::prepare(
@@ -237,8 +237,8 @@  discard block
 block discarded – undo
237 237
         )->execute(array_merge($args1, $args2))->fetchAll();
238 238
 
239 239
         // Total filtered/unfiltered rows
240
-        $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne();
241
-        $recordsTotal    = (int)Database::prepare("SELECT COUNT(*) FROM `##change`")->fetchOne();
240
+        $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne();
241
+        $recordsTotal    = (int) Database::prepare("SELECT COUNT(*) FROM `##change`")->fetchOne();
242 242
 
243 243
         $data      = [];
244 244
         $algorithm = new MyersDiff();
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
         // See http://www.datatables.net/usage/server-side
291 291
         return new JsonResponse([
292
-            'draw'            => (int)$request->get('draw'),
292
+            'draw'            => (int) $request->get('draw'),
293 293
             'recordsTotal'    => $recordsTotal,
294 294
             'recordsFiltered' => $recordsFiltered,
295 295
             'data'            => $data,
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
      */
306 306
     public function changesLogDownload(Request $request): Response
307 307
     {
308
-        list($select, , $where, $args) = $this->changesQuery($request);
308
+        list($select,, $where, $args) = $this->changesQuery($request);
309 309
 
310 310
         $rows = Database::prepare($select . $where)->execute($args)->fetchAll();
311 311
 
@@ -447,8 +447,8 @@  discard block
 block discarded – undo
447 447
             'RESN',
448 448
         ];
449 449
 
450
-        $start  = (int)$request->get('start', 0);
451
-        $length = (int)$request->get('length', 20);
450
+        $start  = (int) $request->get('start', 0);
451
+        $length = (int) $request->get('length', 20);
452 452
         $search = $request->get('search', []);
453 453
         $search = $search['value'] ?? '';
454 454
 
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
         $args  = [];
469 469
 
470 470
         if ($search !== '') {
471
-            $where           .= " AND (multimedia_file_refn LIKE CONCAT('%', :search1, '%') OR multimedia_file_refn LIKE CONCAT('%', :search2, '%'))";
471
+            $where .= " AND (multimedia_file_refn LIKE CONCAT('%', :search1, '%') OR multimedia_file_refn LIKE CONCAT('%', :search2, '%'))";
472 472
             $args['search1'] = $search;
473 473
             $args['search2'] = $search;
474 474
         }
@@ -487,8 +487,8 @@  discard block
 block discarded – undo
487 487
         )->fetchAll();
488 488
 
489 489
         // Total filtered/unfiltered rows
490
-        $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne();
491
-        $recordsTotal    = (int)Database::prepare($select2)->fetchOne();
490
+        $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne();
491
+        $recordsTotal    = (int) Database::prepare($select2)->fetchOne();
492 492
 
493 493
         // Turn each row from the query into a row for the table
494 494
         $data = array_map(function (stdClass $datum) use ($ignore_facts) {
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
         }, $data);
531 531
 
532 532
         return new JsonResponse([
533
-            'draw'            => (int)$request->get('draw'),
533
+            'draw'            => (int) $request->get('draw'),
534 534
             'recordsTotal'    => $recordsTotal,
535 535
             'recordsFiltered' => $recordsFiltered,
536 536
             'data'            => $data,
@@ -619,8 +619,8 @@  discard block
 block discarded – undo
619 619
      */
620 620
     public function webtrees1ThumbnailsData(Request $request): JsonResponse
621 621
     {
622
-        $start  = (int)$request->get('start', 0);
623
-        $length = (int)$request->get('length', 20);
622
+        $start  = (int) $request->get('start', 0);
623
+        $length = (int) $request->get('length', 20);
624 624
         $search = $request->get('search', []);
625 625
         $search = $search['value'] ?? '';
626 626
 
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
         $data = array_map(function (string $thumbnail) {
652 652
             $original = $this->findOriginalFileFromThumbnail($thumbnail);
653 653
 
654
-            $original_url  = route('unused-media-thumbnail', [
654
+            $original_url = route('unused-media-thumbnail', [
655 655
                 'folder' => \dirname($original),
656 656
                 'file'   => basename($original),
657 657
                 'w'      => 100,
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
         }, $thumbnails);
694 694
 
695 695
         return new JsonResponse([
696
-            'draw'            => (int)$request->get('draw'),
696
+            'draw'            => (int) $request->get('draw'),
697 697
             'recordsTotal'    => $recordsTotal,
698 698
             'recordsFiltered' => $recordsFiltered,
699 699
             'data'            => $data,
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
      */
1020 1020
     public function treePrivacyUpdate(Request $request, Tree $tree): RedirectResponse
1021 1021
     {
1022
-        foreach ((array)$request->get('delete') as $default_resn_id) {
1022
+        foreach ((array) $request->get('delete') as $default_resn_id) {
1023 1023
             Database::prepare(
1024 1024
                 "DELETE FROM `##default_resn` WHERE default_resn_id = :default_resn_id"
1025 1025
             )->execute([
@@ -1027,13 +1027,13 @@  discard block
 block discarded – undo
1027 1027
             ]);
1028 1028
         }
1029 1029
 
1030
-        $xrefs     = (array)$request->get('xref');
1031
-        $tag_types = (array)$request->get('tag_type');
1032
-        $resns     = (array)$request->get('resn');
1030
+        $xrefs     = (array) $request->get('xref');
1031
+        $tag_types = (array) $request->get('tag_type');
1032
+        $resns     = (array) $request->get('resn');
1033 1033
 
1034 1034
         foreach ($xrefs as $n => $xref) {
1035
-            $tag_type = (string)$tag_types[$n];
1036
-            $resn     = (string)$resns[$n];
1035
+            $tag_type = (string) $tag_types[$n];
1036
+            $resn     = (string) $resns[$n];
1037 1037
 
1038 1038
             if ($tag_type !== '' || $xref !== '') {
1039 1039
                 // Delete any existing data
@@ -1079,10 +1079,10 @@  discard block
 block discarded – undo
1079 1079
         FlashMessages::addMessage(I18N::translate('The preferences for the family tree “%s” have been updated.', e($tree->getTitle()), 'success'));
1080 1080
 
1081 1081
         // Coming soon...
1082
-        if ((bool)$request->get('all_trees')) {
1082
+        if ((bool) $request->get('all_trees')) {
1083 1083
             FlashMessages::addMessage(I18N::translate('The preferences for all family trees have been updated.', e($tree->getTitle())), 'success');
1084 1084
         }
1085
-        if ((bool)$request->get('new_trees')) {
1085
+        if ((bool) $request->get('new_trees')) {
1086 1086
             FlashMessages::addMessage(I18N::translate('The preferences for new family trees have been updated.', e($tree->getTitle())), 'success');
1087 1087
         }
1088 1088
 
@@ -1105,7 +1105,7 @@  discard block
 block discarded – undo
1105 1105
         foreach ($modules as $module) {
1106 1106
             foreach (Tree::getAll() as $tree) {
1107 1107
                 $key          = 'access-' . $module->getName() . '-' . $tree->getTreeId();
1108
-                $access_level = (int)$request->get($key, $module->defaultAccessLevel());
1108
+                $access_level = (int) $request->get($key, $module->defaultAccessLevel());
1109 1109
 
1110 1110
                 Database::prepare("REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (:module_name, :tree_id, :component, :access_level)")->execute([
1111 1111
                     'module_name'  => $module->getName(),
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
         $module_status = Database::prepare("SELECT module_name, status FROM `##module`")->fetchAssoc();
1133 1133
 
1134 1134
         foreach ($modules as $module) {
1135
-            $new_status = (bool)$request->get('status-' . $module->getName()) ? 'enabled' : 'disabled';
1135
+            $new_status = (bool) $request->get('status-' . $module->getName()) ? 'enabled' : 'disabled';
1136 1136
             $old_status = $module_status[$module->getName()];
1137 1137
 
1138 1138
             if ($new_status !== $old_status) {
@@ -1195,36 +1195,36 @@  discard block
 block discarded – undo
1195 1195
         $where = ' WHERE 1';
1196 1196
         $args  = [];
1197 1197
         if ($search !== '') {
1198
-            $where            .= " AND (old_gedcom LIKE CONCAT('%', :search_1, '%') OR new_gedcom LIKE CONCAT('%', :search_2, '%'))";
1198
+            $where .= " AND (old_gedcom LIKE CONCAT('%', :search_1, '%') OR new_gedcom LIKE CONCAT('%', :search_2, '%'))";
1199 1199
             $args['search_1'] = $search;
1200 1200
             $args['search_2'] = $search;
1201 1201
         }
1202 1202
         if ($from !== '') {
1203
-            $where        .= " AND change_time >= :from";
1203
+            $where .= " AND change_time >= :from";
1204 1204
             $args['from'] = $from;
1205 1205
         }
1206 1206
         if ($to !== '') {
1207
-            $where      .= ' AND change_time < TIMESTAMPADD(DAY, 1 , :to)'; // before end of the day
1207
+            $where .= ' AND change_time < TIMESTAMPADD(DAY, 1 , :to)'; // before end of the day
1208 1208
             $args['to'] = $to;
1209 1209
         }
1210 1210
         if ($type !== '') {
1211
-            $where          .= ' AND status = :status';
1211
+            $where .= ' AND status = :status';
1212 1212
             $args['status'] = $type;
1213 1213
         }
1214 1214
         if ($oldged !== '') {
1215
-            $where           .= " AND old_gedcom LIKE CONCAT('%', :old_ged, '%')";
1215
+            $where .= " AND old_gedcom LIKE CONCAT('%', :old_ged, '%')";
1216 1216
             $args['old_ged'] = $oldged;
1217 1217
         }
1218 1218
         if ($newged !== '') {
1219
-            $where           .= " AND new_gedcom LIKE CONCAT('%', :new_ged, '%')";
1219
+            $where .= " AND new_gedcom LIKE CONCAT('%', :new_ged, '%')";
1220 1220
             $args['new_ged'] = $newged;
1221 1221
         }
1222 1222
         if ($xref !== '') {
1223
-            $where        .= " AND xref = :xref";
1223
+            $where .= " AND xref = :xref";
1224 1224
             $args['xref'] = $xref;
1225 1225
         }
1226 1226
         if ($username !== '') {
1227
-            $where        .= " AND user_name LIKE CONCAT('%', :user, '%')";
1227
+            $where .= " AND user_name LIKE CONCAT('%', :user, '%')";
1228 1228
             $args['user'] = $username;
1229 1229
         }
1230 1230
         if ($ged !== '') {
@@ -1275,8 +1275,8 @@  discard block
 block discarded – undo
1275 1275
      */
1276 1276
     private function dataTablesPagination(Request $request): array
1277 1277
     {
1278
-        $start  = (int)$request->get('start', '0');
1279
-        $length = (int)$request->get('length', '0');
1278
+        $start  = (int) $request->get('start', '0');
1279
+        $length = (int) $request->get('length', '0');
1280 1280
         $order  = $request->get('order', []);
1281 1281
         $args   = [];
1282 1282
 
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
         }
1428 1428
 
1429 1429
         // The maximum difference is 255 (black versus white).
1430
-        return 100 - (int)($max_difference * 100 / 255);
1430
+        return 100 - (int) ($max_difference * 100 / 255);
1431 1431
     }
1432 1432
 
1433 1433
     /**
@@ -1458,7 +1458,7 @@  discard block
 block discarded – undo
1458 1458
             $pixels[$x] = [];
1459 1459
             for ($y = 0; $y < $size; ++$y) {
1460 1460
                 $pixel          = $image->pickColor($x, $y);
1461
-                $pixels[$x][$y] = (int)(($pixel[0] + $pixel[1] + $pixel[2]) / 3);
1461
+                $pixels[$x][$y] = (int) (($pixel[0] + $pixel[1] + $pixel[2]) / 3);
1462 1462
             }
1463 1463
         }
1464 1464
 
Please login to merge, or discard this patch.
app/Http/Controllers/StatisticsChartController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
                         $z_axis = $this->axisAll();
577 577
                         // The stats query doesn't have an "all" function, so query M/F/U separately
578 578
                         foreach (['M', 'F', 'U'] as $sex) {
579
-                            $rows  = $stats->statsMarrAgeQuery(false, $sex);
579
+                            $rows = $stats->statsMarrAgeQuery(false, $sex);
580 580
                             $indi = [];
581 581
                             foreach ($rows as $row) {
582 582
                                 if (!\in_array($row->d_gid, $indi)) {
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
                     case self::Z_AXIS_SEX:
590 590
                         $z_axis = $this->axisSexes();
591 591
                         foreach (array_keys($z_axis) as $sex) {
592
-                            $rows  = $stats->statsMarrAgeQuery(false, $sex);
592
+                            $rows = $stats->statsMarrAgeQuery(false, $sex);
593 593
                             $indi = [];
594 594
                             foreach ($rows as $row) {
595 595
                                 if (!\in_array($row->d_gid, $indi)) {
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
                         // The stats query doesn't have an "all" function, so query M/F/U separately
606 606
                         foreach (['M', 'F', 'U'] as $sex) {
607 607
                             $prev_boundary = 0;
608
-                            $indi   = [];
608
+                            $indi = [];
609 609
                             foreach (array_keys($z_axis) as $boundary) {
610 610
                                 $rows = $stats->statsMarrAgeQuery(false, $sex, $prev_boundary, $boundary);
611 611
                                 foreach ($rows as $row) {
Please login to merge, or discard this patch.
app/Http/Controllers/SearchController.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -163,11 +163,11 @@  discard block
 block discarded – undo
163 163
         $query = $request->get('query', '');
164 164
 
165 165
         // What type of records to search?
166
-        $search_individuals  = (bool)$request->get('search_individuals');
167
-        $search_families     = (bool)$request->get('search_families');
168
-        $search_repositories = (bool)$request->get('search_repositories');
169
-        $search_sources      = (bool)$request->get('search_sources');
170
-        $search_notes        = (bool)$request->get('search_notes');
166
+        $search_individuals  = (bool) $request->get('search_individuals');
167
+        $search_families     = (bool) $request->get('search_families');
168
+        $search_repositories = (bool) $request->get('search_repositories');
169
+        $search_sources      = (bool) $request->get('search_sources');
170
+        $search_notes        = (bool) $request->get('search_notes');
171 171
 
172 172
         // Default to individuals only
173 173
         if (!$search_individuals && !$search_families && !$search_repositories && !$search_sources && !$search_notes) {
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
             $all_trees = [$tree];
185 185
         }
186 186
 
187
-        $search_tree_names = (array)$request->get('search_trees', []);
187
+        $search_tree_names = (array) $request->get('search_trees', []);
188 188
 
189 189
         $search_trees = array_filter($all_trees, function (Tree $tree) use ($search_tree_names): bool {
190 190
             return \in_array($tree->getName(), $search_tree_names);
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
             $all_trees = [$tree];
291 291
         }
292 292
 
293
-        $search_tree_names = (array)$request->get('search_trees', []);
293
+        $search_tree_names = (array) $request->get('search_trees', []);
294 294
 
295 295
         $search_trees = array_filter($all_trees, function (Tree $tree) use ($search_tree_names): bool {
296 296
             return \in_array($tree->getName(), $search_tree_names);
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 
641 641
         foreach ($search_terms as $n => $q) {
642 642
             $queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
643
-            $sql                   .= " AND f_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
643
+            $sql .= " AND f_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
644 644
             $args['collate_' . $n] = I18N::collation();
645 645
             $args['query_' . $n]   = Database::escapeLike($q);
646 646
         }
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
      */
689 689
     private function searchFamilyNames(array $search_terms, array $search_trees): array
690 690
     {
691
-        $sql  =
691
+        $sql =
692 692
             "SELECT DISTINCT f_id AS xref, f_file AS gedcom_id, f_gedcom AS gedcom" .
693 693
             " FROM `##families`" .
694 694
             " LEFT JOIN `##name` husb ON f_husb = husb.n_id AND f_file = husb.n_file" .
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
         $args = [];
698 698
 
699 699
         foreach ($search_terms as $n => $q) {
700
-            $sql                        .= " AND (husb.n_full COLLATE :husb_collate_" . $n . " LIKE CONCAT('%', :husb_query_" . $n . ", '%') OR wife.n_full COLLATE :wife_collate_" . $n . " LIKE CONCAT('%', :wife_query_" . $n . ", '%'))";
700
+            $sql .= " AND (husb.n_full COLLATE :husb_collate_" . $n . " LIKE CONCAT('%', :husb_query_" . $n . ", '%') OR wife.n_full COLLATE :wife_collate_" . $n . " LIKE CONCAT('%', :wife_query_" . $n . ", '%'))";
701 701
             $args['husb_collate_' . $n] = I18N::collation();
702 702
             $args['husb_query_' . $n]   = Database::escapeLike($q);
703 703
             $args['wife_collate_' . $n] = I18N::collation();
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 
750 750
         foreach ($search_terms as $n => $q) {
751 751
             $queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
752
-            $sql                   .= " AND i_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
752
+            $sql .= " AND i_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
753 753
             $args['collate_' . $n] = I18N::collation();
754 754
             $args['query_' . $n]   = Database::escapeLike($q);
755 755
         }
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
         }
897 897
 
898 898
         // Add the where clause
899
-        $sql    .= " WHERE ind.i_file=?";
899
+        $sql .= " WHERE ind.i_file=?";
900 900
         $bind[] = $tree->getTreeId();
901 901
 
902 902
         foreach ($fields as $field_name => $field_value) {
@@ -907,15 +907,15 @@  discard block
 block discarded – undo
907 907
                     case 'GIVN':
908 908
                         switch ($modifiers[$field_name]) {
909 909
                             case 'EXACT':
910
-                                $sql    .= " AND i_n.n_givn=?";
910
+                                $sql .= " AND i_n.n_givn=?";
911 911
                                 $bind[] = $field_value;
912 912
                                 break;
913 913
                             case 'BEGINS':
914
-                                $sql    .= " AND i_n.n_givn LIKE CONCAT(?, '%')";
914
+                                $sql .= " AND i_n.n_givn LIKE CONCAT(?, '%')";
915 915
                                 $bind[] = $field_value;
916 916
                                 break;
917 917
                             case 'CONTAINS':
918
-                                $sql    .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
918
+                                $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
919 919
                                 $bind[] = $field_value;
920 920
                                 break;
921 921
                             case 'SDX_STD':
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
                                     $sql .= ' AND (' . implode(' OR ', $sdx) . ')';
930 930
                                 } else {
931 931
                                     // No phonetic content? Use a substring match
932
-                                    $sql    .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
932
+                                    $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
933 933
                                     $bind[] = $field_value;
934 934
                                 }
935 935
                                 break;
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
                                     $sql .= ' AND (' . implode(' OR ', $sdx) . ')';
946 946
                                 } else {
947 947
                                     // No phonetic content? Use a substring match
948
-                                    $sql    .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
948
+                                    $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
949 949
                                     $bind[] = $field_value;
950 950
                                 }
951 951
                                 break;
@@ -954,15 +954,15 @@  discard block
 block discarded – undo
954 954
                     case 'SURN':
955 955
                         switch ($modifiers[$field_name]) {
956 956
                             case 'EXACT':
957
-                                $sql    .= " AND i_n.n_surname=?";
957
+                                $sql .= " AND i_n.n_surname=?";
958 958
                                 $bind[] = $field_value;
959 959
                                 break;
960 960
                             case 'BEGINS':
961
-                                $sql    .= " AND i_n.n_surname LIKE CONCAT(?, '%')";
961
+                                $sql .= " AND i_n.n_surname LIKE CONCAT(?, '%')";
962 962
                                 $bind[] = $field_value;
963 963
                                 break;
964 964
                             case 'CONTAINS':
965
-                                $sql    .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')";
965
+                                $sql .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')";
966 966
                                 $bind[] = $field_value;
967 967
                                 break;
968 968
                             case 'SDX_STD':
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
                                     $sql .= " AND (" . implode(' OR ', $sdx) . ")";
977 977
                                 } else {
978 978
                                     // No phonetic content? Use a substring match
979
-                                    $sql    .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
979
+                                    $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
980 980
                                     $bind[] = $field_value;
981 981
                                 }
982 982
                                 break;
@@ -993,7 +993,7 @@  discard block
 block discarded – undo
993 993
                                     break;
994 994
                                 } else {
995 995
                                     // No phonetic content? Use a substring match
996
-                                    $sql    .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
996
+                                    $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
997 997
                                     $bind[] = $field_value;
998 998
                                 }
999 999
                         }
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
                     case '_MARNM':
1003 1003
                     case '_HEB':
1004 1004
                     case '_AKA':
1005
-                        $sql    .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')";
1005
+                        $sql .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')";
1006 1006
                         $bind[] = $parts[1];
1007 1007
                         $bind[] = $field_value;
1008 1008
                         break;
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
                 $date = new Date($field_value);
1013 1013
                 if ($date->isOK()) {
1014 1014
                     $delta  = 365 * ($modifiers[$field_name] ?? 0);
1015
-                    $sql    .= " AND i_d.d_fact=? AND i_d.d_julianday1>=? AND i_d.d_julianday2<=?";
1015
+                    $sql .= " AND i_d.d_fact=? AND i_d.d_julianday1>=? AND i_d.d_julianday2<=?";
1016 1016
                     $bind[] = $parts[0];
1017 1017
                     $bind[] = $date->minimumJulianDay() - $delta;
1018 1018
                     $bind[] = $date->maximumJulianDay() + $delta;
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
                 $date = new Date($field_value);
1023 1023
                 if ($date->isOK()) {
1024 1024
                     $delta  = 365 * $modifiers[$field_name];
1025
-                    $sql    .= " AND f_d.d_fact=? AND f_d.d_julianday1>=? AND f_d.d_julianday2<=?";
1025
+                    $sql .= " AND f_d.d_fact=? AND f_d.d_julianday1>=? AND f_d.d_julianday2<=?";
1026 1026
                     $bind[] = $parts[1];
1027 1027
                     $bind[] = $date->minimumJulianDay() - $delta;
1028 1028
                     $bind[] = $date->maximumJulianDay() + $delta;
@@ -1030,12 +1030,12 @@  discard block
 block discarded – undo
1030 1030
             } elseif ($parts[1] === 'PLAC') {
1031 1031
                 // *:PLAC
1032 1032
                 // SQL can only link a place to a person/family, not to an event.
1033
-                $sql    .= " AND i_p.place LIKE CONCAT('%', ?, '%')";
1033
+                $sql .= " AND i_p.place LIKE CONCAT('%', ?, '%')";
1034 1034
                 $bind[] = $field_value;
1035 1035
             } elseif ($parts[0] === 'FAMS' && $parts[2] === 'PLAC') {
1036 1036
                 // FAMS:*:PLAC
1037 1037
                 // SQL can only link a place to a person/family, not to an event.
1038
-                $sql    .= " AND f_p.place LIKE CONCAT('%', ?, '%')";
1038
+                $sql .= " AND f_p.place LIKE CONCAT('%', ?, '%')";
1039 1039
                 $bind[] = $field_value;
1040 1040
             } elseif ($parts[0] === 'FAMC' && $parts[2] === 'NAME') {
1041 1041
                 $table = $parts[1] === 'HUSB' ? 'f_n' : 'm_n';
@@ -1044,15 +1044,15 @@  discard block
 block discarded – undo
1044 1044
                     case 'GIVN':
1045 1045
                         switch ($modifiers[$field_name]) {
1046 1046
                             case 'EXACT':
1047
-                                $sql    .= " AND {$table}.n_givn=?";
1047
+                                $sql .= " AND {$table}.n_givn=?";
1048 1048
                                 $bind[] = $field_value;
1049 1049
                                 break;
1050 1050
                             case 'BEGINS':
1051
-                                $sql    .= " AND {$table}.n_givn LIKE CONCAT(?, '%')";
1051
+                                $sql .= " AND {$table}.n_givn LIKE CONCAT(?, '%')";
1052 1052
                                 $bind[] = $field_value;
1053 1053
                                 break;
1054 1054
                             case 'CONTAINS':
1055
-                                $sql    .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
1055
+                                $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
1056 1056
                                 $bind[] = $field_value;
1057 1057
                                 break;
1058 1058
                             case 'SDX_STD':
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
                                     $sql .= ' AND (' . implode(' OR ', $sdx) . ')';
1067 1067
                                 } else {
1068 1068
                                     // No phonetic content? Use a substring match
1069
-                                    $sql    .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
1069
+                                    $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
1070 1070
                                     $bind[] = $field_value;
1071 1071
                                 }
1072 1072
                                 break;
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
                                     break;
1084 1084
                                 } else {
1085 1085
                                     // No phonetic content? Use a substring match
1086
-                                    $sql    .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
1086
+                                    $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
1087 1087
                                     $bind[] = $field_value;
1088 1088
                                 }
1089 1089
                         }
@@ -1091,15 +1091,15 @@  discard block
 block discarded – undo
1091 1091
                     case 'SURN':
1092 1092
                         switch ($modifiers[$field_name]) {
1093 1093
                             case 'EXACT':
1094
-                                $sql    .= " AND {$table}.n_surname=?";
1094
+                                $sql .= " AND {$table}.n_surname=?";
1095 1095
                                 $bind[] = $field_value;
1096 1096
                                 break;
1097 1097
                             case 'BEGINS':
1098
-                                $sql    .= " AND {$table}.n_surname LIKE CONCAT(?, '%')";
1098
+                                $sql .= " AND {$table}.n_surname LIKE CONCAT(?, '%')";
1099 1099
                                 $bind[] = $field_value;
1100 1100
                                 break;
1101 1101
                             case 'CONTAINS':
1102
-                                $sql    .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')";
1102
+                                $sql .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')";
1103 1103
                                 $bind[] = $field_value;
1104 1104
                                 break;
1105 1105
                             case 'SDX_STD':
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
                                     $sql .= ' AND (' . implode(' OR ', $sdx) . ')';
1114 1114
                                 } else {
1115 1115
                                     // No phonetic content? Use a substring match
1116
-                                    $sql    .= " AND {$table}.n_surn LIKE CONCAT('%', ?, '%')";
1116
+                                    $sql .= " AND {$table}.n_surn LIKE CONCAT('%', ?, '%')";
1117 1117
                                     $bind[] = $field_value;
1118 1118
                                 }
1119 1119
                                 break;
@@ -1129,7 +1129,7 @@  discard block
 block discarded – undo
1129 1129
                                     $sql .= ' AND (' . implode(' OR ', $sdx) . ')';
1130 1130
                                 } else {
1131 1131
                                     // No phonetic content? Use a substring match
1132
-                                    $sql    .= " AND {$table}.n_surn LIKE CONCAT('%', ?, '%')";
1132
+                                    $sql .= " AND {$table}.n_surn LIKE CONCAT('%', ?, '%')";
1133 1133
                                     $bind[] = $field_value;
1134 1134
                                 }
1135 1135
                                 break;
@@ -1138,17 +1138,17 @@  discard block
 block discarded – undo
1138 1138
                 }
1139 1139
             } elseif ($parts[0] === 'FAMS') {
1140 1140
                 // e.g. searches for occupation, religion, note, etc.
1141
-                $sql    .= " AND fam.f_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)";
1141
+                $sql .= " AND fam.f_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)";
1142 1142
                 $bind[] = $parts[1];
1143 1143
                 $bind[] = $field_value;
1144 1144
             } elseif ($parts[1] === 'TYPE') {
1145 1145
                 // e.g. FACT:TYPE or EVEN:TYPE
1146
-                $sql    .= " AND ind.i_gedcom REGEXP CONCAT('\n1 ', ?, '.*(\n[2-9] .*)*\n2 TYPE .*', ?)";
1146
+                $sql .= " AND ind.i_gedcom REGEXP CONCAT('\n1 ', ?, '.*(\n[2-9] .*)*\n2 TYPE .*', ?)";
1147 1147
                 $bind[] = $parts[0];
1148 1148
                 $bind[] = $field_value;
1149 1149
             } else {
1150 1150
                 // e.g. searches for occupation, religion, note, etc.
1151
-                $sql    .= " AND ind.i_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)";
1151
+                $sql .= " AND ind.i_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)";
1152 1152
                 $bind[] = $parts[0];
1153 1153
                 $bind[] = $field_value;
1154 1154
             }
@@ -1227,7 +1227,7 @@  discard block
 block discarded – undo
1227 1227
         $sql .= ")";
1228 1228
 
1229 1229
         if ($givn_sdx !== '') {
1230
-            $sql      .= " AND (";
1230
+            $sql .= " AND (";
1231 1231
             $givn_sdx = explode(':', $givn_sdx);
1232 1232
             foreach ($givn_sdx as $n => $sdx) {
1233 1233
                 $sql .= $n > 0 ? " OR " : "";
@@ -1245,7 +1245,7 @@  discard block
 block discarded – undo
1245 1245
         }
1246 1246
 
1247 1247
         if ($surn_sdx !== '') {
1248
-            $sql      .= " AND (";
1248
+            $sql .= " AND (";
1249 1249
             $surn_sdx = explode(':', $surn_sdx);
1250 1250
             foreach ($surn_sdx as $n => $sdx) {
1251 1251
                 $sql .= $n ? " OR " : "";
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
         }
1264 1264
 
1265 1265
         if ($plac_sdx !== '') {
1266
-            $sql      .= " AND (";
1266
+            $sql .= " AND (";
1267 1267
             $plac_sdx = explode(':', $plac_sdx);
1268 1268
             foreach ($plac_sdx as $n => $sdx) {
1269 1269
                 $sql .= $n ? " OR " : "";
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
 
1311 1311
         foreach ($search_terms as $n => $q) {
1312 1312
             $queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
1313
-            $sql                   .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1313
+            $sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1314 1314
             $args['collate_' . $n] = I18N::collation();
1315 1315
             $args['query_' . $n]   = Database::escapeLike($q);
1316 1316
         }
@@ -1366,7 +1366,7 @@  discard block
 block discarded – undo
1366 1366
 
1367 1367
         foreach ($search_terms as $n => $q) {
1368 1368
             $queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
1369
-            $sql                   .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1369
+            $sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1370 1370
             $args['collate_' . $n] = I18N::collation();
1371 1371
             $args['query_' . $n]   = Database::escapeLike($q);
1372 1372
         }
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
 
1423 1423
         foreach ($search_terms as $n => $q) {
1424 1424
             $queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
1425
-            $sql                   .= " AND s_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1425
+            $sql .= " AND s_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1426 1426
             $args['collate_' . $n] = I18N::collation();
1427 1427
             $args['query_' . $n]   = Database::escapeLike($q);
1428 1428
         }
Please login to merge, or discard this patch.
app/Soundex.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3616,7 +3616,7 @@
 block discarded – undo
3616 3616
             $soundTableEntry = self::$dmsounds[$thisEntry];
3617 3617
             $workingResult   = $partialResult;
3618 3618
             $partialResult   = [];
3619
-            $currPos         += \strlen($thisEntry);
3619
+            $currPos += \strlen($thisEntry);
3620 3620
 
3621 3621
             // Not at beginning of input string
3622 3622
             if ($state != 1) {
Please login to merge, or discard this patch.
app/Report/ReportHtml.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             $this->pageh = $tmpw;
146 146
         }
147 147
         // Store the pagewidth without margins
148
-        $this->noMarginWidth = (int)($this->pagew - $this->leftmargin - $this->rightmargin);
148
+        $this->noMarginWidth = (int) ($this->pagew - $this->leftmargin - $this->rightmargin);
149 149
         // If RTL
150 150
         if ($this->rtl) {
151 151
             $this->alignRTL  = 'right';
@@ -727,14 +727,14 @@  discard block
 block discarded – undo
727 727
     public function textWrap($str, $width)
728 728
     {
729 729
         // Calculate the line width
730
-        $lw = (int)($width / ($this->getCurrentStyleHeight() / 2));
730
+        $lw = (int) ($width / ($this->getCurrentStyleHeight() / 2));
731 731
         // Wordwrap each line
732 732
         $lines = explode("\n", $str);
733 733
         // Line Feed counter
734 734
         $lfct     = \count($lines);
735 735
         $wraptext = '';
736 736
         foreach ($lines as $line) {
737
-            $wtext    = FunctionsRtl::utf8WordWrap($line, $lw, "\n", true);
737
+            $wtext = FunctionsRtl::utf8WordWrap($line, $lw, "\n", true);
738 738
             $wraptext .= $wtext;
739 739
             // Add a new line as long as it’s not the last line
740 740
             if ($lfct > 1) {
Please login to merge, or discard this patch.
app/Place.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 getShortName()
192 192
     {
193
-        $SHOW_PEDIGREE_PLACES = (int)$this->tree->getPreference('SHOW_PEDIGREE_PLACES');
193
+        $SHOW_PEDIGREE_PLACES = (int) $this->tree->getPreference('SHOW_PEDIGREE_PLACES');
194 194
 
195 195
         if ($SHOW_PEDIGREE_PLACES >= \count($this->gedcom_place)) {
196 196
             // A short place name - no need to abbreviate
Please login to merge, or discard this patch.
app/Functions/FunctionsEdit.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
         if ($islink) {
527 527
             $value = trim($value, '@');
528 528
         } else {
529
-            $value = (string)substr($tag, \strlen($fact) + 3);
529
+            $value = (string) substr($tag, \strlen($fact) + 3);
530 530
         }
531 531
         if ($fact === 'REPO' || $fact === 'SOUR' || $fact === 'OBJE' || $fact === 'FAMC') {
532 532
             $islink = true;
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
             $html .= '<p class="small text-muted">' . I18N::translate('Use this image for charts and on the individual’s page.') . '</p>';
812 812
         } elseif ($fact === 'TYPE' && $level === '3') {
813 813
             //-- Build the selector for the Media 'TYPE' Fact
814
-            $html          .= '<select name="text[]"><option selected value="" ></option>';
814
+            $html .= '<select name="text[]"><option selected value="" ></option>';
815 815
             $selectedValue = strtolower($value);
816 816
             if (!array_key_exists($selectedValue, GedcomTag::getFileFormTypes())) {
817 817
                 $html .= '<option selected value="' . e($value) . '" >' . e($value) . '</option>';
Please login to merge, or discard this patch.
app/Functions/FunctionsPrintFacts.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
             case '_BIRT_CHIL':
177 177
                 $children[$fact->getParent()->getXref()] = true;
178 178
                 /* I18N: Abbreviation for "number %s" */
179
-                $label                                   .= '<br>' . I18N::translate('#%s', \count($children));
179
+                $label .= '<br>' . I18N::translate('#%s', \count($children));
180 180
                 break;
181 181
             case '_BIRT_GCHI':
182 182
             case '_BIRT_GCH1':
183 183
             case '_BIRT_GCH2':
184 184
                 $grandchildren[$fact->getParent()->getXref()] = true;
185 185
                 /* I18N: Abbreviation for "number %s" */
186
-                $label                                        .= '<br>' . I18N::translate('#%s', \count($grandchildren));
186
+                $label .= '<br>' . I18N::translate('#%s', \count($grandchildren));
187 187
                 break;
188 188
         }
189 189
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
         for ($j = 0; $j < $ct; $j++) {
578 578
             if (strpos($match[$j][1], '@') === false) {
579 579
                 $source = e($match[$j][1] . preg_replace('/\n\d CONT ?/', "\n", $match[$j][2]));
580
-                $data   .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $tree) . '</span></div>';
580
+                $data .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $tree) . '</span></div>';
581 581
             }
582 582
         }
583 583
         // Find source for each fact
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
                     }
596 596
                     $srec      = substr($factrec, $spos1, $spos2 - $spos1);
597 597
                     $lt        = preg_match_all("/$nlevel \w+/", $srec, $matches);
598
-                    $data      .= '<div class="fact_SOUR">';
598
+                    $data .= '<div class="fact_SOUR">';
599 599
                     $elementID = Uuid::uuid4()->toString();
600 600
                     if ($tree->getPreference('EXPAND_SOURCES')) {
601 601
                         $plusminus = 'icon-minus';
Please login to merge, or discard this patch.
app/Date/CalendarDate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
         // Construct from an array (of three gedcom-style strings: "1900", "FEB", "4")
109 109
         if (\is_array($date)) {
110
-            $this->d = (int)$date[2];
110
+            $this->d = (int) $date[2];
111 111
             if (array_key_exists($date[1], static::$MONTH_ABBREV)) {
112 112
                 $this->m = static::$MONTH_ABBREV[$date[1]];
113 113
             } else {
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             $jd    = $date->calendar->ymdToJd($today[0], $date->m, $date->d == 0 ? $today[2] : $date->d);
155 155
         } else {
156 156
             // Complete date
157
-            $jd = (int)(($date->maxJD + $date->minJD) / 2);
157
+            $jd = (int) (($date->maxJD + $date->minJD) / 2);
158 158
         }
159 159
         list($this->y, $this->m, $this->d) = $this->calendar->jdToYmd($jd);
160 160
         // New date has same precision as original date
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
     {
962 962
         if ($number < 1) {
963 963
             // Cannot convert zero/negative numbers
964
-            return (string)$number;
964
+            return (string) $number;
965 965
         }
966 966
         $roman = '';
967 967
         foreach (self::$roman_numerals as $key => $value) {
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
         $num = 0;
987 987
         foreach (self::$roman_numerals as $key => $value) {
988 988
             if (strpos($roman, $value) === 0) {
989
-                $num   += $key;
989
+                $num += $key;
990 990
                 $roman = substr($roman, \strlen($value));
991 991
             }
992 992
         }
Please login to merge, or discard this patch.