Completed
Pull Request — master (#1866)
by Rico
10:27 queued 52s
created
app/Module/AbstractModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@
 block discarded – undo
227 227
             return $this->defaultAccessLevel();
228 228
         }
229 229
 
230
-        return (int)$access_level;
230
+        return (int) $access_level;
231 231
     }
232 232
 
233 233
     /**
Please login to merge, or discard this patch.
app/Census/CensusColumnAgeMale.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,6 +38,6 @@
 block discarded – undo
38 38
             return '';
39 39
         }
40 40
 
41
-        return (string)Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0);
41
+        return (string) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0);
42 42
     }
43 43
 }
Please login to merge, or discard this patch.
app/Census/CensusColumnAgeMale5Years.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,6 +43,6 @@
 block discarded – undo
43 43
             $years -= $years % 5;
44 44
         }
45 45
 
46
-        return (string)$years;
46
+        return (string) $years;
47 47
     }
48 48
 }
Please login to merge, or discard this patch.
app/Census/CensusColumnYearsMarried.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,6 +48,6 @@
 block discarded – undo
48 48
             return '';
49 49
         }
50 50
 
51
-        return (string)Date::getAge($marriage_date, $this->date(), 0);
51
+        return (string) Date::getAge($marriage_date, $this->date(), 0);
52 52
     }
53 53
 }
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;
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
                                 }
995 995
 
996 996
 // No phonetic content? Use a substring match
997
-                            $sql    .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
997
+                            $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
998 998
                             $bind[] = $field_value;
999 999
                         }
1000 1000
                         break;
@@ -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;
@@ -1084,22 +1084,22 @@  discard block
 block discarded – undo
1084 1084
                                 }
1085 1085
 
1086 1086
 // No phonetic content? Use a substring match
1087
-                            $sql    .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
1087
+                            $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
1088 1088
                             $bind[] = $field_value;
1089 1089
                         }
1090 1090
                         break;
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/Http/Controllers/AdminLocationController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             $breadcrumbs[] = I18N::translate('Add');
107 107
         } else {
108 108
             $breadcrumbs[] = I18N::translate('Edit');
109
-            $title         .= ' — ' . I18N::translate('Edit');
109
+            $title .= ' — ' . I18N::translate('Edit');
110 110
         }
111 111
 
112 112
         return $this->viewResponse('admin/location-edit', [
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      */
241 241
     public function exportLocations(Request $request): Response
242 242
     {
243
-        $parent_id = (int)$request->get('parent_id');
243
+        $parent_id = (int) $request->get('parent_id');
244 244
         $format    = $request->get('format');
245 245
         $maxlevel  = (int) Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne();
246 246
         $startfqpn = [];
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
      */
299 299
     public function importLocations(Request $request): Response
300 300
     {
301
-        $parent_id   = (int) $request->get('parent_id');
301
+        $parent_id = (int) $request->get('parent_id');
302 302
 
303 303
         $files = array_merge(
304 304
             glob(WT_DATA_DIR . 'places/*.csv'),
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         }
352 352
 
353 353
         if (is_file($filename)) {
354
-            $string   = file_get_contents($filename);
354
+            $string = file_get_contents($filename);
355 355
 
356 356
             // Check the filetype
357 357
             if (stripos($string, 'FeatureCollection') !== false) {
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
             usort(
402 402
                 $places,
403 403
                 function (array $a, array $b) {
404
-                    if ((int)$a['pl_level'] === (int)$b['pl_level']) {
404
+                    if ((int) $a['pl_level'] === (int) $b['pl_level']) {
405 405
                         return I18N::strcasecmp($a['fqpn'], $b['fqpn']);
406 406
                     }
407 407
 
408
-                    return (int)$a['pl_level'] - (int)$b['pl_level'];
408
+                    return (int) $a['pl_level'] - (int) $b['pl_level'];
409 409
                 }
410 410
             );
411 411
 
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
                 "INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place)" .
522 522
                 " VALUES (:id, :parent, :level, :place)"
523 523
             );
524
-            $checkRecordQry  = Database::prepare(
524
+            $checkRecordQry = Database::prepare(
525 525
                 "SELECT pl1.pl_id" .
526 526
                 " FROM	  `##placelocation` AS pl1" .
527 527
                 " LEFT JOIN `##placelocation` AS pl2 ON (pl1.pl_parent_id = pl2.pl_id)" .
Please login to merge, or discard this patch.
app/Stats.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
             100 * $tot_sindi_per,
477 477
         ]);
478 478
         $chl           = I18N::translate('Without sources') . ' - ' . I18N::percentage(1 - $tot_sindi_per, 1) . '|' .
479
-                     I18N::translate('With sources') . ' - ' . I18N::percentage($tot_sindi_per, 1);
479
+                        I18N::translate('With sources') . ' - ' . I18N::percentage($tot_sindi_per, 1);
480 480
         $chart_title   = I18N::translate('Individuals with sources');
481 481
 
482 482
         return '<img src="https://chart.googleapis.com/chart?cht=p3&amp;chd=e:' . $chd . '&amp;chs=' . $size . '&amp;chco=' . $color_from . ',' . $color_to . '&amp;chf=bg,s,ffffff00&amp;chl=' . rawurlencode($chl) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . $chart_title . '" title="' . $chart_title . '">';
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
             I18N::translate('Females') . ' - ' . $per_f . '|' .
1069 1069
             I18N::translate('Males') . ' - ' . $per_m;
1070 1070
         $chart_title = I18N::translate('Males') . ' - ' . $per_m . I18N::$list_separator .
1071
-                   I18N::translate('Females') . ' - ' . $per_f;
1071
+                    I18N::translate('Females') . ' - ' . $per_f;
1072 1072
 
1073 1073
         return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_female},{$color_male}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />';
1074 1074
     }
@@ -1193,7 +1193,7 @@  discard block
 block discarded – undo
1193 1193
             I18N::translate('Living') . ' - ' . $per_l . '|' .
1194 1194
             I18N::translate('Dead') . ' - ' . $per_d . '|';
1195 1195
         $chart_title = I18N::translate('Living') . ' - ' . $per_l . I18N::$list_separator .
1196
-                   I18N::translate('Dead') . ' - ' . $per_d;
1196
+                    I18N::translate('Dead') . ' - ' . $per_d;
1197 1197
 
1198 1198
         return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_living},{$color_dead}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />';
1199 1199
     }
