@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | ->setPreference('sessiontime', '0'); |
| 119 | 119 | |
| 120 | 120 | // Create a dummy user, so we can send messages from the tree. |
| 121 | - $sender = new User((object)[ |
|
| 121 | + $sender = new User((object) [ |
|
| 122 | 122 | 'user_id' => null, |
| 123 | 123 | 'user_name' => '', |
| 124 | 124 | 'real_name' => $tree->getTitle(), |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | ); |
| 138 | 138 | |
| 139 | 139 | // Tell the genealogy contact about the registration. |
| 140 | - $webmaster = User::find((int)$tree->getPreference('WEBMASTER_USER_ID')); |
|
| 140 | + $webmaster = User::find((int) $tree->getPreference('WEBMASTER_USER_ID')); |
|
| 141 | 141 | |
| 142 | 142 | if ($webmaster !== null) { |
| 143 | 143 | I18N::init($webmaster->getPreference('language')); |
@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $this->checkIndividualAccess($individual); |
| 64 | 64 | |
| 65 | - $chart_style = (int)$request->get('chart_style', self::DEFAULT_STYLE); |
|
| 66 | - $fan_width = (int)$request->get('fan_width', self::DEFAULT_WIDTH); |
|
| 67 | - $generations = (int)$request->get('generations', self::DEFAULT_GENERATIONS); |
|
| 65 | + $chart_style = (int) $request->get('chart_style', self::DEFAULT_STYLE); |
|
| 66 | + $fan_width = (int) $request->get('fan_width', self::DEFAULT_WIDTH); |
|
| 67 | + $generations = (int) $request->get('generations', self::DEFAULT_GENERATIONS); |
|
| 68 | 68 | |
| 69 | 69 | $fan_width = min($fan_width, self::MAXIMUM_WIDTH); |
| 70 | 70 | $fan_width = max($fan_width, self::MINIMUM_WIDTH); |
@@ -106,9 +106,9 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | $this->checkIndividualAccess($individual); |
| 108 | 108 | |
| 109 | - $chart_style = (int)$request->get('chart_style', self::DEFAULT_STYLE); |
|
| 110 | - $fan_width = (int)$request->get('fan_width', self::DEFAULT_WIDTH); |
|
| 111 | - $generations = (int)$request->get('generations', self::DEFAULT_GENERATIONS); |
|
| 109 | + $chart_style = (int) $request->get('chart_style', self::DEFAULT_STYLE); |
|
| 110 | + $fan_width = (int) $request->get('fan_width', self::DEFAULT_WIDTH); |
|
| 111 | + $generations = (int) $request->get('generations', self::DEFAULT_GENERATIONS); |
|
| 112 | 112 | |
| 113 | 113 | $fan_width = min($fan_width, self::MAXIMUM_WIDTH); |
| 114 | 114 | $fan_width = max($fan_width, self::MINIMUM_WIDTH); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $scale = $fanw / 640; |
| 138 | 138 | |
| 139 | 139 | // Create the image |
| 140 | - $image = imagecreate((int)$fanw, (int)$fanh); |
|
| 140 | + $image = imagecreate((int) $fanw, (int) $fanh); |
|
| 141 | 141 | |
| 142 | 142 | // Create colors |
| 143 | 143 | $transparent = imagecolorallocate($image, 0, 0, 0); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | ]; |
| 155 | 155 | |
| 156 | 156 | |
| 157 | - imagefilledrectangle($image, 0, 0, (int)$fanw, (int)$fanh, $transparent); |
|
| 157 | + imagefilledrectangle($image, 0, 0, (int) $fanw, (int) $fanh, $transparent); |
|
| 158 | 158 | |
| 159 | 159 | $fandeg = 90 * $chart_style; |
| 160 | 160 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | // clean current generation area |
| 170 | 170 | $deg2 = 360 + ($fandeg - 180) / 2; |
| 171 | 171 | $deg1 = $deg2 - $fandeg; |
| 172 | - imagefilledarc($image, (int)$cx, (int)$cy, (int)$rx, (int)$rx, (int)$deg1, (int)$deg2, $backgrounds['U'], IMG_ARC_PIE); |
|
| 172 | + imagefilledarc($image, (int) $cx, (int) $cy, (int) $rx, (int) $rx, (int) $deg1, (int) $deg2, $backgrounds['U'], IMG_ARC_PIE); |
|
| 173 | 173 | $rx -= 3; |
| 174 | 174 | |
| 175 | 175 | // calculate new angle |
@@ -199,15 +199,15 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | $background = $backgrounds[$person->getSex()]; |
| 201 | 201 | |
| 202 | - imagefilledarc($image, (int)$cx, (int)$cy, (int)$rx, (int)$rx, (int)$deg1, (int)$deg2, $background, IMG_ARC_PIE); |
|
| 202 | + imagefilledarc($image, (int) $cx, (int) $cy, (int) $rx, (int) $rx, (int) $deg1, (int) $deg2, $background, IMG_ARC_PIE); |
|
| 203 | 203 | |
| 204 | 204 | // split and center text by lines |
| 205 | - $wmax = (int)($angle * 7 / 7 * $scale); |
|
| 205 | + $wmax = (int) ($angle * 7 / 7 * $scale); |
|
| 206 | 206 | $wmax = min($wmax, 35 * $scale); |
| 207 | 207 | if ($gen == 0) { |
| 208 | 208 | $wmax = min($wmax, 17 * $scale); |
| 209 | 209 | } |
| 210 | - $text = $this->splitAlignText($text, (int)$wmax); |
|
| 210 | + $text = $this->splitAlignText($text, (int) $wmax); |
|
| 211 | 211 | |
| 212 | 212 | // text angle |
| 213 | 213 | $tangle = 270 - ($deg1 + $angle / 2); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | } |
| 377 | 377 | $line .= "$word"; |
| 378 | 378 | } else { |
| 379 | - $p = max(0, (int)(($maxlen - $len) / 2)); |
|
| 379 | + $p = max(0, (int) (($maxlen - $len) / 2)); |
|
| 380 | 380 | if (!empty($line)) { |
| 381 | 381 | $line = str_repeat(' ', $p) . $line; // center alignment using spaces |
| 382 | 382 | $text .= $line . "\n"; |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (in_array(ord($line{0}), $RTLOrd)) { |
| 392 | 392 | $len /= 2; |
| 393 | 393 | } |
| 394 | - $p = max(0, (int)(($maxlen - $len) / 2)); |
|
| 394 | + $p = max(0, (int) (($maxlen - $len) / 2)); |
|
| 395 | 395 | $line = str_repeat(' ', $p) . $line; // center alignment using spaces |
| 396 | 396 | $text .= $line; |
| 397 | 397 | } |
@@ -411,9 +411,9 @@ discard block |
||
| 411 | 411 | { |
| 412 | 412 | return imagecolorallocate( |
| 413 | 413 | $image, |
| 414 | - (int)hexdec(substr($css_color, 0, 2)), |
|
| 415 | - (int)hexdec(substr($css_color, 2, 2)), |
|
| 416 | - (int)hexdec(substr($css_color, 4, 2)) |
|
| 414 | + (int) hexdec(substr($css_color, 0, 2)), |
|
| 415 | + (int) hexdec(substr($css_color, 2, 2)), |
|
| 416 | + (int) hexdec(substr($css_color, 4, 2)) |
|
| 417 | 417 | ); |
| 418 | 418 | } |
| 419 | 419 | |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | $z_axis = $this->axisAll(); |
| 577 | 577 | // The stats query doesn't have an "all" function, so query M/F/U separately |
| 578 | 578 | foreach (['M', 'F', 'U'] as $sex) { |
| 579 | - $rows = $stats->statsMarrAgeQuery(false, $sex); |
|
| 579 | + $rows = $stats->statsMarrAgeQuery(false, $sex); |
|
| 580 | 580 | $indi = []; |
| 581 | 581 | foreach ($rows as $row) { |
| 582 | 582 | if (!in_array($row->d_gid, $indi)) { |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | case self::Z_AXIS_SEX: |
| 590 | 590 | $z_axis = $this->axisSexes(); |
| 591 | 591 | foreach (array_keys($z_axis) as $sex) { |
| 592 | - $rows = $stats->statsMarrAgeQuery(false, $sex); |
|
| 592 | + $rows = $stats->statsMarrAgeQuery(false, $sex); |
|
| 593 | 593 | $indi = []; |
| 594 | 594 | foreach ($rows as $row) { |
| 595 | 595 | if (!in_array($row->d_gid, $indi)) { |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | // The stats query doesn't have an "all" function, so query M/F/U separately |
| 606 | 606 | foreach (['M', 'F', 'U'] as $sex) { |
| 607 | 607 | $prev_boundary = 0; |
| 608 | - $indi = []; |
|
| 608 | + $indi = []; |
|
| 609 | 609 | foreach (array_keys($z_axis) as $boundary) { |
| 610 | 610 | $rows = $stats->statsMarrAgeQuery(false, $sex, $prev_boundary, $boundary); |
| 611 | 611 | foreach ($rows as $row) { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | private function getTags($text) |
| 158 | 158 | { |
| 159 | 159 | // Extract all tags from the provided text |
| 160 | - preg_match_all('/#([^#]+)(?=#)/', (string)$text, $match); |
|
| 160 | + preg_match_all('/#([^#]+)(?=#)/', (string) $text, $match); |
|
| 161 | 161 | $tags = $match[1]; |
| 162 | 162 | $c = count($tags); |
| 163 | 163 | $new_tags = []; // tag to replace |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | */ |
| 397 | 397 | private function totalIndividualsQuery() |
| 398 | 398 | { |
| 399 | - return (int)Database::prepare( |
|
| 399 | + return (int) Database::prepare( |
|
| 400 | 400 | "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id" |
| 401 | 401 | )->execute([ |
| 402 | 402 | 'tree_id' => $this->tree->getTreeId(), |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | */ |
| 421 | 421 | private function totalIndisWithSourcesQuery() |
| 422 | 422 | { |
| 423 | - return (int)Database::prepare( |
|
| 423 | + return (int) Database::prepare( |
|
| 424 | 424 | "SELECT COUNT(DISTINCT i_id)" . |
| 425 | 425 | " FROM `##individuals` JOIN `##link` ON i_id = l_from AND i_file = l_file" . |
| 426 | 426 | " WHERE l_file = :tree_id AND l_type = 'SOUR'" |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | */ |
| 504 | 504 | private function totalFamiliesQuery() |
| 505 | 505 | { |
| 506 | - return (int)Database::prepare( |
|
| 506 | + return (int) Database::prepare( |
|
| 507 | 507 | "SELECT COUNT(*) FROM `##families` WHERE f_file = :tree_id" |
| 508 | 508 | )->execute([ |
| 509 | 509 | 'tree_id' => $this->tree->getTreeId(), |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | */ |
| 528 | 528 | private function totalFamsWithSourcesQuery() |
| 529 | 529 | { |
| 530 | - return (int)Database::prepare( |
|
| 530 | + return (int) Database::prepare( |
|
| 531 | 531 | "SELECT COUNT(DISTINCT f_id)" . |
| 532 | 532 | " FROM `##families` JOIN `##link` ON f_id = l_from AND f_file = l_file" . |
| 533 | 533 | " WHERE l_file = :tree_id AND l_type = 'SOUR'" |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | */ |
| 611 | 611 | private function totalSourcesQuery() |
| 612 | 612 | { |
| 613 | - return (int)Database::prepare( |
|
| 613 | + return (int) Database::prepare( |
|
| 614 | 614 | "SELECT COUNT(*) FROM `##sources` WHERE s_file = :tree_id" |
| 615 | 615 | )->execute([ |
| 616 | 616 | 'tree_id' => $this->tree->getTreeId(), |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | */ |
| 645 | 645 | private function totalNotesQuery() |
| 646 | 646 | { |
| 647 | - return (int)Database::prepare( |
|
| 647 | + return (int) Database::prepare( |
|
| 648 | 648 | "SELECT COUNT(*) FROM `##other` WHERE o_type='NOTE' AND o_file = :tree_id" |
| 649 | 649 | )->execute([ |
| 650 | 650 | 'tree_id' => $this->tree->getTreeId(), |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | */ |
| 679 | 679 | private function totalRepositoriesQuery() |
| 680 | 680 | { |
| 681 | - return (int)Database::prepare( |
|
| 681 | + return (int) Database::prepare( |
|
| 682 | 682 | "SELECT COUNT(*) FROM `##other` WHERE o_type='REPO' AND o_file = :tree_id" |
| 683 | 683 | )->execute([ |
| 684 | 684 | 'tree_id' => $this->tree->getTreeId(), |
@@ -787,11 +787,11 @@ discard block |
||
| 787 | 787 | } |
| 788 | 788 | } |
| 789 | 789 | if ($types) { |
| 790 | - $sql .= ' AND d_fact IN (' . implode(', ', array_fill(0, count($types), '?')) . ')'; |
|
| 790 | + $sql .= ' AND d_fact IN (' . implode(', ', array_fill(0, count($types), '?')) . ')'; |
|
| 791 | 791 | $vars = array_merge($vars, $types); |
| 792 | 792 | } |
| 793 | 793 | } |
| 794 | - $sql .= ' AND d_fact NOT IN (' . implode(', ', array_fill(0, count($no_types), '?')) . ')'; |
|
| 794 | + $sql .= ' AND d_fact NOT IN (' . implode(', ', array_fill(0, count($no_types), '?')) . ')'; |
|
| 795 | 795 | $vars = array_merge($vars, $no_types); |
| 796 | 796 | |
| 797 | 797 | return I18N::number(Database::prepare($sql)->execute($vars)->fetchOne()); |
@@ -901,7 +901,7 @@ discard block |
||
| 901 | 901 | */ |
| 902 | 902 | private function totalSexMalesQuery() |
| 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() |
| 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() |
| 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() |
| 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() |
| 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 | ]); |
@@ -1206,7 +1206,7 @@ discard block |
||
| 1206 | 1206 | public function totalUsers($params = []) |
| 1207 | 1207 | { |
| 1208 | 1208 | if (isset($params[0])) { |
| 1209 | - $total = count(User::all()) + (int)$params[0]; |
|
| 1209 | + $total = count(User::all()) + (int) $params[0]; |
|
| 1210 | 1210 | } else { |
| 1211 | 1211 | $total = count(User::all()); |
| 1212 | 1212 | } |
@@ -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() |
| 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 = []) |
| 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 | } |
@@ -3501,10 +3501,10 @@ discard block |
||
| 3501 | 3501 | if ($type === 'name') { |
| 3502 | 3502 | return $family->formatList(); |
| 3503 | 3503 | } |
| 3504 | - if ((int)($age / 365.25) > 0) { |
|
| 3505 | - $age = (int)($age / 365.25) . 'y'; |
|
| 3506 | - } elseif ((int)($age / 30.4375) > 0) { |
|
| 3507 | - $age = (int)($age / 30.4375) . 'm'; |
|
| 3504 | + if ((int) ($age / 365.25) > 0) { |
|
| 3505 | + $age = (int) ($age / 365.25) . 'y'; |
|
| 3506 | + } elseif ((int) ($age / 30.4375) > 0) { |
|
| 3507 | + $age = (int) ($age / 30.4375) . 'm'; |
|
| 3508 | 3508 | } else { |
| 3509 | 3509 | $age = $age . 'd'; |
| 3510 | 3510 | } |
@@ -3566,7 +3566,7 @@ discard block |
||
| 3566 | 3566 | private function ageBetweenSpousesQuery($type = 'list', $age_dir = 'DESC', $params = []) |
| 3567 | 3567 | { |
| 3568 | 3568 | if (isset($params[0])) { |
| 3569 | - $total = (int)$params[0]; |
|
| 3569 | + $total = (int) $params[0]; |
|
| 3570 | 3570 | } else { |
| 3571 | 3571 | $total = 10; |
| 3572 | 3572 | } |
@@ -3611,10 +3611,10 @@ discard block |
||
| 3611 | 3611 | break; |
| 3612 | 3612 | } |
| 3613 | 3613 | $age = $fam->age; |
| 3614 | - if ((int)($age / 365.25) > 0) { |
|
| 3615 | - $age = (int)($age / 365.25) . 'y'; |
|
| 3616 | - } elseif ((int)($age / 30.4375) > 0) { |
|
| 3617 | - $age = (int)($age / 30.4375) . 'm'; |
|
| 3614 | + if ((int) ($age / 365.25) > 0) { |
|
| 3615 | + $age = (int) ($age / 365.25) . 'y'; |
|
| 3616 | + } elseif ((int) ($age / 30.4375) > 0) { |
|
| 3617 | + $age = (int) ($age / 30.4375) . 'm'; |
|
| 3618 | 3618 | } else { |
| 3619 | 3619 | $age = $age . 'd'; |
| 3620 | 3620 | } |
@@ -3702,16 +3702,16 @@ discard block |
||
| 3702 | 3702 | case 'age': |
| 3703 | 3703 | $age = $row->age; |
| 3704 | 3704 | if ($show_years) { |
| 3705 | - if ((int)($age / 365.25) > 0) { |
|
| 3706 | - $age = (int)($age / 365.25) . 'y'; |
|
| 3707 | - } elseif ((int)($age / 30.4375) > 0) { |
|
| 3708 | - $age = (int)($age / 30.4375) . 'm'; |
|
| 3705 | + if ((int) ($age / 365.25) > 0) { |
|
| 3706 | + $age = (int) ($age / 365.25) . 'y'; |
|
| 3707 | + } elseif ((int) ($age / 30.4375) > 0) { |
|
| 3708 | + $age = (int) ($age / 30.4375) . 'm'; |
|
| 3709 | 3709 | } else { |
| 3710 | 3710 | $age = $age . 'd'; |
| 3711 | 3711 | } |
| 3712 | 3712 | $result = FunctionsDate::getAgeAtEvent($age); |
| 3713 | 3713 | } else { |
| 3714 | - $result = (int)($age / 365.25); |
|
| 3714 | + $result = (int) ($age / 365.25); |
|
| 3715 | 3715 | } |
| 3716 | 3716 | break; |
| 3717 | 3717 | } |
@@ -3797,7 +3797,7 @@ discard block |
||
| 3797 | 3797 | $sizes = explode('x', $size); |
| 3798 | 3798 | $tot = 0; |
| 3799 | 3799 | foreach ($rows as $values) { |
| 3800 | - $tot += (int)$values->total; |
|
| 3800 | + $tot += (int) $values->total; |
|
| 3801 | 3801 | } |
| 3802 | 3802 | // Beware divide by zero |
| 3803 | 3803 | if ($tot === 0) { |
@@ -3806,7 +3806,7 @@ discard block |
||
| 3806 | 3806 | $centuries = ''; |
| 3807 | 3807 | $counts = []; |
| 3808 | 3808 | foreach ($rows as $values) { |
| 3809 | - $counts[] = round(100 * $values->total / $tot, 0); |
|
| 3809 | + $counts[] = round(100 * $values->total / $tot, 0); |
|
| 3810 | 3810 | $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|'; |
| 3811 | 3811 | } |
| 3812 | 3812 | $chd = $this->arrayToExtendedEncoding($counts); |
@@ -3904,7 +3904,7 @@ discard block |
||
| 3904 | 3904 | $centuries = ''; |
| 3905 | 3905 | $counts = []; |
| 3906 | 3906 | foreach ($rows as $values) { |
| 3907 | - $counts[] = round(100 * $values->total / $tot, 0); |
|
| 3907 | + $counts[] = round(100 * $values->total / $tot, 0); |
|
| 3908 | 3908 | $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|'; |
| 3909 | 3909 | } |
| 3910 | 3910 | $chd = $this->arrayToExtendedEncoding($counts); |
@@ -4173,7 +4173,7 @@ discard block |
||
| 4173 | 4173 | if ($sizes[0] < 1000) { |
| 4174 | 4174 | $sizes[0] += 50; |
| 4175 | 4175 | } |
| 4176 | - $chxl .= $this->centuryName($century) . '|'; |
|
| 4176 | + $chxl .= $this->centuryName($century) . '|'; |
|
| 4177 | 4177 | $average = 0; |
| 4178 | 4178 | if (isset($values['F'])) { |
| 4179 | 4179 | if ($max <= 50) { |
@@ -4230,7 +4230,7 @@ discard block |
||
| 4230 | 4230 | while ($offset = strpos(I18N::translate('Average age in century of marriage'), ' ', $offset + 1)) { |
| 4231 | 4231 | $counter[] = $offset; |
| 4232 | 4232 | } |
| 4233 | - $half = (int)(count($counter) / 2); |
|
| 4233 | + $half = (int) (count($counter) / 2); |
|
| 4234 | 4234 | $chtt = substr_replace(I18N::translate('Average age in century of marriage'), '|', $counter[$half], 1); |
| 4235 | 4235 | } |
| 4236 | 4236 | |
@@ -4762,7 +4762,7 @@ discard block |
||
| 4762 | 4762 | private function topTenFamilyQuery($type = 'list', $params = []) |
| 4763 | 4763 | { |
| 4764 | 4764 | if (isset($params[0])) { |
| 4765 | - $total = (int)$params[0]; |
|
| 4765 | + $total = (int) $params[0]; |
|
| 4766 | 4766 | } else { |
| 4767 | 4767 | $total = 10; |
| 4768 | 4768 | } |
@@ -4829,7 +4829,7 @@ discard block |
||
| 4829 | 4829 | private function ageBetweenSiblingsQuery($type = 'list', $params = []) |
| 4830 | 4830 | { |
| 4831 | 4831 | if (isset($params[0])) { |
| 4832 | - $total = (int)$params[0]; |
|
| 4832 | + $total = (int) $params[0]; |
|
| 4833 | 4833 | } else { |
| 4834 | 4834 | $total = 10; |
| 4835 | 4835 | } |
@@ -4885,10 +4885,10 @@ discard block |
||
| 4885 | 4885 | return $return; |
| 4886 | 4886 | } |
| 4887 | 4887 | $age = $fam->age; |
| 4888 | - if ((int)($age / 365.25) > 0) { |
|
| 4889 | - $age = (int)($age / 365.25) . 'y'; |
|
| 4890 | - } elseif ((int)($age / 30.4375) > 0) { |
|
| 4891 | - $age = (int)($age / 30.4375) . 'm'; |
|
| 4888 | + if ((int) ($age / 365.25) > 0) { |
|
| 4889 | + $age = (int) ($age / 365.25) . 'y'; |
|
| 4890 | + } elseif ((int) ($age / 30.4375) > 0) { |
|
| 4891 | + $age = (int) ($age / 30.4375) . 'm'; |
|
| 4892 | 4892 | } else { |
| 4893 | 4893 | $age = $age . 'd'; |
| 4894 | 4894 | } |
@@ -4899,7 +4899,7 @@ discard block |
||
| 4899 | 4899 | if ($type == 'list') { |
| 4900 | 4900 | if ($one && !in_array($fam->family, $dist)) { |
| 4901 | 4901 | if ($child1->canShow() && $child2->canShow()) { |
| 4902 | - $return = '<li>'; |
|
| 4902 | + $return = '<li>'; |
|
| 4903 | 4903 | $return .= '<a href="' . e($child2->url()) . '">' . $child2->getFullName() . '</a> '; |
| 4904 | 4904 | $return .= I18N::translate('and') . ' '; |
| 4905 | 4905 | $return .= '<a href="' . e($child1->url()) . '">' . $child1->getFullName() . '</a>'; |
@@ -4910,7 +4910,7 @@ discard block |
||
| 4910 | 4910 | $dist[] = $fam->family; |
| 4911 | 4911 | } |
| 4912 | 4912 | } elseif (!$one && $child1->canShow() && $child2->canShow()) { |
| 4913 | - $return = '<li>'; |
|
| 4913 | + $return = '<li>'; |
|
| 4914 | 4914 | $return .= '<a href="' . e($child2->url()) . '">' . $child2->getFullName() . '</a> '; |
| 4915 | 4915 | $return .= I18N::translate('and') . ' '; |
| 4916 | 4916 | $return .= '<a href="' . e($child1->url()) . '">' . $child1->getFullName() . '</a>'; |
@@ -5185,7 +5185,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 5611 | 5611 | private function topTenGrandFamilyQuery($type = 'list', $params = []) |
| 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 |
||
| 5709 | 5709 | */ |
| 5710 | 5710 | private function commonSurnamesQuery($type = 'list', $show_tot = false, $params = []) |
| 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); |
@@ -5886,7 +5886,7 @@ discard block |
||
| 5886 | 5886 | $max_name = 0; |
| 5887 | 5887 | $top_name = ''; |
| 5888 | 5888 | foreach ($surns as $spfxsurn => $count) { |
| 5889 | - $per = $count; |
|
| 5889 | + $per = $count; |
|
| 5890 | 5890 | $count_per += $per; |
| 5891 | 5891 | // select most common surname from all variants |
| 5892 | 5892 | if ($per > $max_name) { |
@@ -5910,11 +5910,11 @@ discard block |
||
| 5910 | 5910 | ], $top_name); |
| 5911 | 5911 | } |
| 5912 | 5912 | $per = round(100 * $count_per / $tot_indi, 0); |
| 5913 | - $chd .= $this->arrayToExtendedEncoding([$per]); |
|
| 5913 | + $chd .= $this->arrayToExtendedEncoding([$per]); |
|
| 5914 | 5914 | $chl[] = $top_name . ' - ' . I18N::number($count_per); |
| 5915 | 5915 | } |
| 5916 | 5916 | $per = round(100 * ($tot_indi - $tot) / $tot_indi, 0); |
| 5917 | - $chd .= $this->arrayToExtendedEncoding([$per]); |
|
| 5917 | + $chd .= $this->arrayToExtendedEncoding([$per]); |
|
| 5918 | 5918 | $chl[] = I18N::translate('Other') . ' - ' . I18N::number($tot_indi - $tot); |
| 5919 | 5919 | |
| 5920 | 5920 | $chart_title = implode(I18N::$list_separator, $chl); |
@@ -5936,12 +5936,12 @@ discard block |
||
| 5936 | 5936 | private function commonGivenQuery($sex = 'B', $type = 'list', $show_tot = false, $params = []) |
| 5937 | 5937 | { |
| 5938 | 5938 | if (isset($params[0]) && $params[0] != '' && $params[0] >= 0) { |
| 5939 | - $threshold = (int)$params[0]; |
|
| 5939 | + $threshold = (int) $params[0]; |
|
| 5940 | 5940 | } else { |
| 5941 | 5941 | $threshold = 1; |
| 5942 | 5942 | } |
| 5943 | 5943 | if (isset($params[1]) && $params[1] != '' && $params[1] >= 0) { |
| 5944 | - $maxtoshow = (int)$params[1]; |
|
| 5944 | + $maxtoshow = (int) $params[1]; |
|
| 5945 | 5945 | } else { |
| 5946 | 5946 | $maxtoshow = 10; |
| 5947 | 5947 | } |
@@ -6414,11 +6414,11 @@ discard block |
||
| 6414 | 6414 | } else { |
| 6415 | 6415 | $per = round(100 * $count / $tot_indi, 0); |
| 6416 | 6416 | } |
| 6417 | - $chd .= $this->arrayToExtendedEncoding([$per]); |
|
| 6417 | + $chd .= $this->arrayToExtendedEncoding([$per]); |
|
| 6418 | 6418 | $chl[] = $givn . ' - ' . I18N::number($count); |
| 6419 | 6419 | } |
| 6420 | 6420 | $per = round(100 * ($tot_indi - $tot) / $tot_indi, 0); |
| 6421 | - $chd .= $this->arrayToExtendedEncoding([$per]); |
|
| 6421 | + $chd .= $this->arrayToExtendedEncoding([$per]); |
|
| 6422 | 6422 | $chl[] = I18N::translate('Other') . ' - ' . I18N::number($tot_indi - $tot); |
| 6423 | 6423 | |
| 6424 | 6424 | $chart_title = implode(I18N::$list_separator, $chl); |
@@ -6645,7 +6645,7 @@ discard block |
||
| 6645 | 6645 | $datestamp = I18N::dateFormat(); |
| 6646 | 6646 | } |
| 6647 | 6647 | |
| 6648 | - return FunctionsDate::timestampToGedcomDate((int)$user->getPreference('reg_timestamp'))->display(false, $datestamp); |
|
| 6648 | + return FunctionsDate::timestampToGedcomDate((int) $user->getPreference('reg_timestamp'))->display(false, $datestamp); |
|
| 6649 | 6649 | case 'regtime': |
| 6650 | 6650 | if (is_array($params) && isset($params[0]) && $params[0] != '') { |
| 6651 | 6651 | $datestamp = $params[0]; |
@@ -6653,7 +6653,7 @@ discard block |
||
| 6653 | 6653 | $datestamp = str_replace('%', '', I18N::timeFormat()); |
| 6654 | 6654 | } |
| 6655 | 6655 | |
| 6656 | - return date($datestamp, (int)$user->getPreference('reg_timestamp')); |
|
| 6656 | + return date($datestamp, (int) $user->getPreference('reg_timestamp')); |
|
| 6657 | 6657 | case 'loggedin': |
| 6658 | 6658 | if (is_array($params) && isset($params[0]) && $params[0] != '') { |
| 6659 | 6659 | $yes = $params[0]; |
@@ -6993,9 +6993,9 @@ discard block |
||
| 6993 | 6993 | if ($value < 0) { |
| 6994 | 6994 | $value = 0; |
| 6995 | 6995 | } |
| 6996 | - $first = (int)($value / 64); |
|
| 6996 | + $first = (int) ($value / 64); |
|
| 6997 | 6997 | $second = $value % 64; |
| 6998 | - $encoding .= $xencoding[(int)$first] . $xencoding[(int)$second]; |
|
| 6998 | + $encoding .= $xencoding[(int) $first] . $xencoding[(int) $second]; |
|
| 6999 | 6999 | } |
| 7000 | 7000 | |
| 7001 | 7001 | return $encoding; |
@@ -7140,7 +7140,7 @@ discard block |
||
| 7140 | 7140 | */ |
| 7141 | 7141 | public function totalUserMessages() |
| 7142 | 7142 | { |
| 7143 | - $total = (int)Database::prepare("SELECT COUNT(*) FROM `##message` WHERE user_id = ?") |
|
| 7143 | + $total = (int) Database::prepare("SELECT COUNT(*) FROM `##message` WHERE user_id = ?") |
|
| 7144 | 7144 | ->execute([Auth::id()]) |
| 7145 | 7145 | ->fetchOne(); |
| 7146 | 7146 | |
@@ -7155,7 +7155,7 @@ discard block |
||
| 7155 | 7155 | public function totalUserJournal() |
| 7156 | 7156 | { |
| 7157 | 7157 | try { |
| 7158 | - $number = (int)Database::prepare("SELECT COUNT(*) FROM `##news` WHERE user_id = ?") |
|
| 7158 | + $number = (int) Database::prepare("SELECT COUNT(*) FROM `##news` WHERE user_id = ?") |
|
| 7159 | 7159 | ->execute([Auth::id()]) |
| 7160 | 7160 | ->fetchOne(); |
| 7161 | 7161 | } catch (PDOException $ex) { |
@@ -7176,7 +7176,7 @@ discard block |
||
| 7176 | 7176 | public function totalGedcomNews() |
| 7177 | 7177 | { |
| 7178 | 7178 | try { |
| 7179 | - $number = (int)Database::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?") |
|
| 7179 | + $number = (int) Database::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?") |
|
| 7180 | 7180 | ->execute([$this->tree->getTreeId()]) |
| 7181 | 7181 | ->fetchOne(); |
| 7182 | 7182 | } catch (PDOException $ex) { |
@@ -106,7 +106,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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,10 +401,10 @@ discard block |
||
| 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 | } else { |
| 407 | - return (int)$a['pl_level'] - (int)$b['pl_level']; |
|
| 407 | + return (int) $a['pl_level'] - (int) $b['pl_level']; |
|
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | ); |
@@ -521,7 +521,7 @@ discard block |
||
| 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)" . |
@@ -34,6 +34,6 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function generate(Individual $individual, Individual $head) |
| 36 | 36 | { |
| 37 | - return (string)Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); |
|
| 37 | + return (string) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | { |
| 215 | 215 | if ($analytics_id) { |
| 216 | 216 | // Add extra dimensions (i.e. filtering categories) |
| 217 | - $dimensions = (object)[ |
|
| 217 | + $dimensions = (object) [ |
|
| 218 | 218 | 'dimension1' => $this->tree ? $this->tree->getName() : '-', |
| 219 | 219 | 'dimension2' => $this->tree ? Auth::accessLevel($this->tree) : '-', |
| 220 | 220 | ]; |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | if ($project_id && $security_id) { |
| 277 | 277 | return |
| 278 | 278 | '<script>' . |
| 279 | - 'var sc_project=' . (int)$project_id . ',sc_invisible=1,sc_security="' . $security_id . |
|
| 279 | + 'var sc_project=' . (int) $project_id . ',sc_invisible=1,sc_security="' . $security_id . |
|
| 280 | 280 | '",scJsHost = (("https:"===document.location.protocol)?"https://secure.":"http://www.");' . |
| 281 | 281 | 'document.write("<sc"+"ript src=\'"+scJsHost+"statcounter.com/counter/counter.js\'></"+"script>");' . |
| 282 | 282 | '</script>'; |
@@ -1803,7 +1803,7 @@ discard block |
||
| 1803 | 1803 | public function menuSearchPhonetic() |
| 1804 | 1804 | { |
| 1805 | 1805 | /* I18N: search using “sounds like”, rather than exact spelling */ |
| 1806 | - return new Menu(I18N::translate('Phonetic search'), route('search-phonetic', ['ged' => $this->tree->getName(), 'action' => 'soundex',]), 'menu-search-soundex', ['rel' => 'nofollow']); |
|
| 1806 | + return new Menu(I18N::translate('Phonetic search'), route('search-phonetic', ['ged' => $this->tree->getName(), 'action' => 'soundex', ]), 'menu-search-soundex', ['rel' => 'nofollow']); |
|
| 1807 | 1807 | } |
| 1808 | 1808 | |
| 1809 | 1809 | /** |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | public function reorderMediaAction(Request $request, Tree $tree): Response |
| 63 | 63 | { |
| 64 | 64 | $xref = $request->get('xref'); |
| 65 | - $order = (array)$request->get('order', []); |
|
| 65 | + $order = (array) $request->get('order', []); |
|
| 66 | 66 | $individual = Individual::getInstance($xref, $tree); |
| 67 | 67 | |
| 68 | 68 | $this->checkIndividualAccess($individual, true); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | public function reorderNamesAction(Request $request, Tree $tree): Response |
| 124 | 124 | { |
| 125 | 125 | $xref = $request->get('xref'); |
| 126 | - $order = (array)$request->get('order', []); |
|
| 126 | + $order = (array) $request->get('order', []); |
|
| 127 | 127 | $individual = Individual::getInstance($xref, $tree); |
| 128 | 128 | |
| 129 | 129 | $this->checkIndividualAccess($individual, true); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | public function reorderSpousesAction(Request $request, Tree $tree): Response |
| 185 | 185 | { |
| 186 | 186 | $xref = $request->get('xref'); |
| 187 | - $order = (array)$request->get('order', []); |
|
| 187 | + $order = (array) $request->get('order', []); |
|
| 188 | 188 | $individual = Individual::getInstance($xref, $tree); |
| 189 | 189 | |
| 190 | 190 | $this->checkIndividualAccess($individual, true); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | $gedcom .= $this->addNewFact($tree, $match); |
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 294 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 295 | 295 | $gedcom = $this->handleUpdates($gedcom); |
| 296 | 296 | } else { |
| 297 | 297 | $gedcom = $this->updateRest($gedcom); |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | $gedcom .= $this->addNewFact($tree, $match); |
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 386 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 387 | 387 | $gedcom = $this->handleUpdates($gedcom); |
| 388 | 388 | } else { |
| 389 | 389 | $gedcom = $this->updateRest($gedcom); |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | */ |
| 417 | 417 | public function addSpouse(Request $request, Tree $tree): Response |
| 418 | 418 | { |
| 419 | - $xref = $request->get('xref', ''); |
|
| 419 | + $xref = $request->get('xref', ''); |
|
| 420 | 420 | |
| 421 | 421 | $individual = Individual::getInstance($xref, $tree); |
| 422 | 422 | |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | $indi_gedcom .= $this->addNewFact($tree, $match); |
| 475 | 475 | } |
| 476 | 476 | } |
| 477 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 477 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 478 | 478 | $indi_gedcom = $this->handleUpdates($indi_gedcom); |
| 479 | 479 | } else { |
| 480 | 480 | $indi_gedcom = $this->updateRest($indi_gedcom); |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $fam_gedcom .= $this->addNewFact($tree, $match); |
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | - if ((bool)$request->get('SOUR_FAM')) { |
|
| 489 | + if ((bool) $request->get('SOUR_FAM')) { |
|
| 490 | 490 | $fam_gedcom = $this->handleUpdates($fam_gedcom); |
| 491 | 491 | } else { |
| 492 | 492 | $fam_gedcom = $this->updateRest($fam_gedcom); |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | $gedrec .= $this->addNewFact($tree, $match); |
| 561 | 561 | } |
| 562 | 562 | } |
| 563 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 563 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 564 | 564 | $gedrec = $this->handleUpdates($gedrec); |
| 565 | 565 | } else { |
| 566 | 566 | $gedrec = $this->updateRest($gedrec); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $user_list[$tmp_user->getUserName()] = $tmp_user->getUserName(); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - $action = $request->get('action'); |
|
| 168 | + $action = $request->get('action'); |
|
| 169 | 169 | |
| 170 | 170 | // @TODO This ought to be a POST action |
| 171 | 171 | if ($action === 'delete') { |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public function changesLogData(Request $request): Response |
| 233 | 233 | { |
| 234 | - list($select, , $where, $args1) = $this->changesQuery($request); |
|
| 234 | + list($select,, $where, $args1) = $this->changesQuery($request); |
|
| 235 | 235 | list($order_by, $limit, $args2) = $this->dataTablesPagination($request); |
| 236 | 236 | |
| 237 | 237 | $rows = Database::prepare( |
@@ -239,8 +239,8 @@ discard block |
||
| 239 | 239 | )->execute(array_merge($args1, $args2))->fetchAll(); |
| 240 | 240 | |
| 241 | 241 | // Total filtered/unfiltered rows |
| 242 | - $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
| 243 | - $recordsTotal = (int)Database::prepare("SELECT COUNT(*) FROM `##change`")->fetchOne(); |
|
| 242 | + $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
| 243 | + $recordsTotal = (int) Database::prepare("SELECT COUNT(*) FROM `##change`")->fetchOne(); |
|
| 244 | 244 | |
| 245 | 245 | $data = []; |
| 246 | 246 | $algorithm = new MyersDiff(); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | |
| 292 | 292 | // See http://www.datatables.net/usage/server-side |
| 293 | 293 | return new JsonResponse([ |
| 294 | - 'draw' => (int)$request->get('draw'), |
|
| 294 | + 'draw' => (int) $request->get('draw'), |
|
| 295 | 295 | 'recordsTotal' => $recordsTotal, |
| 296 | 296 | 'recordsFiltered' => $recordsFiltered, |
| 297 | 297 | 'data' => $data, |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | */ |
| 308 | 308 | public function changesLogDownload(Request $request): Response |
| 309 | 309 | { |
| 310 | - list($select, , $where, $args) = $this->changesQuery($request); |
|
| 310 | + list($select,, $where, $args) = $this->changesQuery($request); |
|
| 311 | 311 | |
| 312 | 312 | $rows = Database::prepare($select . $where)->execute($args)->fetchAll(); |
| 313 | 313 | |
@@ -449,8 +449,8 @@ discard block |
||
| 449 | 449 | 'RESN', |
| 450 | 450 | ]; |
| 451 | 451 | |
| 452 | - $start = (int)$request->get('start', 0); |
|
| 453 | - $length = (int)$request->get('length', 20); |
|
| 452 | + $start = (int) $request->get('start', 0); |
|
| 453 | + $length = (int) $request->get('length', 20); |
|
| 454 | 454 | $search = $request->get('search', []); |
| 455 | 455 | $search = $search['value'] ?? ''; |
| 456 | 456 | |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | $args = []; |
| 471 | 471 | |
| 472 | 472 | if ($search !== '') { |
| 473 | - $where .= " AND (multimedia_file_refn LIKE CONCAT('%', :search1, '%') OR multimedia_file_refn LIKE CONCAT('%', :search2, '%'))"; |
|
| 473 | + $where .= " AND (multimedia_file_refn LIKE CONCAT('%', :search1, '%') OR multimedia_file_refn LIKE CONCAT('%', :search2, '%'))"; |
|
| 474 | 474 | $args['search1'] = $search; |
| 475 | 475 | $args['search2'] = $search; |
| 476 | 476 | } |
@@ -489,8 +489,8 @@ discard block |
||
| 489 | 489 | )->fetchAll(); |
| 490 | 490 | |
| 491 | 491 | // Total filtered/unfiltered rows |
| 492 | - $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
| 493 | - $recordsTotal = (int)Database::prepare($select2)->fetchOne(); |
|
| 492 | + $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
| 493 | + $recordsTotal = (int) Database::prepare($select2)->fetchOne(); |
|
| 494 | 494 | |
| 495 | 495 | // Turn each row from the query into a row for the table |
| 496 | 496 | $data = array_map(function (stdClass $datum) use ($ignore_facts) { |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | }, $data); |
| 533 | 533 | |
| 534 | 534 | return new JsonResponse([ |
| 535 | - 'draw' => (int)$request->get('draw'), |
|
| 535 | + 'draw' => (int) $request->get('draw'), |
|
| 536 | 536 | 'recordsTotal' => $recordsTotal, |
| 537 | 537 | 'recordsFiltered' => $recordsFiltered, |
| 538 | 538 | 'data' => $data, |
@@ -621,8 +621,8 @@ discard block |
||
| 621 | 621 | */ |
| 622 | 622 | public function webtrees1ThumbnailsData(Request $request): JsonResponse |
| 623 | 623 | { |
| 624 | - $start = (int)$request->get('start', 0); |
|
| 625 | - $length = (int)$request->get('length', 20); |
|
| 624 | + $start = (int) $request->get('start', 0); |
|
| 625 | + $length = (int) $request->get('length', 20); |
|
| 626 | 626 | $search = $request->get('search', []); |
| 627 | 627 | $search = $search['value'] ?? ''; |
| 628 | 628 | |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | $data = array_map(function (string $thumbnail) { |
| 654 | 654 | $original = $this->findOriginalFileFromThumbnail($thumbnail); |
| 655 | 655 | |
| 656 | - $original_url = route('unused-media-thumbnail', [ |
|
| 656 | + $original_url = route('unused-media-thumbnail', [ |
|
| 657 | 657 | 'folder' => dirname($original), |
| 658 | 658 | 'file' => basename($original), |
| 659 | 659 | 'w' => 100, |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | }, $thumbnails); |
| 696 | 696 | |
| 697 | 697 | return new JsonResponse([ |
| 698 | - 'draw' => (int)$request->get('draw'), |
|
| 698 | + 'draw' => (int) $request->get('draw'), |
|
| 699 | 699 | 'recordsTotal' => $recordsTotal, |
| 700 | 700 | 'recordsFiltered' => $recordsFiltered, |
| 701 | 701 | 'data' => $data, |
@@ -1021,7 +1021,7 @@ discard block |
||
| 1021 | 1021 | */ |
| 1022 | 1022 | public function treePrivacyUpdate(Request $request, Tree $tree): RedirectResponse |
| 1023 | 1023 | { |
| 1024 | - foreach ((array)$request->get('delete') as $default_resn_id) { |
|
| 1024 | + foreach ((array) $request->get('delete') as $default_resn_id) { |
|
| 1025 | 1025 | Database::prepare( |
| 1026 | 1026 | "DELETE FROM `##default_resn` WHERE default_resn_id = :default_resn_id" |
| 1027 | 1027 | )->execute([ |
@@ -1029,13 +1029,13 @@ discard block |
||
| 1029 | 1029 | ]); |
| 1030 | 1030 | } |
| 1031 | 1031 | |
| 1032 | - $xrefs = (array)$request->get('xref'); |
|
| 1033 | - $tag_types = (array)$request->get('tag_type'); |
|
| 1034 | - $resns = (array)$request->get('resn'); |
|
| 1032 | + $xrefs = (array) $request->get('xref'); |
|
| 1033 | + $tag_types = (array) $request->get('tag_type'); |
|
| 1034 | + $resns = (array) $request->get('resn'); |
|
| 1035 | 1035 | |
| 1036 | 1036 | foreach ($xrefs as $n => $xref) { |
| 1037 | - $tag_type = (string)$tag_types[$n]; |
|
| 1038 | - $resn = (string)$resns[$n]; |
|
| 1037 | + $tag_type = (string) $tag_types[$n]; |
|
| 1038 | + $resn = (string) $resns[$n]; |
|
| 1039 | 1039 | |
| 1040 | 1040 | if ($tag_type !== '' || $xref !== '') { |
| 1041 | 1041 | // Delete any existing data |
@@ -1081,10 +1081,10 @@ discard block |
||
| 1081 | 1081 | FlashMessages::addMessage(I18N::translate('The preferences for the family tree “%s” have been updated.', e($tree->getTitle()), 'success')); |
| 1082 | 1082 | |
| 1083 | 1083 | // Coming soon... |
| 1084 | - if ((bool)$request->get('all_trees')) { |
|
| 1084 | + if ((bool) $request->get('all_trees')) { |
|
| 1085 | 1085 | FlashMessages::addMessage(I18N::translate('The preferences for all family trees have been updated.', e($tree->getTitle())), 'success'); |
| 1086 | 1086 | } |
| 1087 | - if ((bool)$request->get('new_trees')) { |
|
| 1087 | + if ((bool) $request->get('new_trees')) { |
|
| 1088 | 1088 | FlashMessages::addMessage(I18N::translate('The preferences for new family trees have been updated.', e($tree->getTitle())), 'success'); |
| 1089 | 1089 | } |
| 1090 | 1090 | |
@@ -1107,7 +1107,7 @@ discard block |
||
| 1107 | 1107 | foreach ($modules as $module) { |
| 1108 | 1108 | foreach (Tree::getAll() as $tree) { |
| 1109 | 1109 | $key = 'access-' . $module->getName() . '-' . $tree->getTreeId(); |
| 1110 | - $access_level = (int)$request->get($key, $module->defaultAccessLevel()); |
|
| 1110 | + $access_level = (int) $request->get($key, $module->defaultAccessLevel()); |
|
| 1111 | 1111 | |
| 1112 | 1112 | Database::prepare("REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (:module_name, :tree_id, :component, :access_level)")->execute([ |
| 1113 | 1113 | 'module_name' => $module->getName(), |
@@ -1134,7 +1134,7 @@ discard block |
||
| 1134 | 1134 | $module_status = Database::prepare("SELECT module_name, status FROM `##module`")->fetchAssoc(); |
| 1135 | 1135 | |
| 1136 | 1136 | foreach ($modules as $module) { |
| 1137 | - $new_status = (bool)$request->get('status-' . $module->getName()) ? 'enabled' : 'disabled'; |
|
| 1137 | + $new_status = (bool) $request->get('status-' . $module->getName()) ? 'enabled' : 'disabled'; |
|
| 1138 | 1138 | $old_status = $module_status[$module->getName()]; |
| 1139 | 1139 | |
| 1140 | 1140 | if ($new_status !== $old_status) { |
@@ -1197,36 +1197,36 @@ discard block |
||
| 1197 | 1197 | $where = ' WHERE 1'; |
| 1198 | 1198 | $args = []; |
| 1199 | 1199 | if ($search !== '') { |
| 1200 | - $where .= " AND (old_gedcom LIKE CONCAT('%', :search_1, '%') OR new_gedcom LIKE CONCAT('%', :search_2, '%'))"; |
|
| 1200 | + $where .= " AND (old_gedcom LIKE CONCAT('%', :search_1, '%') OR new_gedcom LIKE CONCAT('%', :search_2, '%'))"; |
|
| 1201 | 1201 | $args['search_1'] = $search; |
| 1202 | 1202 | $args['search_2'] = $search; |
| 1203 | 1203 | } |
| 1204 | 1204 | if ($from !== '') { |
| 1205 | - $where .= " AND change_time >= :from"; |
|
| 1205 | + $where .= " AND change_time >= :from"; |
|
| 1206 | 1206 | $args['from'] = $from; |
| 1207 | 1207 | } |
| 1208 | 1208 | if ($to !== '') { |
| 1209 | - $where .= ' AND change_time < TIMESTAMPADD(DAY, 1 , :to)'; // before end of the day |
|
| 1209 | + $where .= ' AND change_time < TIMESTAMPADD(DAY, 1 , :to)'; // before end of the day |
|
| 1210 | 1210 | $args['to'] = $to; |
| 1211 | 1211 | } |
| 1212 | 1212 | if ($type !== '') { |
| 1213 | - $where .= ' AND status = :status'; |
|
| 1213 | + $where .= ' AND status = :status'; |
|
| 1214 | 1214 | $args['status'] = $type; |
| 1215 | 1215 | } |
| 1216 | 1216 | if ($oldged !== '') { |
| 1217 | - $where .= " AND old_gedcom LIKE CONCAT('%', :old_ged, '%')"; |
|
| 1217 | + $where .= " AND old_gedcom LIKE CONCAT('%', :old_ged, '%')"; |
|
| 1218 | 1218 | $args['old_ged'] = $oldged; |
| 1219 | 1219 | } |
| 1220 | 1220 | if ($newged !== '') { |
| 1221 | - $where .= " AND new_gedcom LIKE CONCAT('%', :new_ged, '%')"; |
|
| 1221 | + $where .= " AND new_gedcom LIKE CONCAT('%', :new_ged, '%')"; |
|
| 1222 | 1222 | $args['new_ged'] = $newged; |
| 1223 | 1223 | } |
| 1224 | 1224 | if ($xref !== '') { |
| 1225 | - $where .= " AND xref = :xref"; |
|
| 1225 | + $where .= " AND xref = :xref"; |
|
| 1226 | 1226 | $args['xref'] = $xref; |
| 1227 | 1227 | } |
| 1228 | 1228 | if ($username !== '') { |
| 1229 | - $where .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
| 1229 | + $where .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
| 1230 | 1230 | $args['user'] = $username; |
| 1231 | 1231 | } |
| 1232 | 1232 | if ($ged !== '') { |
@@ -1277,8 +1277,8 @@ discard block |
||
| 1277 | 1277 | */ |
| 1278 | 1278 | private function dataTablesPagination(Request $request): array |
| 1279 | 1279 | { |
| 1280 | - $start = (int)$request->get('start', '0'); |
|
| 1281 | - $length = (int)$request->get('length', '0'); |
|
| 1280 | + $start = (int) $request->get('start', '0'); |
|
| 1281 | + $length = (int) $request->get('length', '0'); |
|
| 1282 | 1282 | $order = $request->get('order', []); |
| 1283 | 1283 | $args = []; |
| 1284 | 1284 | |
@@ -1429,7 +1429,7 @@ discard block |
||
| 1429 | 1429 | } |
| 1430 | 1430 | |
| 1431 | 1431 | // The maximum difference is 255 (black versus white). |
| 1432 | - return 100 - (int)($max_difference * 100 / 255); |
|
| 1432 | + return 100 - (int) ($max_difference * 100 / 255); |
|
| 1433 | 1433 | } |
| 1434 | 1434 | |
| 1435 | 1435 | /** |
@@ -1460,7 +1460,7 @@ discard block |
||
| 1460 | 1460 | $pixels[$x] = []; |
| 1461 | 1461 | for ($y = 0; $y < $size; ++$y) { |
| 1462 | 1462 | $pixel = $image->pickColor($x, $y); |
| 1463 | - $pixels[$x][$y] = (int)(($pixel[0] + $pixel[1] + $pixel[2]) / 3); |
|
| 1463 | + $pixels[$x][$y] = (int) (($pixel[0] + $pixel[1] + $pixel[2]) / 3); |
|
| 1464 | 1464 | } |
| 1465 | 1465 | } |
| 1466 | 1466 | |