@@ -176,14 +176,14 @@ discard block |
||
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 |
||
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 |
||
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'; |
@@ -107,7 +107,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -65,7 +65,7 @@ |
||
65 | 65 | } |
66 | 66 | } |
67 | 67 | $count_logged_in = \count($logged_in); |
68 | - $content .= '<div class="logged_in_count">'; |
|
68 | + $content .= '<div class="logged_in_count">'; |
|
69 | 69 | if ($anonymous) { |
70 | 70 | $content .= I18N::plural('%s anonymous signed-in user', '%s anonymous signed-in users', $anonymous, I18N::number($anonymous)); |
71 | 71 | if ($count_logged_in) { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | // Only show this block for certain languages |
118 | 118 | $languages = $this->getBlockSetting($block_id, 'languages', ''); |
119 | 119 | if ($languages === '' || \in_array(WT_LOCALE, explode(',', $languages))) { |
120 | - $stories[] = (object)[ |
|
120 | + $stories[] = (object) [ |
|
121 | 121 | 'block_id' => $block_id, |
122 | 122 | 'title' => $this->getBlockSetting($block_id, 'title'), |
123 | 123 | 'story_body' => $this->getBlockSetting($block_id, 'story_body'), |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | { |
213 | 213 | $this->layout = 'layouts/administration'; |
214 | 214 | |
215 | - $block_id = (int)$request->get('block_id'); |
|
215 | + $block_id = (int) $request->get('block_id'); |
|
216 | 216 | |
217 | 217 | if ($block_id === 0) { |
218 | 218 | // Creating a new story |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | */ |
258 | 258 | public function postAdminEditAction(Request $request, Tree $tree): RedirectResponse |
259 | 259 | { |
260 | - $block_id = (int)$request->get('block_id'); |
|
260 | + $block_id = (int) $request->get('block_id'); |
|
261 | 261 | $xref = $request->get('xref', ''); |
262 | 262 | $story_body = $request->get('story_body', ''); |
263 | 263 | $story_title = $request->get('story_title', ''); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | */ |
304 | 304 | public function postAdminDeleteAction(Request $request, Tree $tree): Response |
305 | 305 | { |
306 | - $block_id = (int)$request->get('block_id'); |
|
306 | + $block_id = (int) $request->get('block_id'); |
|
307 | 307 | |
308 | 308 | Database::prepare( |
309 | 309 | "DELETE FROM `##block_setting` WHERE block_id = :block_id" |
@@ -280,7 +280,7 @@ |
||
280 | 280 | { |
281 | 281 | $nchi = \count($this->getChildren()); |
282 | 282 | foreach ($this->getFacts('NCHI') as $fact) { |
283 | - $nchi = max($nchi, (int)$fact->getValue()); |
|
283 | + $nchi = max($nchi, (int) $fact->getValue()); |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | return $nchi; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | 'type' => 'radio', |
101 | 101 | 'name' => $name, |
102 | 102 | 'value' => $value, |
103 | - 'checked' => (string)$value === (string)$selected, |
|
103 | + 'checked' => (string) $value === (string) $selected, |
|
104 | 104 | ] + $attributes); |
105 | 105 | |
106 | 106 | $html .= |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | foreach ($options as $value => $option) { |
130 | 130 | $option_attributes = self::attributes([ |
131 | 131 | 'value' => $value, |
132 | - 'selected' => (string)$value === (string)$selected, |
|
132 | + 'selected' => (string) $value === (string) $selected, |
|
133 | 133 | ]); |
134 | 134 | |
135 | 135 | $html .= '<option ' . $option_attributes . '>' . e($option) . '</option>'; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | foreach ($options as $value => $option) { |
162 | 162 | $option_attributes = self::attributes([ |
163 | 163 | 'value' => $value, |
164 | - 'selected' => \in_array((string)$value, $selected), |
|
164 | + 'selected' => \in_array((string) $value, $selected), |
|
165 | 165 | ]); |
166 | 166 | |
167 | 167 | $html .= '<option ' . $option_attributes . '>' . e($option) . '</option>'; |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | // Fixing the width for td to the box initial width when the person is the root person fix a rare bug that happen when a person without child and without known parents is the root person : an unwanted white rectangle appear at the right of the person’s boxes, otherwise. |
255 | 255 | $html .= '<td' . ($isRoot ? ' style="width:1px"' : '') . '><div class="tv_box' . ($isRoot ? ' rootPerson' : '') . '" dir="' . I18N::direction() . '" style="text-align: ' . (I18N::direction() === 'rtl' ? 'right' : 'left') . '; direction: ' . I18N::direction() . '" abbr="' . $person->getXref() . '" onclick="' . $this->name . 'Handler.expandBox(this, event);">'; |
256 | 256 | $html .= $this->drawPersonName($person); |
257 | - $fop = []; // $fop is fathers of partners |
|
257 | + $fop = []; // $fop is fathers of partners |
|
258 | 258 | if ($partner !== null) { |
259 | 259 | $dashed = ''; |
260 | 260 | foreach ($person->getSpouseFamilies() as $family) { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $spouse_parents, |
273 | 273 | ]; |
274 | 274 | } |
275 | - $html .= $this->drawPersonName($spouse, $dashed); |
|
275 | + $html .= $this->drawPersonName($spouse, $dashed); |
|
276 | 276 | $dashed = 'dashed'; |
277 | 277 | } |
278 | 278 | } |
@@ -292,9 +292,9 @@ discard block |
||
292 | 292 | /* draw the parents */ |
293 | 293 | if ($state >= 0 && (!empty($parent) || \count($fop))) { |
294 | 294 | $unique = (empty($parent) || \count($fop) == 0); |
295 | - $html .= '<td align="left"><table class="tv_tree"><tbody>'; |
|
295 | + $html .= '<td align="left"><table class="tv_tree"><tbody>'; |
|
296 | 296 | if (!empty($parent)) { |
297 | - $u = $unique ? 'c' : 't'; |
|
297 | + $u = $unique ? 'c' : 't'; |
|
298 | 298 | $html .= '<tr><td ' . ($gen == 0 ? ' abbr="p' . $primaryChildFamily->getXref() . '@' . $u . '"' : '') . '>'; |
299 | 299 | $html .= $this->drawPerson($parent, $gen - 1, 1, $primaryChildFamily, $u); |
300 | 300 | $html .= '</td></tr>'; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $nb = \count($fop); |
305 | 305 | foreach ($fop as $p) { |
306 | 306 | $n++; |
307 | - $u = $unique ? 'c' : ($n == $nb || empty($p[1]) ? 'b' : 'h'); |
|
307 | + $u = $unique ? 'c' : ($n == $nb || empty($p[1]) ? 'b' : 'h'); |
|
308 | 308 | $html .= '<tr><td ' . ($gen == 0 ? ' abbr="p' . $p[1]->getXref() . '@' . $u . '"' : '') . '>' . $this->drawPerson($p[0], $gen - 1, 1, $p[1], $u) . '</td></tr>'; |
309 | 309 | } |
310 | 310 | } |
@@ -156,7 +156,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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(), |
@@ -1041,12 +1041,12 @@ discard block |
||
1041 | 1041 | if ($tot == 0) { |
1042 | 1042 | return ''; |
1043 | 1043 | } elseif ($tot_u > 0) { |
1044 | - $chd = $this->arrayToExtendedEncoding([ |
|
1044 | + $chd = $this->arrayToExtendedEncoding([ |
|
1045 | 1045 | 4095 * $tot_u / $tot, |
1046 | 1046 | 4095 * $tot_f / $tot, |
1047 | 1047 | 4095 * $tot_m / $tot, |
1048 | 1048 | ]); |
1049 | - $chl = |
|
1049 | + $chl = |
|
1050 | 1050 | I18N::translateContext('unknown people', 'Unknown') . ' - ' . $per_u . '|' . |
1051 | 1051 | I18N::translate('Females') . ' - ' . $per_f . '|' . |
1052 | 1052 | I18N::translate('Males') . ' - ' . $per_m; |
@@ -1057,7 +1057,7 @@ discard block |
||
1057 | 1057 | |
1058 | 1058 | return "<img src=\"https://chart.googleapis.com/chart?cht=p3&chd=e:{$chd}&chs={$size}&chco={$color_unknown},{$color_female},{$color_male}&chf=bg,s,ffffff00&chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />'; |
1059 | 1059 | } else { |
1060 | - $chd = $this->arrayToExtendedEncoding([ |
|
1060 | + $chd = $this->arrayToExtendedEncoding([ |
|
1061 | 1061 | 4095 * $tot_f / $tot, |
1062 | 1062 | 4095 * $tot_m / $tot, |
1063 | 1063 | ]); |
@@ -1083,7 +1083,7 @@ discard block |
||
1083 | 1083 | */ |
1084 | 1084 | private function totalLivingQuery(): int |
1085 | 1085 | { |
1086 | - return (int)Database::prepare( |
|
1086 | + return (int) Database::prepare( |
|
1087 | 1087 | "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_gedcom NOT REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'" |
1088 | 1088 | )->execute([ |
1089 | 1089 | 'tree_id' => $this->tree->getTreeId(), |
@@ -1117,7 +1117,7 @@ discard block |
||
1117 | 1117 | */ |
1118 | 1118 | private function totalDeceasedQuery(): int |
1119 | 1119 | { |
1120 | - return (int)Database::prepare( |
|
1120 | + return (int) Database::prepare( |
|
1121 | 1121 | "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_gedcom REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'" |
1122 | 1122 | )->execute([ |
1123 | 1123 | 'tree_id' => $this->tree->getTreeId(), |
@@ -1182,7 +1182,7 @@ discard block |
||
1182 | 1182 | if ($tot == 0) { |
1183 | 1183 | return ''; |
1184 | 1184 | } else { |
1185 | - $chd = $this->arrayToExtendedEncoding([ |
|
1185 | + $chd = $this->arrayToExtendedEncoding([ |
|
1186 | 1186 | 4095 * $tot_l / $tot, |
1187 | 1187 | 4095 * $tot_d / $tot, |
1188 | 1188 | ]); |
@@ -1253,18 +1253,18 @@ discard block |
||
1253 | 1253 | if ($type == 'unknown') { |
1254 | 1254 | // There has to be a better way then this :( |
1255 | 1255 | foreach ($this->media_types as $t) { |
1256 | - $sql .= " AND (m_gedcom NOT LIKE ? AND m_gedcom NOT LIKE ?)"; |
|
1256 | + $sql .= " AND (m_gedcom NOT LIKE ? AND m_gedcom NOT LIKE ?)"; |
|
1257 | 1257 | $vars[] = "%3 TYPE {$t}%"; |
1258 | 1258 | $vars[] = "%1 _TYPE {$t}%"; |
1259 | 1259 | } |
1260 | 1260 | } else { |
1261 | - $sql .= " AND (m_gedcom LIKE ? OR m_gedcom LIKE ?)"; |
|
1261 | + $sql .= " AND (m_gedcom LIKE ? OR m_gedcom LIKE ?)"; |
|
1262 | 1262 | $vars[] = "%3 TYPE {$type}%"; |
1263 | 1263 | $vars[] = "%1 _TYPE {$type}%"; |
1264 | 1264 | } |
1265 | 1265 | } |
1266 | 1266 | |
1267 | - return (int)Database::prepare($sql)->execute($vars)->fetchOne(); |
|
1267 | + return (int) Database::prepare($sql)->execute($vars)->fetchOne(); |
|
1268 | 1268 | } |
1269 | 1269 | |
1270 | 1270 | /** |
@@ -1725,7 +1725,7 @@ discard block |
||
1725 | 1725 | private function totalPlacesQuery(): int |
1726 | 1726 | { |
1727 | 1727 | return |
1728 | - (int)Database::prepare("SELECT COUNT(*) FROM `##places` WHERE p_file=?") |
|
1728 | + (int) Database::prepare("SELECT COUNT(*) FROM `##places` WHERE p_file=?") |
|
1729 | 1729 | ->execute([$this->tree->getTreeId()]) |
1730 | 1730 | ->fetchOne(); |
1731 | 1731 | } |
@@ -1895,7 +1895,7 @@ discard block |
||
1895 | 1895 | $chart_url .= '&chs=' . $WT_STATS_MAP_X . 'x' . $WT_STATS_MAP_Y; |
1896 | 1896 | $chart_url .= '&chld=' . implode('', array_keys($surn_countries)) . '&chd=s:'; |
1897 | 1897 | foreach ($surn_countries as $count) { |
1898 | - $chart_url .= substr(self::GOOGLE_CHART_ENCODING, (int)($count / max($surn_countries) * 61), 1); |
|
1898 | + $chart_url .= substr(self::GOOGLE_CHART_ENCODING, (int) ($count / max($surn_countries) * 61), 1); |
|
1899 | 1899 | } |
1900 | 1900 | $chart = '<div id="google_charts" class="center">'; |
1901 | 1901 | $chart .= '<p>' . $chart_title . '</p>'; |
@@ -1937,9 +1937,9 @@ discard block |
||
1937 | 1937 | $country = trim($place->country); |
1938 | 1938 | if (array_key_exists($country, $country_names)) { |
1939 | 1939 | if (!isset($all_db_countries[$country_names[$country]][$country])) { |
1940 | - $all_db_countries[$country_names[$country]][$country] = (int)$place->tot; |
|
1940 | + $all_db_countries[$country_names[$country]][$country] = (int) $place->tot; |
|
1941 | 1941 | } else { |
1942 | - $all_db_countries[$country_names[$country]][$country] += (int)$place->tot; |
|
1942 | + $all_db_countries[$country_names[$country]][$country] += (int) $place->tot; |
|
1943 | 1943 | } |
1944 | 1944 | } |
1945 | 1945 | } |
@@ -2116,7 +2116,7 @@ discard block |
||
2116 | 2116 | $centuries = ''; |
2117 | 2117 | $counts = []; |
2118 | 2118 | foreach ($rows as $values) { |
2119 | - $counts[] = round(100 * $values->total / $tot, 0); |
|
2119 | + $counts[] = round(100 * $values->total / $tot, 0); |
|
2120 | 2120 | $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|'; |
2121 | 2121 | } |
2122 | 2122 | $chd = $this->arrayToExtendedEncoding($counts); |
@@ -2210,7 +2210,7 @@ discard block |
||
2210 | 2210 | $centuries = ''; |
2211 | 2211 | $counts = []; |
2212 | 2212 | foreach ($rows as $values) { |
2213 | - $counts[] = round(100 * $values->total / $tot, 0); |
|
2213 | + $counts[] = round(100 * $values->total / $tot, 0); |
|
2214 | 2214 | $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|'; |
2215 | 2215 | } |
2216 | 2216 | $chd = $this->arrayToExtendedEncoding($counts); |
@@ -2460,7 +2460,7 @@ discard block |
||
2460 | 2460 | } |
2461 | 2461 | break; |
2462 | 2462 | case 'age': |
2463 | - $result = I18N::number((int)($row->age / 365.25)); |
|
2463 | + $result = I18N::number((int) ($row->age / 365.25)); |
|
2464 | 2464 | break; |
2465 | 2465 | case 'name': |
2466 | 2466 | $result = '<a href="' . e($person->url()) . '">' . $person->getFullName() . '</a>'; |
@@ -2489,7 +2489,7 @@ discard block |
||
2489 | 2489 | $sex_search = ''; |
2490 | 2490 | } |
2491 | 2491 | if (isset($params[0])) { |
2492 | - $total = (int)$params[0]; |
|
2492 | + $total = (int) $params[0]; |
|
2493 | 2493 | } else { |
2494 | 2494 | $total = 10; |
2495 | 2495 | } |
@@ -2523,10 +2523,10 @@ discard block |
||
2523 | 2523 | foreach ($rows as $row) { |
2524 | 2524 | $person = Individual::getInstance($row->deathdate, $this->tree); |
2525 | 2525 | $age = $row->age; |
2526 | - if ((int)($age / 365.25) > 0) { |
|
2527 | - $age = (int)($age / 365.25) . 'y'; |
|
2528 | - } elseif ((int)($age / 30.4375) > 0) { |
|
2529 | - $age = (int)($age / 30.4375) . 'm'; |
|
2526 | + if ((int) ($age / 365.25) > 0) { |
|
2527 | + $age = (int) ($age / 365.25) . 'y'; |
|
2528 | + } elseif ((int) ($age / 30.4375) > 0) { |
|
2529 | + $age = (int) ($age / 30.4375) . 'm'; |
|
2530 | 2530 | } else { |
2531 | 2531 | $age = $age . 'd'; |
2532 | 2532 | } |
@@ -2588,11 +2588,11 @@ discard block |
||
2588 | 2588 | $sex_search = ''; |
2589 | 2589 | } |
2590 | 2590 | if (isset($params[0])) { |
2591 | - $total = (int)$params[0]; |
|
2591 | + $total = (int) $params[0]; |
|
2592 | 2592 | } else { |
2593 | 2593 | $total = 10; |
2594 | 2594 | } |
2595 | - $rows = $this->runSql( |
|
2595 | + $rows = $this->runSql( |
|
2596 | 2596 | "SELECT" . |
2597 | 2597 | " birth.d_gid AS id," . |
2598 | 2598 | " MIN(birth.d_julianday1) AS age" . |
@@ -2615,10 +2615,10 @@ discard block |
||
2615 | 2615 | foreach ($rows as $row) { |
2616 | 2616 | $person = Individual::getInstance($row->id, $this->tree); |
2617 | 2617 | $age = (WT_CLIENT_JD - $row->age); |
2618 | - if ((int)($age / 365.25) > 0) { |
|
2619 | - $age = (int)($age / 365.25) . 'y'; |
|
2620 | - } elseif ((int)($age / 30.4375) > 0) { |
|
2621 | - $age = (int)($age / 30.4375) . 'm'; |
|
2618 | + if ((int) ($age / 365.25) > 0) { |
|
2619 | + $age = (int) ($age / 365.25) . 'y'; |
|
2620 | + } elseif ((int) ($age / 30.4375) > 0) { |
|
2621 | + $age = (int) ($age / 30.4375) . 'm'; |
|
2622 | 2622 | } else { |
2623 | 2623 | $age = $age . 'd'; |
2624 | 2624 | } |
@@ -2695,10 +2695,10 @@ discard block |
||
2695 | 2695 | |
2696 | 2696 | $age = $rows[0]->age; |
2697 | 2697 | if ($show_years) { |
2698 | - if ((int)($age / 365.25) > 0) { |
|
2699 | - $age = (int)($age / 365.25) . 'y'; |
|
2700 | - } elseif ((int)($age / 30.4375) > 0) { |
|
2701 | - $age = (int)($age / 30.4375) . 'm'; |
|
2698 | + if ((int) ($age / 365.25) > 0) { |
|
2699 | + $age = (int) ($age / 365.25) . 'y'; |
|
2700 | + } elseif ((int) ($age / 30.4375) > 0) { |
|
2701 | + $age = (int) ($age / 30.4375) . 'm'; |
|
2702 | 2702 | } elseif (!empty($age)) { |
2703 | 2703 | $age = $age . 'd'; |
2704 | 2704 | } |
@@ -2768,7 +2768,7 @@ discard block |
||
2768 | 2768 | if ($sizes[0] < 980) { |
2769 | 2769 | $sizes[0] += 50; |
2770 | 2770 | } |
2771 | - $chxl .= $this->centuryName($century) . '|'; |
|
2771 | + $chxl .= $this->centuryName($century) . '|'; |
|
2772 | 2772 | $average = 0; |
2773 | 2773 | if (isset($values['F'])) { |
2774 | 2774 | $countsf .= $values['F'] . ','; |
@@ -2810,7 +2810,7 @@ discard block |
||
2810 | 2810 | while ($offset = strpos($title, ' ', $offset + 1)) { |
2811 | 2811 | $counter[] = $offset; |
2812 | 2812 | } |
2813 | - $half = (int)(\count($counter) / 2); |
|
2813 | + $half = (int) (\count($counter) / 2); |
|
2814 | 2814 | $chtt = substr_replace($title, '|', $counter[$half], 1); |
2815 | 2815 | } |
2816 | 2816 | |
@@ -3386,16 +3386,16 @@ discard block |
||
3386 | 3386 | case 'age': |
3387 | 3387 | $age = $row->age; |
3388 | 3388 | if ($show_years) { |
3389 | - if ((int)($age / 365.25) > 0) { |
|
3390 | - $age = (int)($age / 365.25) . 'y'; |
|
3391 | - } elseif ((int)($age / 30.4375) > 0) { |
|
3392 | - $age = (int)($age / 30.4375) . 'm'; |
|
3389 | + if ((int) ($age / 365.25) > 0) { |
|
3390 | + $age = (int) ($age / 365.25) . 'y'; |
|
3391 | + } elseif ((int) ($age / 30.4375) > 0) { |
|
3392 | + $age = (int) ($age / 30.4375) . 'm'; |
|
3393 | 3393 | } else { |
3394 | 3394 | $age = $age . 'd'; |
3395 | 3395 | } |
3396 | 3396 | $result = FunctionsDate::getAgeAtEvent($age); |
3397 | 3397 | } else { |
3398 | - $result = I18N::number((int)($age / 365.25)); |
|
3398 | + $result = I18N::number((int) ($age / 365.25)); |
|
3399 | 3399 | } |
3400 | 3400 | break; |
3401 | 3401 | } |
@@ -3415,7 +3415,7 @@ discard block |
||
3415 | 3415 | private function ageOfMarriageQuery($type = 'list', $age_dir = 'ASC', $params = []): string |
3416 | 3416 | { |
3417 | 3417 | if (isset($params[0])) { |
3418 | - $total = (int)$params[0]; |
|
3418 | + $total = (int) $params[0]; |
|
3419 | 3419 | } else { |
3420 | 3420 | $total = 10; |
3421 | 3421 | } |
@@ -3498,10 +3498,10 @@ discard block |
||
3498 | 3498 | if ($type === 'name') { |
3499 | 3499 | return $family->formatList(); |
3500 | 3500 | } |
3501 | - if ((int)($age / 365.25) > 0) { |
|
3502 | - $age = (int)($age / 365.25) . 'y'; |
|
3503 | - } elseif ((int)($age / 30.4375) > 0) { |
|
3504 | - $age = (int)($age / 30.4375) . 'm'; |
|
3501 | + if ((int) ($age / 365.25) > 0) { |
|
3502 | + $age = (int) ($age / 365.25) . 'y'; |
|
3503 | + } elseif ((int) ($age / 30.4375) > 0) { |
|
3504 | + $age = (int) ($age / 30.4375) . 'm'; |
|
3505 | 3505 | } else { |
3506 | 3506 | $age = $age . 'd'; |
3507 | 3507 | } |
@@ -3563,7 +3563,7 @@ discard block |
||
3563 | 3563 | private function ageBetweenSpousesQuery($type = 'list', $age_dir = 'DESC', $params = []): string |
3564 | 3564 | { |
3565 | 3565 | if (isset($params[0])) { |
3566 | - $total = (int)$params[0]; |
|
3566 | + $total = (int) $params[0]; |
|
3567 | 3567 | } else { |
3568 | 3568 | $total = 10; |
3569 | 3569 | } |
@@ -3608,10 +3608,10 @@ discard block |
||
3608 | 3608 | break; |
3609 | 3609 | } |
3610 | 3610 | $age = $fam->age; |
3611 | - if ((int)($age / 365.25) > 0) { |
|
3612 | - $age = (int)($age / 365.25) . 'y'; |
|
3613 | - } elseif ((int)($age / 30.4375) > 0) { |
|
3614 | - $age = (int)($age / 30.4375) . 'm'; |
|
3611 | + if ((int) ($age / 365.25) > 0) { |
|
3612 | + $age = (int) ($age / 365.25) . 'y'; |
|
3613 | + } elseif ((int) ($age / 30.4375) > 0) { |
|
3614 | + $age = (int) ($age / 30.4375) . 'm'; |
|
3615 | 3615 | } else { |
3616 | 3616 | $age = $age . 'd'; |
3617 | 3617 | } |
@@ -3699,16 +3699,16 @@ discard block |
||
3699 | 3699 | case 'age': |
3700 | 3700 | $age = $row->age; |
3701 | 3701 | if ($show_years) { |
3702 | - if ((int)($age / 365.25) > 0) { |
|
3703 | - $age = (int)($age / 365.25) . 'y'; |
|
3704 | - } elseif ((int)($age / 30.4375) > 0) { |
|
3705 | - $age = (int)($age / 30.4375) . 'm'; |
|
3702 | + if ((int) ($age / 365.25) > 0) { |
|
3703 | + $age = (int) ($age / 365.25) . 'y'; |
|
3704 | + } elseif ((int) ($age / 30.4375) > 0) { |
|
3705 | + $age = (int) ($age / 30.4375) . 'm'; |
|
3706 | 3706 | } else { |
3707 | 3707 | $age = $age . 'd'; |
3708 | 3708 | } |
3709 | 3709 | $result = FunctionsDate::getAgeAtEvent($age); |
3710 | 3710 | } else { |
3711 | - $result = (int)($age / 365.25); |
|
3711 | + $result = (int) ($age / 365.25); |
|
3712 | 3712 | } |
3713 | 3713 | break; |
3714 | 3714 | } |
@@ -3792,7 +3792,7 @@ discard block |
||
3792 | 3792 | $sizes = explode('x', $size); |
3793 | 3793 | $tot = 0; |
3794 | 3794 | foreach ($rows as $values) { |
3795 | - $tot += (int)$values->total; |
|
3795 | + $tot += (int) $values->total; |
|
3796 | 3796 | } |
3797 | 3797 | // Beware divide by zero |
3798 | 3798 | if ($tot === 0) { |
@@ -3801,7 +3801,7 @@ discard block |
||
3801 | 3801 | $centuries = ''; |
3802 | 3802 | $counts = []; |
3803 | 3803 | foreach ($rows as $values) { |
3804 | - $counts[] = round(100 * $values->total / $tot, 0); |
|
3804 | + $counts[] = round(100 * $values->total / $tot, 0); |
|
3805 | 3805 | $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|'; |
3806 | 3806 | } |
3807 | 3807 | $chd = $this->arrayToExtendedEncoding($counts); |
@@ -3897,7 +3897,7 @@ discard block |
||
3897 | 3897 | $centuries = ''; |
3898 | 3898 | $counts = []; |
3899 | 3899 | foreach ($rows as $values) { |
3900 | - $counts[] = round(100 * $values->total / $tot, 0); |
|
3900 | + $counts[] = round(100 * $values->total / $tot, 0); |
|
3901 | 3901 | $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|'; |
3902 | 3902 | } |
3903 | 3903 | $chd = $this->arrayToExtendedEncoding($counts); |
@@ -4166,7 +4166,7 @@ discard block |
||
4166 | 4166 | if ($sizes[0] < 1000) { |
4167 | 4167 | $sizes[0] += 50; |
4168 | 4168 | } |
4169 | - $chxl .= $this->centuryName($century) . '|'; |
|
4169 | + $chxl .= $this->centuryName($century) . '|'; |
|
4170 | 4170 | $average = 0; |
4171 | 4171 | if (isset($values['F'])) { |
4172 | 4172 | if ($max <= 50) { |
@@ -4223,7 +4223,7 @@ discard block |
||
4223 | 4223 | while ($offset = strpos(I18N::translate('Average age in century of marriage'), ' ', $offset + 1)) { |
4224 | 4224 | $counter[] = $offset; |
4225 | 4225 | } |
4226 | - $half = (int)(\count($counter) / 2); |
|
4226 | + $half = (int) (\count($counter) / 2); |
|
4227 | 4227 | $chtt = substr_replace(I18N::translate('Average age in century of marriage'), '|', $counter[$half], 1); |
4228 | 4228 | } |
4229 | 4229 | |
@@ -4759,7 +4759,7 @@ discard block |
||
4759 | 4759 | private function topTenFamilyQuery($type = 'list', $params = []): string |
4760 | 4760 | { |
4761 | 4761 | if (isset($params[0])) { |
4762 | - $total = (int)$params[0]; |
|
4762 | + $total = (int) $params[0]; |
|
4763 | 4763 | } else { |
4764 | 4764 | $total = 10; |
4765 | 4765 | } |
@@ -4826,7 +4826,7 @@ discard block |
||
4826 | 4826 | private function ageBetweenSiblingsQuery($type = 'list', $params = []): string |
4827 | 4827 | { |
4828 | 4828 | if (isset($params[0])) { |
4829 | - $total = (int)$params[0]; |
|
4829 | + $total = (int) $params[0]; |
|
4830 | 4830 | } else { |
4831 | 4831 | $total = 10; |
4832 | 4832 | } |
@@ -4882,10 +4882,10 @@ discard block |
||
4882 | 4882 | return $return; |
4883 | 4883 | } |
4884 | 4884 | $age = $fam->age; |
4885 | - if ((int)($age / 365.25) > 0) { |
|
4886 | - $age = (int)($age / 365.25) . 'y'; |
|
4887 | - } elseif ((int)($age / 30.4375) > 0) { |
|
4888 | - $age = (int)($age / 30.4375) . 'm'; |
|
4885 | + if ((int) ($age / 365.25) > 0) { |
|
4886 | + $age = (int) ($age / 365.25) . 'y'; |
|
4887 | + } elseif ((int) ($age / 30.4375) > 0) { |
|
4888 | + $age = (int) ($age / 30.4375) . 'm'; |
|
4889 | 4889 | } else { |
4890 | 4890 | $age = $age . 'd'; |
4891 | 4891 | } |
@@ -4896,7 +4896,7 @@ discard block |
||
4896 | 4896 | if ($type == 'list') { |
4897 | 4897 | if ($one && !\in_array($fam->family, $dist)) { |
4898 | 4898 | if ($child1->canShow() && $child2->canShow()) { |
4899 | - $return = '<li>'; |
|
4899 | + $return = '<li>'; |
|
4900 | 4900 | $return .= '<a href="' . e($child2->url()) . '">' . $child2->getFullName() . '</a> '; |
4901 | 4901 | $return .= I18N::translate('and') . ' '; |
4902 | 4902 | $return .= '<a href="' . e($child1->url()) . '">' . $child1->getFullName() . '</a>'; |
@@ -4907,7 +4907,7 @@ discard block |
||
4907 | 4907 | $dist[] = $fam->family; |
4908 | 4908 | } |
4909 | 4909 | } elseif (!$one && $child1->canShow() && $child2->canShow()) { |
4910 | - $return = '<li>'; |
|
4910 | + $return = '<li>'; |
|
4911 | 4911 | $return .= '<a href="' . e($child2->url()) . '">' . $child2->getFullName() . '</a> '; |
4912 | 4912 | $return .= I18N::translate('and') . ' '; |
4913 | 4913 | $return .= '<a href="' . e($child1->url()) . '">' . $child1->getFullName() . '</a>'; |
@@ -5182,7 +5182,7 @@ discard block |
||
5182 | 5182 | $total = 10; |
5183 | 5183 | } |
5184 | 5184 | $sizes = explode('x', $size); |
5185 | - $total = (int)$total; |
|
5185 | + $total = (int) $total; |
|
5186 | 5186 | $rows = $this->runSql( |
5187 | 5187 | " SELECT f_numchil AS tot, f_id AS id" . |
5188 | 5188 | " FROM `##families`" . |
@@ -5195,7 +5195,7 @@ discard block |
||
5195 | 5195 | } |
5196 | 5196 | $tot = 0; |
5197 | 5197 | foreach ($rows as $row) { |
5198 | - $tot += (int)$row->tot; |
|
5198 | + $tot += (int) $row->tot; |
|
5199 | 5199 | } |
5200 | 5200 | $chd = ''; |
5201 | 5201 | $chl = []; |
@@ -5207,7 +5207,7 @@ discard block |
||
5207 | 5207 | } else { |
5208 | 5208 | $per = round(100 * $row->tot / $tot, 0); |
5209 | 5209 | } |
5210 | - $chd .= $this->arrayToExtendedEncoding([$per]); |
|
5210 | + $chd .= $this->arrayToExtendedEncoding([$per]); |
|
5211 | 5211 | $chl[] = htmlspecialchars_decode(strip_tags($family->getFullName())) . ' - ' . I18N::number($row->tot); |
5212 | 5212 | } |
5213 | 5213 | } |
@@ -5553,7 +5553,7 @@ discard block |
||
5553 | 5553 | if ($max < $values->count) { |
5554 | 5554 | $max = $values->count; |
5555 | 5555 | } |
5556 | - $tot += (int)$values->count; |
|
5556 | + $tot += (int) $values->count; |
|
5557 | 5557 | } |
5558 | 5558 | $unknown = $this->noChildrenFamiliesQuery() - $tot; |
5559 | 5559 | if ($unknown > $max) { |
@@ -5577,13 +5577,13 @@ discard block |
||
5577 | 5577 | $chm .= 't' . $unknown . ',000000,0,' . $i . ',11,1'; |
5578 | 5578 | $chxl .= I18N::translateContext('unknown century', 'Unknown') . '|1:||' . I18N::translate('century') . '|2:|0|'; |
5579 | 5579 | $step = $max + 1; |
5580 | - for ($d = (int)($max + 1); $d > 0; $d--) { |
|
5580 | + for ($d = (int) ($max + 1); $d > 0; $d--) { |
|
5581 | 5581 | if (($max + 1) < ($d * 10 + 1) && fmod(($max + 1), $d) == 0) { |
5582 | 5582 | $step = $d; |
5583 | 5583 | } |
5584 | 5584 | } |
5585 | - if ($step == (int)($max + 1)) { |
|
5586 | - for ($d = (int)($max); $d > 0; $d--) { |
|
5585 | + if ($step == (int) ($max + 1)) { |
|
5586 | + for ($d = (int) ($max); $d > 0; $d--) { |
|
5587 | 5587 | if ($max < ($d * 10 + 1) && fmod($max, $d) == 0) { |
5588 | 5588 | $step = $d; |
5589 | 5589 | } |
@@ -5608,7 +5608,7 @@ discard block |
||
5608 | 5608 | private function topTenGrandFamilyQuery($type = 'list', $params = []): string |
5609 | 5609 | { |
5610 | 5610 | if (isset($params[0])) { |
5611 | - $total = (int)$params[0]; |
|
5611 | + $total = (int) $params[0]; |
|
5612 | 5612 | } else { |
5613 | 5613 | $total = 10; |
5614 | 5614 | } |
@@ -5706,8 +5706,8 @@ discard block |
||
5706 | 5706 | */ |
5707 | 5707 | private function commonSurnamesQuery($type = 'list', $show_tot = false, $params = []): string |
5708 | 5708 | { |
5709 | - $threshold = empty($params[0]) ? 10 : (int)$params[0]; |
|
5710 | - $number_of_surnames = empty($params[1]) ? 10 : (int)$params[1]; |
|
5709 | + $threshold = empty($params[0]) ? 10 : (int) $params[0]; |
|
5710 | + $number_of_surnames = empty($params[1]) ? 10 : (int) $params[1]; |
|
5711 | 5711 | $sorting = empty($params[2]) ? 'alpha' : $params[2]; |
5712 | 5712 | |
5713 | 5713 | $surnames = $this->topSurnames($number_of_surnames, $threshold); |
@@ -5879,7 +5879,7 @@ discard block |
||
5879 | 5879 | $max_name = 0; |
5880 | 5880 | $top_name = ''; |
5881 | 5881 | foreach ($surns as $spfxsurn => $count) { |
5882 | - $per = $count; |
|
5882 | + $per = $count; |
|
5883 | 5883 | $count_per += $per; |
5884 | 5884 | // select most common surname from all variants |
5885 | 5885 | if ($per > $max_name) { |
@@ -5903,11 +5903,11 @@ discard block |
||
5903 | 5903 | ], $top_name); |
5904 | 5904 | } |
5905 | 5905 | $per = round(100 * $count_per / $tot_indi, 0); |
5906 | - $chd .= $this->arrayToExtendedEncoding([$per]); |
|
5906 | + $chd .= $this->arrayToExtendedEncoding([$per]); |
|
5907 | 5907 | $chl[] = $top_name . ' - ' . I18N::number($count_per); |
5908 | 5908 | } |
5909 | 5909 | $per = round(100 * ($tot_indi - $tot) / $tot_indi, 0); |
5910 | - $chd .= $this->arrayToExtendedEncoding([$per]); |
|
5910 | + $chd .= $this->arrayToExtendedEncoding([$per]); |
|
5911 | 5911 | $chl[] = I18N::translate('Other') . ' - ' . I18N::number($tot_indi - $tot); |
5912 | 5912 | |
5913 | 5913 | $chart_title = implode(I18N::$list_separator, $chl); |
@@ -5929,12 +5929,12 @@ discard block |
||
5929 | 5929 | private function commonGivenQuery($sex = 'B', $type = 'list', $show_tot = false, $params = []) |
5930 | 5930 | { |
5931 | 5931 | if (isset($params[0]) && $params[0] != '' && $params[0] >= 0) { |
5932 | - $threshold = (int)$params[0]; |
|
5932 | + $threshold = (int) $params[0]; |
|
5933 | 5933 | } else { |
5934 | 5934 | $threshold = 1; |
5935 | 5935 | } |
5936 | 5936 | if (isset($params[1]) && $params[1] != '' && $params[1] >= 0) { |
5937 | - $maxtoshow = (int)$params[1]; |
|
5937 | + $maxtoshow = (int) $params[1]; |
|
5938 | 5938 | } else { |
5939 | 5939 | $maxtoshow = 10; |
5940 | 5940 | } |
@@ -6327,11 +6327,11 @@ discard block |
||
6327 | 6327 | } else { |
6328 | 6328 | $per = round(100 * $count / $tot_indi, 0); |
6329 | 6329 | } |
6330 | - $chd .= $this->arrayToExtendedEncoding([$per]); |
|
6330 | + $chd .= $this->arrayToExtendedEncoding([$per]); |
|
6331 | 6331 | $chl[] = $givn . ' - ' . I18N::number($count); |
6332 | 6332 | } |
6333 | 6333 | $per = round(100 * ($tot_indi - $tot) / $tot_indi, 0); |
6334 | - $chd .= $this->arrayToExtendedEncoding([$per]); |
|
6334 | + $chd .= $this->arrayToExtendedEncoding([$per]); |
|
6335 | 6335 | $chl[] = I18N::translate('Other') . ' - ' . I18N::number($tot_indi - $tot); |
6336 | 6336 | |
6337 | 6337 | $chart_title = implode(I18N::$list_separator, $chl); |
@@ -6558,7 +6558,7 @@ discard block |
||
6558 | 6558 | $datestamp = I18N::dateFormat(); |
6559 | 6559 | } |
6560 | 6560 | |
6561 | - return FunctionsDate::timestampToGedcomDate((int)$user->getPreference('reg_timestamp'))->display(false, $datestamp); |
|
6561 | + return FunctionsDate::timestampToGedcomDate((int) $user->getPreference('reg_timestamp'))->display(false, $datestamp); |
|
6562 | 6562 | case 'regtime': |
6563 | 6563 | if (\is_array($params) && isset($params[0]) && $params[0] != '') { |
6564 | 6564 | $datestamp = $params[0]; |
@@ -6566,7 +6566,7 @@ discard block |
||
6566 | 6566 | $datestamp = str_replace('%', '', I18N::timeFormat()); |
6567 | 6567 | } |
6568 | 6568 | |
6569 | - return date($datestamp, (int)$user->getPreference('reg_timestamp')); |
|
6569 | + return date($datestamp, (int) $user->getPreference('reg_timestamp')); |
|
6570 | 6570 | case 'loggedin': |
6571 | 6571 | if (\is_array($params) && isset($params[0]) && $params[0] != '') { |
6572 | 6572 | $yes = $params[0]; |
@@ -6906,9 +6906,9 @@ discard block |
||
6906 | 6906 | if ($value < 0) { |
6907 | 6907 | $value = 0; |
6908 | 6908 | } |
6909 | - $first = (int)($value / 64); |
|
6909 | + $first = (int) ($value / 64); |
|
6910 | 6910 | $second = $value % 64; |
6911 | - $encoding .= $xencoding[(int)$first] . $xencoding[(int)$second]; |
|
6911 | + $encoding .= $xencoding[(int) $first] . $xencoding[(int) $second]; |
|
6912 | 6912 | } |
6913 | 6913 | |
6914 | 6914 | return $encoding; |
@@ -7052,7 +7052,7 @@ discard block |
||
7052 | 7052 | */ |
7053 | 7053 | public function totalUserMessages(): string |
7054 | 7054 | { |
7055 | - $total = (int)Database::prepare("SELECT COUNT(*) FROM `##message` WHERE user_id = ?") |
|
7055 | + $total = (int) Database::prepare("SELECT COUNT(*) FROM `##message` WHERE user_id = ?") |
|
7056 | 7056 | ->execute([Auth::id()]) |
7057 | 7057 | ->fetchOne(); |
7058 | 7058 | |
@@ -7067,7 +7067,7 @@ discard block |
||
7067 | 7067 | public function totalUserJournal(): string |
7068 | 7068 | { |
7069 | 7069 | try { |
7070 | - $number = (int)Database::prepare("SELECT COUNT(*) FROM `##news` WHERE user_id = ?") |
|
7070 | + $number = (int) Database::prepare("SELECT COUNT(*) FROM `##news` WHERE user_id = ?") |
|
7071 | 7071 | ->execute([Auth::id()]) |
7072 | 7072 | ->fetchOne(); |
7073 | 7073 | } catch (PDOException $ex) { |
@@ -7088,7 +7088,7 @@ discard block |
||
7088 | 7088 | public function totalGedcomNews(): string |
7089 | 7089 | { |
7090 | 7090 | try { |
7091 | - $number = (int)Database::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?") |
|
7091 | + $number = (int) Database::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?") |
|
7092 | 7092 | ->execute([$this->tree->getTreeId()]) |
7093 | 7093 | ->fetchOne(); |
7094 | 7094 | } catch (PDOException $ex) { |
@@ -145,7 +145,7 @@ discard block |
||
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 |
||
727 | 727 | public function textWrap($str, $width): string |
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) { |