Please login to merge, or discard this patch.
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     private function getTags($text): array
157 157
     {
158 158
         // Extract all tags from the provided text
159
-        preg_match_all('/#([^#]+)(?=#)/', (string)$text, $match);
159
+        preg_match_all('/#([^#]+)(?=#)/', (string) $text, $match);
160 160
         $tags       = $match[1];
161 161
         $c          = count($tags);
162 162
         $new_tags   = []; // tag to replace
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
      */
393 393
     private function totalIndividualsQuery(): int
394 394
     {
395
-        return (int)Database::prepare(
395
+        return (int) Database::prepare(
396 396
             "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id"
397 397
         )->execute([
398 398
             'tree_id' => $this->tree->getTreeId(),
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
      */
417 417
     private function totalIndisWithSourcesQuery(): int
418 418
     {
419
-        return (int)Database::prepare(
419
+        return (int) Database::prepare(
420 420
             "SELECT COUNT(DISTINCT i_id)" .
421 421
             " FROM `##individuals` JOIN `##link` ON i_id = l_from AND i_file = l_file" .
422 422
             " WHERE l_file = :tree_id AND l_type = 'SOUR'"
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
      */
500 500
     private function totalFamiliesQuery(): int
501 501
     {
502
-        return (int)Database::prepare(
502
+        return (int) Database::prepare(
503 503
             "SELECT COUNT(*) FROM `##families` WHERE f_file = :tree_id"
504 504
         )->execute([
505 505
             'tree_id' => $this->tree->getTreeId(),
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
      */
524 524
     private function totalFamsWithSourcesQuery(): int
525 525
     {
526
-        return (int)Database::prepare(
526
+        return (int) Database::prepare(
527 527
             "SELECT COUNT(DISTINCT f_id)" .
528 528
             " FROM `##families` JOIN `##link` ON f_id = l_from AND f_file = l_file" .
529 529
             " WHERE l_file = :tree_id AND l_type = 'SOUR'"
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
      */
607 607
     private function totalSourcesQuery(): int
608 608
     {
609
-        return (int)Database::prepare(
609
+        return (int) Database::prepare(
610 610
             "SELECT COUNT(*) FROM `##sources` WHERE s_file = :tree_id"
611 611
         )->execute([
612 612
             'tree_id' => $this->tree->getTreeId(),
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
      */
641 641
     private function totalNotesQuery(): int
642 642
     {
643
-        return (int)Database::prepare(
643
+        return (int) Database::prepare(
644 644
             "SELECT COUNT(*) FROM `##other` WHERE o_type='NOTE' AND o_file = :tree_id"
645 645
         )->execute([
646 646
             'tree_id' => $this->tree->getTreeId(),
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
      */
675 675
     private function totalRepositoriesQuery(): int
676 676
     {
677
-        return (int)Database::prepare(
677
+        return (int) Database::prepare(
678 678
             "SELECT COUNT(*) FROM `##other` WHERE o_type='REPO' AND o_file = :tree_id"
679 679
         )->execute([
680 680
             'tree_id' => $this->tree->getTreeId(),
@@ -785,11 +785,11 @@  discard block
 block discarded – undo
785 785
                 }
786 786
             }
787 787
             if ($types) {
788
-                $sql  .= ' AND d_fact IN (' . implode(', ', array_fill(0, count($types), '?')) . ')';
788
+                $sql .= ' AND d_fact IN (' . implode(', ', array_fill(0, count($types), '?')) . ')';
789 789
                 $vars = array_merge($vars, $types);
790 790
             }
791 791
         }
792
-        $sql  .= ' AND d_fact NOT IN (' . implode(', ', array_fill(0, count($no_types), '?')) . ')';
792
+        $sql .= ' AND d_fact NOT IN (' . implode(', ', array_fill(0, count($no_types), '?')) . ')';
793 793
         $vars = array_merge($vars, $no_types);
794 794
 
795 795
         $n = (int) Database::prepare($sql)->execute($vars)->fetchOne();
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
      */
902 902
     private function totalSexMalesQuery(): int
903 903
     {
904
-        return (int)Database::prepare(
904
+        return (int) Database::prepare(
905 905
             "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_sex = 'M'"
906 906
         )->execute([
907 907
             'tree_id' => $this->tree->getTreeId(),
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
      */
936 936
     private function totalSexFemalesQuery(): int
937 937
     {
938
-        return (int)Database::prepare(
938
+        return (int) Database::prepare(
939 939
             "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_sex = 'F'"
940 940
         )->execute([
941 941
             'tree_id' => $this->tree->getTreeId(),
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
      */
970 970
     private function totalSexUnknownQuery(): int
971 971
     {
972
-        return (int)Database::prepare(
972
+        return (int) Database::prepare(
973 973
             "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_sex = 'U'"
974 974
         )->execute([
975 975
             'tree_id' => $this->tree->getTreeId(),
@@ -1043,12 +1043,12 @@  discard block
 block discarded – undo
1043 1043
         }
1044 1044
 
1045 1045
         if ($tot_u > 0) {
1046
-            $chd         = $this->arrayToExtendedEncoding([
1046
+            $chd = $this->arrayToExtendedEncoding([
1047 1047
                 4095 * $tot_u / $tot,
1048 1048
                 4095 * $tot_f / $tot,
1049 1049
                 4095 * $tot_m / $tot,
1050 1050
             ]);
1051
-            $chl         =
1051
+            $chl =
1052 1052
                 I18N::translateContext('unknown people', 'Unknown') . ' - ' . $per_u . '|' .
1053 1053
                 I18N::translate('Females') . ' - ' . $per_f . '|' .
1054 1054
                 I18N::translate('Males') . ' - ' . $per_m;
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
             return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_unknown},{$color_female},{$color_male}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />';
1061 1061
         }
1062 1062
 
1063
-        $chd         = $this->arrayToExtendedEncoding([
1063
+        $chd = $this->arrayToExtendedEncoding([
1064 1064
             4095 * $tot_f / $tot,
1065 1065
             4095 * $tot_m / $tot,
1066 1066
         ]);
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
      */
1086 1086
     private function totalLivingQuery(): int
1087 1087
     {
1088
-        return (int)Database::prepare(
1088
+        return (int) Database::prepare(
1089 1089
             "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_gedcom NOT REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'"
1090 1090
         )->execute([
1091 1091
             'tree_id' => $this->tree->getTreeId(),
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
      */
1120 1120
     private function totalDeceasedQuery(): int
1121 1121
     {
1122
-        return (int)Database::prepare(
1122
+        return (int) Database::prepare(
1123 1123
             "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_gedcom REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'"
1124 1124
         )->execute([
1125 1125
             'tree_id' => $this->tree->getTreeId(),
@@ -1185,7 +1185,7 @@  discard block
 block discarded – undo
1185 1185
             return '';
1186 1186
         }
1187 1187
 
1188
-        $chd         = $this->arrayToExtendedEncoding([
1188
+        $chd = $this->arrayToExtendedEncoding([
1189 1189
             4095 * $tot_l / $tot,
1190 1190
             4095 * $tot_d / $tot,
1191 1191
         ]);
@@ -1208,7 +1208,7 @@  discard block
 block discarded – undo
1208 1208
     public function totalUsers($params = []): string
1209 1209
     {
1210 1210
         if (isset($params[0])) {
1211
-            $total = count(User::all()) + (int)$params[0];
1211
+            $total = count(User::all()) + (int) $params[0];
1212 1212
         } else {
1213 1213
             $total = count(User::all());
1214 1214
         }
@@ -1255,18 +1255,18 @@  discard block
 block discarded – undo
1255 1255
             if ($type == 'unknown') {
1256 1256
                 // There has to be a better way then this :(
1257 1257
                 foreach ($this->media_types as $t) {
1258
-                    $sql    .= " AND (m_gedcom NOT LIKE ? AND m_gedcom NOT LIKE ?)";
1258
+                    $sql .= " AND (m_gedcom NOT LIKE ? AND m_gedcom NOT LIKE ?)";
1259 1259
                     $vars[] = "%3 TYPE {$t}%";
1260 1260
                     $vars[] = "%1 _TYPE {$t}%";
1261 1261
                 }
1262 1262
             } else {
1263
-                $sql    .= " AND (m_gedcom LIKE ? OR m_gedcom LIKE ?)";
1263
+                $sql .= " AND (m_gedcom LIKE ? OR m_gedcom LIKE ?)";
1264 1264
                 $vars[] = "%3 TYPE {$type}%";
1265 1265
                 $vars[] = "%1 _TYPE {$type}%";
1266 1266
             }
1267 1267
         }
1268 1268
 
1269
-        return (int)Database::prepare($sql)->execute($vars)->fetchOne();
1269
+        return (int) Database::prepare($sql)->execute($vars)->fetchOne();
1270 1270
     }
1271 1271
 
1272 1272
     /**
@@ -1729,7 +1729,7 @@  discard block
 block discarded – undo
1729 1729
     private function totalPlacesQuery(): int
1730 1730
     {
1731 1731
         return
1732
-            (int)Database::prepare("SELECT COUNT(*) FROM `##places` WHERE p_file=?")
1732
+            (int) Database::prepare("SELECT COUNT(*) FROM `##places` WHERE p_file=?")
1733 1733
                 ->execute([$this->tree->getTreeId()])
1734 1734
                 ->fetchOne();
1735 1735
     }
@@ -1899,7 +1899,7 @@  discard block
 block discarded – undo
1899 1899
         $chart_url .= '&amp;chs=' . $WT_STATS_MAP_X . 'x' . $WT_STATS_MAP_Y;
1900 1900
         $chart_url .= '&amp;chld=' . implode('', array_keys($surn_countries)) . '&amp;chd=s:';
1901 1901
         foreach ($surn_countries as $count) {
1902
-            $chart_url .= substr(self::GOOGLE_CHART_ENCODING, (int)($count / max($surn_countries) * 61), 1);
1902
+            $chart_url .= substr(self::GOOGLE_CHART_ENCODING, (int) ($count / max($surn_countries) * 61), 1);
1903 1903
         }
1904 1904
         $chart = '<div id="google_charts" class="center">';
1905 1905
         $chart .= '<p>' . $chart_title . '</p>';
@@ -1941,9 +1941,9 @@  discard block
 block discarded – undo
1941 1941
             $country = trim($place->country);
1942 1942
             if (array_key_exists($country, $country_names)) {
1943 1943
                 if (!isset($all_db_countries[$country_names[$country]][$country])) {
1944
-                    $all_db_countries[$country_names[$country]][$country] = (int)$place->tot;
1944
+                    $all_db_countries[$country_names[$country]][$country] = (int) $place->tot;
1945 1945
                 } else {
1946
-                    $all_db_countries[$country_names[$country]][$country] += (int)$place->tot;
1946
+                    $all_db_countries[$country_names[$country]][$country] += (int) $place->tot;
1947 1947
                 }
1948 1948
             }
1949 1949
         }
@@ -2120,7 +2120,7 @@  discard block
 block discarded – undo
2120 2120
             $centuries = '';
2121 2121
             $counts    = [];
2122 2122
             foreach ($rows as $values) {
2123
-                $counts[]  = round(100 * $values->total / $tot, 0);
2123
+                $counts[] = round(100 * $values->total / $tot, 0);
2124 2124
                 $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|';
2125 2125
             }
2126 2126
             $chd = $this->arrayToExtendedEncoding($counts);
@@ -2214,7 +2214,7 @@  discard block
 block discarded – undo
2214 2214
             $centuries = '';
2215 2215
             $counts    = [];
2216 2216
             foreach ($rows as $values) {
2217
-                $counts[]  = round(100 * $values->total / $tot, 0);
2217
+                $counts[] = round(100 * $values->total / $tot, 0);
2218 2218
                 $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|';
2219 2219
             }
2220 2220
             $chd = $this->arrayToExtendedEncoding($counts);
@@ -2464,7 +2464,7 @@  discard block
 block discarded – undo
2464 2464
                 }
2465 2465
                 break;
2466 2466
             case 'age':
2467
-                $result = I18N::number((int)($row->age / 365.25));
2467
+                $result = I18N::number((int) ($row->age / 365.25));
2468 2468
                 break;
2469 2469
             case 'name':
2470 2470
                 $result = '<a href="' . e($person->url()) . '">' . $person->getFullName() . '</a>';
@@ -2493,7 +2493,7 @@  discard block
 block discarded – undo
2493 2493
             $sex_search = '';
2494 2494
         }
2495 2495
         if (isset($params[0])) {
2496
-            $total = (int)$params[0];
2496
+            $total = (int) $params[0];
2497 2497
         } else {
2498 2498
             $total = 10;
2499 2499
         }
@@ -2527,10 +2527,10 @@  discard block
 block discarded – undo
2527 2527
         foreach ($rows as $row) {
2528 2528
             $person = Individual::getInstance($row->deathdate, $this->tree);
2529 2529
             $age    = $row->age;
2530
-            if ((int)($age / 365.25) > 0) {
2531
-                $age = (int)($age / 365.25) . 'y';
2532
-            } elseif ((int)($age / 30.4375) > 0) {
2533
-                $age = (int)($age / 30.4375) . 'm';
2530
+            if ((int) ($age / 365.25) > 0) {
2531
+                $age = (int) ($age / 365.25) . 'y';
2532
+            } elseif ((int) ($age / 30.4375) > 0) {
2533
+                $age = (int) ($age / 30.4375) . 'm';
2534 2534
             } else {
2535 2535
                 $age = $age . 'd';
2536 2536
             }
@@ -2592,11 +2592,11 @@  discard block
 block discarded – undo
2592 2592
             $sex_search = '';
2593 2593
         }
2594 2594
         if (isset($params[0])) {
2595
-            $total = (int)$params[0];
2595
+            $total = (int) $params[0];
2596 2596
         } else {
2597 2597
             $total = 10;
2598 2598
         }
2599
-        $rows  = $this->runSql(
2599
+        $rows = $this->runSql(
2600 2600
             "SELECT" .
2601 2601
             " birth.d_gid AS id," .
2602 2602
             " MIN(birth.d_julianday1) AS age" .
@@ -2619,10 +2619,10 @@  discard block
 block discarded – undo
2619 2619
         foreach ($rows as $row) {
2620 2620
             $person = Individual::getInstance($row->id, $this->tree);
2621 2621
             $age    = (WT_CLIENT_JD - $row->age);
2622
-            if ((int)($age / 365.25) > 0) {
2623
-                $age = (int)($age / 365.25) . 'y';
2624
-            } elseif ((int)($age / 30.4375) > 0) {
2625
-                $age = (int)($age / 30.4375) . 'm';
2622
+            if ((int) ($age / 365.25) > 0) {
2623
+                $age = (int) ($age / 365.25) . 'y';
2624
+            } elseif ((int) ($age / 30.4375) > 0) {
2625
+                $age = (int) ($age / 30.4375) . 'm';
2626 2626
             } else {
2627 2627
                 $age = $age . 'd';
2628 2628
             }
@@ -2699,10 +2699,10 @@  discard block
 block discarded – undo
2699 2699
 
2700 2700
         $age = $rows[0]->age;
2701 2701
         if ($show_years) {
2702
-            if ((int)($age / 365.25) > 0) {
2703
-                $age = (int)($age / 365.25) . 'y';
2704
-            } elseif ((int)($age / 30.4375) > 0) {
2705
-                $age = (int)($age / 30.4375) . 'm';
2702
+            if ((int) ($age / 365.25) > 0) {
2703
+                $age = (int) ($age / 365.25) . 'y';
2704
+            } elseif ((int) ($age / 30.4375) > 0) {
2705
+                $age = (int) ($age / 30.4375) . 'm';
2706 2706
             } elseif (!empty($age)) {
2707 2707
                 $age = $age . 'd';
2708 2708
             }
@@ -2772,7 +2772,7 @@  discard block
 block discarded – undo
2772 2772
                 if ($sizes[0] < 980) {
2773 2773
                     $sizes[0] += 50;
2774 2774
                 }
2775
-                $chxl    .= $this->centuryName($century) . '|';
2775
+                $chxl .= $this->centuryName($century) . '|';
2776 2776
                 $average = 0;
2777 2777
                 if (isset($values['F'])) {
2778 2778
                     $countsf .= $values['F'] . ',';
@@ -2814,7 +2814,7 @@  discard block
 block discarded – undo
2814 2814
                 while ($offset = strpos($title, ' ', $offset + 1)) {
2815 2815
                     $counter[] = $offset;
2816 2816
                 }
2817
-                $half = (int)(count($counter) / 2);
2817
+                $half = (int) (count($counter) / 2);
2818 2818
                 $chtt = substr_replace($title, '|', $counter[$half], 1);
2819 2819
             }
2820 2820
 
@@ -3390,16 +3390,16 @@  discard block
 block discarded – undo
3390 3390
             case 'age':
3391 3391
                 $age = $row->age;
3392 3392
                 if ($show_years) {
3393
-                    if ((int)($age / 365.25) > 0) {
3394
-                        $age = (int)($age / 365.25) . 'y';
3395
-                    } elseif ((int)($age / 30.4375) > 0) {
3396
-                        $age = (int)($age / 30.4375) . 'm';
3393
+                    if ((int) ($age / 365.25) > 0) {
3394
+                        $age = (int) ($age / 365.25) . 'y';
3395
+                    } elseif ((int) ($age / 30.4375) > 0) {
3396
+                        $age = (int) ($age / 30.4375) . 'm';
3397 3397
                     } else {
3398 3398
                         $age = $age . 'd';
3399 3399
                     }
3400 3400
                     $result = FunctionsDate::getAgeAtEvent($age);
3401 3401
                 } else {
3402
-                    $result = I18N::number((int)($age / 365.25));
3402
+                    $result = I18N::number((int) ($age / 365.25));
3403 3403
                 }
3404 3404
                 break;
3405 3405
         }
@@ -3419,7 +3419,7 @@  discard block
 block discarded – undo
3419 3419
     private function ageOfMarriageQuery($type = 'list', $age_dir = 'ASC', $params = []): string
3420 3420
     {
3421 3421
         if (isset($params[0])) {
3422
-            $total = (int)$params[0];
3422
+            $total = (int) $params[0];
3423 3423
         } else {
3424 3424
             $total = 10;
3425 3425
         }
@@ -3502,10 +3502,10 @@  discard block
 block discarded – undo
3502 3502
             if ($type === 'name') {
3503 3503
                 return $family->formatList();
3504 3504
             }
3505
-            if ((int)($age / 365.25) > 0) {
3506
-                $age = (int)($age / 365.25) . 'y';
3507
-            } elseif ((int)($age / 30.4375) > 0) {
3508
-                $age = (int)($age / 30.4375) . 'm';
3505
+            if ((int) ($age / 365.25) > 0) {
3506
+                $age = (int) ($age / 365.25) . 'y';
3507
+            } elseif ((int) ($age / 30.4375) > 0) {
3508
+                $age = (int) ($age / 30.4375) . 'm';
3509 3509
             } else {
3510 3510
                 $age = $age . 'd';
3511 3511
             }
@@ -3567,7 +3567,7 @@  discard block
 block discarded – undo
3567 3567
     private function ageBetweenSpousesQuery($type = 'list', $age_dir = 'DESC', $params = []): string
3568 3568
     {
3569 3569
         if (isset($params[0])) {
3570
-            $total = (int)$params[0];
3570
+            $total = (int) $params[0];
3571 3571
         } else {
3572 3572
             $total = 10;
3573 3573
         }
@@ -3612,10 +3612,10 @@  discard block
 block discarded – undo
3612 3612
                 break;
3613 3613
             }
3614 3614
             $age = $fam->age;
3615
-            if ((int)($age / 365.25) > 0) {
3616
-                $age = (int)($age / 365.25) . 'y';
3617
-            } elseif ((int)($age / 30.4375) > 0) {
3618
-                $age = (int)($age / 30.4375) . 'm';
3615
+            if ((int) ($age / 365.25) > 0) {
3616
+                $age = (int) ($age / 365.25) . 'y';
3617
+            } elseif ((int) ($age / 30.4375) > 0) {
3618
+                $age = (int) ($age / 30.4375) . 'm';
3619 3619
             } else {
3620 3620
                 $age = $age . 'd';
3621 3621
             }
@@ -3703,16 +3703,16 @@  discard block
 block discarded – undo
3703 3703
             case 'age':
3704 3704
                 $age = $row->age;
3705 3705
                 if ($show_years) {
3706
-                    if ((int)($age / 365.25) > 0) {
3707
-                        $age = (int)($age / 365.25) . 'y';
3708
-                    } elseif ((int)($age / 30.4375) > 0) {
3709
-                        $age = (int)($age / 30.4375) . 'm';
3706
+                    if ((int) ($age / 365.25) > 0) {
3707
+                        $age = (int) ($age / 365.25) . 'y';
3708
+                    } elseif ((int) ($age / 30.4375) > 0) {
3709
+                        $age = (int) ($age / 30.4375) . 'm';
3710 3710
                     } else {
3711 3711
                         $age = $age . 'd';
3712 3712
                     }
3713 3713
                     $result = FunctionsDate::getAgeAtEvent($age);
3714 3714
                 } else {
3715
-                    $result = (int)($age / 365.25);
3715
+                    $result = (int) ($age / 365.25);
3716 3716
                 }
3717 3717
                 break;
3718 3718
         }
@@ -3796,7 +3796,7 @@  discard block
 block discarded – undo
3796 3796
             $sizes = explode('x', $size);
3797 3797
             $tot   = 0;
3798 3798
             foreach ($rows as $values) {
3799
-                $tot += (int)$values->total;
3799
+                $tot += (int) $values->total;
3800 3800
             }
3801 3801
             // Beware divide by zero
3802 3802
             if ($tot === 0) {
@@ -3805,7 +3805,7 @@  discard block
 block discarded – undo
3805 3805
             $centuries = '';
3806 3806
             $counts    = [];
3807 3807
             foreach ($rows as $values) {
3808
-                $counts[]  = round(100 * $values->total / $tot, 0);
3808
+                $counts[] = round(100 * $values->total / $tot, 0);
3809 3809
                 $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|';
3810 3810
             }
3811 3811
             $chd = $this->arrayToExtendedEncoding($counts);
@@ -3901,7 +3901,7 @@  discard block
 block discarded – undo
3901 3901
             $centuries = '';
3902 3902
             $counts    = [];
3903 3903
             foreach ($rows as $values) {
3904
-                $counts[]  = round(100 * $values->total / $tot, 0);
3904
+                $counts[] = round(100 * $values->total / $tot, 0);
3905 3905
                 $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|';
3906 3906
             }
3907 3907
             $chd = $this->arrayToExtendedEncoding($counts);
@@ -4170,7 +4170,7 @@  discard block
 block discarded – undo
4170 4170
                 if ($sizes[0] < 1000) {
4171 4171
                     $sizes[0] += 50;
4172 4172
                 }
4173
-                $chxl    .= $this->centuryName($century) . '|';
4173
+                $chxl .= $this->centuryName($century) . '|';
4174 4174
                 $average = 0;
4175 4175
                 if (isset($values['F'])) {
4176 4176
                     if ($max <= 50) {
@@ -4227,7 +4227,7 @@  discard block
 block discarded – undo
4227 4227
                 while ($offset = strpos(I18N::translate('Average age in century of marriage'), ' ', $offset + 1)) {
4228 4228
                     $counter[] = $offset;
4229 4229
                 }
4230
-                $half = (int)(count($counter) / 2);
4230
+                $half = (int) (count($counter) / 2);
4231 4231
                 $chtt = substr_replace(I18N::translate('Average age in century of marriage'), '|', $counter[$half], 1);
4232 4232
             }
4233 4233
 
@@ -4763,7 +4763,7 @@  discard block
 block discarded – undo
4763 4763
     private function topTenFamilyQuery($type = 'list', $params = []): string
4764 4764
     {
4765 4765
         if (isset($params[0])) {
4766
-            $total = (int)$params[0];
4766
+            $total = (int) $params[0];
4767 4767
         } else {
4768 4768
             $total = 10;
4769 4769
         }
@@ -4830,7 +4830,7 @@  discard block
 block discarded – undo
4830 4830
     private function ageBetweenSiblingsQuery($type = 'list', $params = []): string
4831 4831
     {
4832 4832
         if (isset($params[0])) {
4833
-            $total = (int)$params[0];
4833
+            $total = (int) $params[0];
4834 4834
         } else {
4835 4835
             $total = 10;
4836 4836
         }
@@ -4886,10 +4886,10 @@  discard block
 block discarded – undo
4886 4886
                 return $return;
4887 4887
             }
4888 4888
             $age = $fam->age;
4889
-            if ((int)($age / 365.25) > 0) {
4890
-                $age = (int)($age / 365.25) . 'y';
4891
-            } elseif ((int)($age / 30.4375) > 0) {
4892
-                $age = (int)($age / 30.4375) . 'm';
4889
+            if ((int) ($age / 365.25) > 0) {
4890
+                $age = (int) ($age / 365.25) . 'y';
4891
+            } elseif ((int) ($age / 30.4375) > 0) {
4892
+                $age = (int) ($age / 30.4375) . 'm';
4893 4893
             } else {
4894 4894
                 $age = $age . 'd';
4895 4895
             }
@@ -4900,7 +4900,7 @@  discard block
 block discarded – undo
4900 4900
             if ($type == 'list') {
4901 4901
                 if ($one && !in_array($fam->family, $dist)) {
4902 4902
                     if ($child1->canShow() && $child2->canShow()) {
4903
-                        $return  = '<li>';
4903
+                        $return = '<li>';
4904 4904
                         $return  .= '<a href="' . e($child2->url()) . '">' . $child2->getFullName() . '</a> ';
4905 4905
                         $return  .= I18N::translate('and') . ' ';
4906 4906
                         $return  .= '<a href="' . e($child1->url()) . '">' . $child1->getFullName() . '</a>';
@@ -4911,7 +4911,7 @@  discard block
 block discarded – undo
4911 4911
                         $dist[]  = $fam->family;
4912 4912
                     }
4913 4913
                 } elseif (!$one && $child1->canShow() && $child2->canShow()) {
4914
-                    $return  = '<li>';
4914
+                    $return = '<li>';
4915 4915
                     $return  .= '<a href="' . e($child2->url()) . '">' . $child2->getFullName() . '</a> ';
4916 4916
                     $return  .= I18N::translate('and') . ' ';
4917 4917
                     $return  .= '<a href="' . e($child1->url()) . '">' . $child1->getFullName() . '</a>';
@@ -5185,7 +5185,7 @@  discard block
 block discarded – undo
5185 5185
             $total = 10;
5186 5186
         }
5187 5187
         $sizes = explode('x', $size);
5188
-        $total = (int)$total;
5188
+        $total = (int) $total;
5189 5189
         $rows  = $this->runSql(
5190 5190
             " SELECT f_numchil AS tot, f_id AS id" .
5191 5191
             " FROM `##families`" .
@@ -5198,7 +5198,7 @@  discard block
 block discarded – undo
5198 5198
         }
5199 5199
         $tot = 0;
5200 5200
         foreach ($rows as $row) {
5201
-            $tot += (int)$row->tot;
5201
+            $tot += (int) $row->tot;
5202 5202
         }
5203 5203
         $chd = '';
5204 5204
         $chl = [];
@@ -5210,7 +5210,7 @@  discard block
 block discarded – undo
5210 5210
                 } else {
5211 5211
                     $per = round(100 * $row->tot / $tot, 0);
5212 5212
                 }
5213
-                $chd   .= $this->arrayToExtendedEncoding([$per]);
5213
+                $chd .= $this->arrayToExtendedEncoding([$per]);
5214 5214
                 $chl[] = htmlspecialchars_decode(strip_tags($family->getFullName())) . ' - ' . I18N::number($row->tot);
5215 5215
             }
5216 5216
         }
@@ -5556,7 +5556,7 @@  discard block
 block discarded – undo
5556 5556
             if ($max < $values->count) {
5557 5557
                 $max = $values->count;
5558 5558
             }
5559
-            $tot += (int)$values->count;
5559
+            $tot += (int) $values->count;
5560 5560
         }
5561 5561
         $unknown = $this->noChildrenFamiliesQuery() - $tot;
5562 5562
         if ($unknown > $max) {
@@ -5580,13 +5580,13 @@  discard block
 block discarded – undo
5580 5580
         $chm      .= 't' . $unknown . ',000000,0,' . $i . ',11,1';
5581 5581
         $chxl     .= I18N::translateContext('unknown century', 'Unknown') . '|1:||' . I18N::translate('century') . '|2:|0|';
5582 5582
         $step     = $max + 1;
5583
-        for ($d = (int)($max + 1); $d > 0; $d--) {
5583
+        for ($d = (int) ($max + 1); $d > 0; $d--) {
5584 5584
             if (($max + 1) < ($d * 10 + 1) && fmod(($max + 1), $d) == 0) {
5585 5585
                 $step = $d;
5586 5586
             }
5587 5587
         }
5588
-        if ($step == (int)($max + 1)) {
5589
-            for ($d = (int)($max); $d > 0; $d--) {
5588
+        if ($step == (int) ($max + 1)) {
5589
+            for ($d = (int) ($max); $d > 0; $d--) {
5590 5590
                 if ($max < ($d * 10 + 1) && fmod($max, $d) == 0) {
5591 5591
                     $step = $d;
5592 5592
                 }
@@ -5611,7 +5611,7 @@  discard block
 block discarded – undo
5611 5611
     private function topTenGrandFamilyQuery($type = 'list', $params = []): string
5612 5612
     {
5613 5613
         if (isset($params[0])) {
5614
-            $total = (int)$params[0];
5614
+            $total = (int) $params[0];
5615 5615
         } else {
5616 5616
             $total = 10;
5617 5617
         }
@@ -5709,8 +5709,8 @@  discard block
 block discarded – undo
5709 5709
      */
5710 5710
     private function commonSurnamesQuery($type = 'list', $show_tot = false, $params = []): string
5711 5711
     {
5712
-        $threshold          = empty($params[0]) ? 10 : (int)$params[0];
5713
-        $number_of_surnames = empty($params[1]) ? 10 : (int)$params[1];
5712
+        $threshold          = empty($params[0]) ? 10 : (int) $params[0];
5713
+        $number_of_surnames = empty($params[1]) ? 10 : (int) $params[1];
5714 5714
         $sorting            = empty($params[2]) ? 'alpha' : $params[2];
5715 5715
 
5716 5716
         $surnames = $this->topSurnames($number_of_surnames, $threshold);
@@ -5882,7 +5882,7 @@  discard block
 block discarded – undo
5882 5882
             $max_name  = 0;
5883 5883
             $top_name  = '';
5884 5884
             foreach ($surns as $spfxsurn => $count) {
5885
-                $per       = $count;
5885
+                $per = $count;
5886 5886
                 $count_per += $per;
5887 5887
                 // select most common surname from all variants
5888 5888
                 if ($per > $max_name) {
@@ -5906,11 +5906,11 @@  discard block
 block discarded – undo
5906 5906
                     ], $top_name);
5907 5907
             }
5908 5908
             $per   = round(100 * $count_per / $tot_indi, 0);
5909
-            $chd   .= $this->arrayToExtendedEncoding([$per]);
5909
+            $chd .= $this->arrayToExtendedEncoding([$per]);
5910 5910
             $chl[] = $top_name . ' - ' . I18N::number($count_per);
5911 5911
         }
5912 5912
         $per   = round(100 * ($tot_indi - $tot) / $tot_indi, 0);
5913
-        $chd   .= $this->arrayToExtendedEncoding([$per]);
5913
+        $chd .= $this->arrayToExtendedEncoding([$per]);
5914 5914
         $chl[] = I18N::translate('Other') . ' - ' . I18N::number($tot_indi - $tot);
5915 5915
 
5916 5916
         $chart_title = implode(I18N::$list_separator, $chl);
@@ -5932,12 +5932,12 @@  discard block
 block discarded – undo
5932 5932
     private function commonGivenQuery($sex = 'B', $type = 'list', $show_tot = false, $params = [])
5933 5933
     {
5934 5934
         if (isset($params[0]) && $params[0] != '' && $params[0] >= 0) {
5935
-            $threshold = (int)$params[0];
5935
+            $threshold = (int) $params[0];
5936 5936
         } else {
5937 5937
             $threshold = 1;
5938 5938
         }
5939 5939
         if (isset($params[1]) && $params[1] != '' && $params[1] >= 0) {
5940
-            $maxtoshow = (int)$params[1];
5940
+            $maxtoshow = (int) $params[1];
5941 5941
         } else {
5942 5942
             $maxtoshow = 10;
5943 5943
         }
@@ -6330,11 +6330,11 @@  discard block
 block discarded – undo
6330 6330
             } else {
6331 6331
                 $per = round(100 * $count / $tot_indi, 0);
6332 6332
             }
6333
-            $chd   .= $this->arrayToExtendedEncoding([$per]);
6333
+            $chd .= $this->arrayToExtendedEncoding([$per]);
6334 6334
             $chl[] = $givn . ' - ' . I18N::number($count);
6335 6335
         }
6336 6336
         $per   = round(100 * ($tot_indi - $tot) / $tot_indi, 0);
6337
-        $chd   .= $this->arrayToExtendedEncoding([$per]);
6337
+        $chd .= $this->arrayToExtendedEncoding([$per]);
6338 6338
         $chl[] = I18N::translate('Other') . ' - ' . I18N::number($tot_indi - $tot);
6339 6339
 
6340 6340
         $chart_title = implode(I18N::$list_separator, $chl);
@@ -6565,7 +6565,7 @@  discard block
 block discarded – undo
6565 6565
                     $datestamp = I18N::dateFormat();
6566 6566
                 }
6567 6567
 
6568
-                return FunctionsDate::timestampToGedcomDate((int)$user->getPreference('reg_timestamp'))->display(false, $datestamp);
6568
+                return FunctionsDate::timestampToGedcomDate((int) $user->getPreference('reg_timestamp'))->display(false, $datestamp);
6569 6569
             case 'regtime':
6570 6570
                 if (is_array($params) && isset($params[0]) && $params[0] != '') {
6571 6571
                     $datestamp = $params[0];
@@ -6573,7 +6573,7 @@  discard block
 block discarded – undo
6573 6573
                     $datestamp = str_replace('%', '', I18N::timeFormat());
6574 6574
                 }
6575 6575
 
6576
-                return date($datestamp, (int)$user->getPreference('reg_timestamp'));
6576
+                return date($datestamp, (int) $user->getPreference('reg_timestamp'));
6577 6577
             case 'loggedin':
6578 6578
                 if (is_array($params) && isset($params[0]) && $params[0] != '') {
6579 6579
                     $yes = $params[0];
@@ -6913,9 +6913,9 @@  discard block
 block discarded – undo
6913 6913
             if ($value < 0) {
6914 6914
                 $value = 0;
6915 6915
             }
6916
-            $first    = (int)($value / 64);
6916
+            $first    = (int) ($value / 64);
6917 6917
             $second   = $value % 64;
6918
-            $encoding .= $xencoding[(int)$first] . $xencoding[(int)$second];
6918
+            $encoding .= $xencoding[(int) $first] . $xencoding[(int) $second];
6919 6919
         }
6920 6920
 
6921 6921
         return $encoding;
@@ -7059,7 +7059,7 @@  discard block
 block discarded – undo
7059 7059
      */
7060 7060
     public function totalUserMessages(): string
7061 7061
     {
7062
-        $total = (int)Database::prepare("SELECT COUNT(*) FROM `##message` WHERE user_id = ?")
7062
+        $total = (int) Database::prepare("SELECT COUNT(*) FROM `##message` WHERE user_id = ?")
7063 7063
             ->execute([Auth::id()])
7064 7064
             ->fetchOne();
7065 7065
 
@@ -7074,7 +7074,7 @@  discard block
 block discarded – undo
7074 7074
     public function totalUserJournal(): string
7075 7075
     {
7076 7076
         try {
7077
-            $number = (int)Database::prepare("SELECT COUNT(*) FROM `##news` WHERE user_id = ?")
7077
+            $number = (int) Database::prepare("SELECT COUNT(*) FROM `##news` WHERE user_id = ?")
7078 7078
                 ->execute([Auth::id()])
7079 7079
                 ->fetchOne();
7080 7080
         } catch (PDOException $ex) {
@@ -7095,7 +7095,7 @@  discard block
 block discarded – undo
7095 7095
     public function totalGedcomNews(): string
7096 7096
     {
7097 7097
         try {
7098
-            $number = (int)Database::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?")
7098
+            $number = (int) Database::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?")
7099 7099
                 ->execute([$this->tree->getTreeId()])
7100 7100
                 ->fetchOne();
7101 7101
         } catch (PDOException $ex) {
Please login to merge, or discard this patch.
app/Census/CensusColumnAgeFemale5Years.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,6 +43,6 @@
 block discarded – undo
43 43
             $years -= $years % 5;
44 44
         }
45 45
 
46
-        return (string)$years;
46
+        return (string) $years;
47 47
     }
48 48
 }
Please login to merge, or discard this patch.
app/Census/CensusColumnAgeFemale.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,6 +38,6 @@
 block discarded – undo
38 38
             return '';
39 39
         }
40 40
 
41
-        return (string)Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0);
41
+        return (string) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0);
42 42
     }
43 43
 }
Please login to merge, or discard this patch.