@@ -407,9 +407,9 @@ discard block |
||
407 | 407 | public function exportClient(Request $request, Tree $tree): Response |
408 | 408 | { |
409 | 409 | // Validate user parameters |
410 | - $convert = (bool)$request->get('convert'); |
|
411 | - $zip = (bool)$request->get('zip'); |
|
412 | - $media = (bool)$request->get('media'); |
|
410 | + $convert = (bool) $request->get('convert'); |
|
411 | + $zip = (bool) $request->get('zip'); |
|
412 | + $media = (bool) $request->get('media'); |
|
413 | 413 | $media_path = $request->get('media-path'); |
414 | 414 | $privatize_export = $request->get('privatize_export'); |
415 | 415 | |
@@ -539,8 +539,8 @@ discard block |
||
539 | 539 | public function importAction(Request $request, Tree $tree): RedirectResponse |
540 | 540 | { |
541 | 541 | $source = $request->get('source'); |
542 | - $keep_media = (bool)$request->get('keep_media'); |
|
543 | - $WORD_WRAPPED_NOTES = (bool)$request->get('WORD_WRAPPED_NOTES'); |
|
542 | + $keep_media = (bool) $request->get('keep_media'); |
|
543 | + $WORD_WRAPPED_NOTES = (bool) $request->get('WORD_WRAPPED_NOTES'); |
|
544 | 544 | $GEDCOM_MEDIA_PATH = $request->get('GEDCOM_MEDIA_PATH'); |
545 | 545 | |
546 | 546 | // Save these choices as defaults |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | */ |
604 | 604 | public function index(Tree $tree): Response |
605 | 605 | { |
606 | - $multiple_tree_threshold = (int)Site::getPreference('MULTIPLE_TREE_THRESHOLD', self::MULTIPLE_TREE_THRESHOLD); |
|
606 | + $multiple_tree_threshold = (int) Site::getPreference('MULTIPLE_TREE_THRESHOLD', self::MULTIPLE_TREE_THRESHOLD); |
|
607 | 607 | $gedcom_files = $this->gedcomFiles(WT_DATA_DIR); |
608 | 608 | |
609 | 609 | $all_trees = Tree::getAll(); |
@@ -1034,16 +1034,16 @@ discard block |
||
1034 | 1034 | public function preferencesUpdate(Request $request, Tree $tree): RedirectResponse |
1035 | 1035 | { |
1036 | 1036 | // Coming soon |
1037 | - if ((bool)$request->get('all_trees')) { |
|
1037 | + if ((bool) $request->get('all_trees')) { |
|
1038 | 1038 | FlashMessages::addMessage(I18N::translate('The preferences for all family trees have been updated.'), 'success'); |
1039 | 1039 | } |
1040 | - if ((bool)$request->get('new_trees')) { |
|
1040 | + if ((bool) $request->get('new_trees')) { |
|
1041 | 1041 | FlashMessages::addMessage(I18N::translate('The preferences for new family trees have been updated.'), 'success'); |
1042 | 1042 | } |
1043 | 1043 | |
1044 | 1044 | $tree->setPreference('ADVANCED_NAME_FACTS', implode(',', $request->get('ADVANCED_NAME_FACTS', []))); |
1045 | 1045 | $tree->setPreference('ADVANCED_PLAC_FACTS', implode(',', $request->get('ADVANCED_PLAC_FACTS', []))); |
1046 | - $tree->setPreference('ALLOW_THEME_DROPDOWN', (string)(bool)$request->get('ALLOW_THEME_DROPDOWN')); |
|
1046 | + $tree->setPreference('ALLOW_THEME_DROPDOWN', (string) (bool) $request->get('ALLOW_THEME_DROPDOWN')); |
|
1047 | 1047 | // For backwards compatibility with webtrees 1.x we store the two calendar formats in one variable |
1048 | 1048 | // e.g. "gregorian_and_jewish" |
1049 | 1049 | $tree->setPreference('CALENDAR_FORMAT', implode('_and_', array_unique([ |
@@ -1052,57 +1052,57 @@ discard block |
||
1052 | 1052 | ]))); |
1053 | 1053 | $tree->setPreference('CHART_BOX_TAGS', implode(',', $request->get('CHART_BOX_TAGS', []))); |
1054 | 1054 | $tree->setPreference('CONTACT_USER_ID', $request->get('CONTACT_USER_ID')); |
1055 | - $tree->setPreference('DEFAULT_PEDIGREE_GENERATIONS', (string)(int)$request->get('DEFAULT_PEDIGREE_GENERATIONS')); |
|
1056 | - $tree->setPreference('EXPAND_NOTES', (string)(bool)$request->get('EXPAND_NOTES')); |
|
1057 | - $tree->setPreference('EXPAND_SOURCES', (string)(bool)$request->get('EXPAND_SOURCES')); |
|
1055 | + $tree->setPreference('DEFAULT_PEDIGREE_GENERATIONS', (string) (int) $request->get('DEFAULT_PEDIGREE_GENERATIONS')); |
|
1056 | + $tree->setPreference('EXPAND_NOTES', (string) (bool) $request->get('EXPAND_NOTES')); |
|
1057 | + $tree->setPreference('EXPAND_SOURCES', (string) (bool) $request->get('EXPAND_SOURCES')); |
|
1058 | 1058 | $tree->setPreference('FAM_FACTS_ADD', implode(',', $request->get('FAM_FACTS_ADD', []))); |
1059 | 1059 | $tree->setPreference('FAM_FACTS_QUICK', implode(',', $request->get('FAM_FACTS_QUICK', []))); |
1060 | 1060 | $tree->setPreference('FAM_FACTS_UNIQUE', implode(',', $request->get('FAM_FACTS_UNIQUE', []))); |
1061 | - $tree->setPreference('FULL_SOURCES', (string)(bool)$request->get('FULL_SOURCES')); |
|
1061 | + $tree->setPreference('FULL_SOURCES', (string) (bool) $request->get('FULL_SOURCES')); |
|
1062 | 1062 | $tree->setPreference('FORMAT_TEXT', $request->get('FORMAT_TEXT')); |
1063 | - $tree->setPreference('GENERATE_UIDS', (string)(bool)$request->get('GENERATE_UIDS')); |
|
1063 | + $tree->setPreference('GENERATE_UIDS', (string) (bool) $request->get('GENERATE_UIDS')); |
|
1064 | 1064 | $tree->setPreference('GEONAMES_ACCOUNT', $request->get('GEONAMES_ACCOUNT')); |
1065 | - $tree->setPreference('HIDE_GEDCOM_ERRORS', (string)(bool)$request->get('HIDE_GEDCOM_ERRORS')); |
|
1065 | + $tree->setPreference('HIDE_GEDCOM_ERRORS', (string) (bool) $request->get('HIDE_GEDCOM_ERRORS')); |
|
1066 | 1066 | $tree->setPreference('INDI_FACTS_ADD', implode(',', $request->get('INDI_FACTS_ADD', []))); |
1067 | 1067 | $tree->setPreference('INDI_FACTS_QUICK', implode(',', $request->get('INDI_FACTS_QUICK', []))); |
1068 | 1068 | $tree->setPreference('INDI_FACTS_UNIQUE', implode(',', $request->get('INDI_FACTS_UNIQUE', []))); |
1069 | 1069 | $tree->setPreference('LANGUAGE', $request->get('LANGUAGE')); |
1070 | - $tree->setPreference('MAX_DESCENDANCY_GENERATIONS', (string)(int)$request->get('MAX_DESCENDANCY_GENERATIONS')); |
|
1071 | - $tree->setPreference('MAX_PEDIGREE_GENERATIONS', (string)(int)$request->get('MAX_PEDIGREE_GENERATIONS')); |
|
1070 | + $tree->setPreference('MAX_DESCENDANCY_GENERATIONS', (string) (int) $request->get('MAX_DESCENDANCY_GENERATIONS')); |
|
1071 | + $tree->setPreference('MAX_PEDIGREE_GENERATIONS', (string) (int) $request->get('MAX_PEDIGREE_GENERATIONS')); |
|
1072 | 1072 | $tree->setPreference('MEDIA_UPLOAD', $request->get('MEDIA_UPLOAD')); |
1073 | 1073 | $tree->setPreference('META_DESCRIPTION', $request->get('META_DESCRIPTION')); |
1074 | 1074 | $tree->setPreference('META_TITLE', $request->get('META_TITLE')); |
1075 | - $tree->setPreference('NO_UPDATE_CHAN', (string)(bool)$request->get('NO_UPDATE_CHAN')); |
|
1076 | - $tree->setPreference('PEDIGREE_LAYOUT', (string)(bool)$request->get('PEDIGREE_LAYOUT')); |
|
1075 | + $tree->setPreference('NO_UPDATE_CHAN', (string) (bool) $request->get('NO_UPDATE_CHAN')); |
|
1076 | + $tree->setPreference('PEDIGREE_LAYOUT', (string) (bool) $request->get('PEDIGREE_LAYOUT')); |
|
1077 | 1077 | $tree->setPreference('PEDIGREE_ROOT_ID', $request->get('PEDIGREE_ROOT_ID', WT_REGEX_XREF)); |
1078 | - $tree->setPreference('PEDIGREE_SHOW_GENDER', (string)(bool)$request->get('PEDIGREE_SHOW_GENDER')); |
|
1078 | + $tree->setPreference('PEDIGREE_SHOW_GENDER', (string) (bool) $request->get('PEDIGREE_SHOW_GENDER')); |
|
1079 | 1079 | $tree->setPreference('PREFER_LEVEL2_SOURCES', $request->get('PREFER_LEVEL2_SOURCES')); |
1080 | 1080 | $tree->setPreference('QUICK_REQUIRED_FACTS', implode(',', $request->get('QUICK_REQUIRED_FACTS', []))); |
1081 | 1081 | $tree->setPreference('QUICK_REQUIRED_FAMFACTS', implode(',', $request->get('QUICK_REQUIRED_FAMFACTS', []))); |
1082 | 1082 | $tree->setPreference('REPO_FACTS_ADD', implode(',', $request->get('REPO_FACTS_ADD', []))); |
1083 | 1083 | $tree->setPreference('REPO_FACTS_QUICK', implode(',', $request->get('REPO_FACTS_QUICK', []))); |
1084 | 1084 | $tree->setPreference('REPO_FACTS_UNIQUE', implode(',', $request->get('REPO_FACTS_UNIQUE', []))); |
1085 | - $tree->setPreference('SHOW_COUNTER', (string)(bool)$request->get('SHOW_COUNTER')); |
|
1086 | - $tree->setPreference('SHOW_EST_LIST_DATES', (string)(bool)$request->get('SHOW_EST_LIST_DATES')); |
|
1087 | - $tree->setPreference('SHOW_FACT_ICONS', (string)(bool)$request->get('SHOW_FACT_ICONS')); |
|
1088 | - $tree->setPreference('SHOW_GEDCOM_RECORD', (string)(bool)$request->get('SHOW_GEDCOM_RECORD')); |
|
1089 | - $tree->setPreference('SHOW_HIGHLIGHT_IMAGES', (string)(bool)$request->get('SHOW_HIGHLIGHT_IMAGES')); |
|
1090 | - $tree->setPreference('SHOW_LAST_CHANGE', (string)(bool)$request->get('SHOW_LAST_CHANGE')); |
|
1091 | - $tree->setPreference('SHOW_LDS_AT_GLANCE', (string)(bool)$request->get('SHOW_LDS_AT_GLANCE')); |
|
1085 | + $tree->setPreference('SHOW_COUNTER', (string) (bool) $request->get('SHOW_COUNTER')); |
|
1086 | + $tree->setPreference('SHOW_EST_LIST_DATES', (string) (bool) $request->get('SHOW_EST_LIST_DATES')); |
|
1087 | + $tree->setPreference('SHOW_FACT_ICONS', (string) (bool) $request->get('SHOW_FACT_ICONS')); |
|
1088 | + $tree->setPreference('SHOW_GEDCOM_RECORD', (string) (bool) $request->get('SHOW_GEDCOM_RECORD')); |
|
1089 | + $tree->setPreference('SHOW_HIGHLIGHT_IMAGES', (string) (bool) $request->get('SHOW_HIGHLIGHT_IMAGES')); |
|
1090 | + $tree->setPreference('SHOW_LAST_CHANGE', (string) (bool) $request->get('SHOW_LAST_CHANGE')); |
|
1091 | + $tree->setPreference('SHOW_LDS_AT_GLANCE', (string) (bool) $request->get('SHOW_LDS_AT_GLANCE')); |
|
1092 | 1092 | $tree->setPreference('SHOW_MEDIA_DOWNLOAD', $request->get('SHOW_MEDIA_DOWNLOAD')); |
1093 | 1093 | $tree->setPreference('SHOW_NO_WATERMARK', $request->get('SHOW_NO_WATERMARK')); |
1094 | - $tree->setPreference('SHOW_PARENTS_AGE', (string)(bool)$request->get('SHOW_PARENTS_AGE')); |
|
1094 | + $tree->setPreference('SHOW_PARENTS_AGE', (string) (bool) $request->get('SHOW_PARENTS_AGE')); |
|
1095 | 1095 | $tree->setPreference('SHOW_PEDIGREE_PLACES', $request->get('SHOW_PEDIGREE_PLACES')); |
1096 | - $tree->setPreference('SHOW_PEDIGREE_PLACES_SUFFIX', (string)(bool)$request->get('SHOW_PEDIGREE_PLACES_SUFFIX')); |
|
1096 | + $tree->setPreference('SHOW_PEDIGREE_PLACES_SUFFIX', (string) (bool) $request->get('SHOW_PEDIGREE_PLACES_SUFFIX')); |
|
1097 | 1097 | $tree->setPreference('SHOW_RELATIVES_EVENTS', implode(',', $request->get('SHOW_RELATIVES_EVENTS', []))); |
1098 | 1098 | $tree->setPreference('SOUR_FACTS_ADD', implode(',', $request->get('SOUR_FACTS_ADD', []))); |
1099 | 1099 | $tree->setPreference('SOUR_FACTS_QUICK', implode(',', $request->get('SOUR_FACTS_QUICK', []))); |
1100 | 1100 | $tree->setPreference('SOUR_FACTS_UNIQUE', implode(',', $request->get('SOUR_FACTS_UNIQUE', []))); |
1101 | - $tree->setPreference('SUBLIST_TRIGGER_I', (string)(int)$request->get('SUBLIST_TRIGGER_I', 200)); |
|
1101 | + $tree->setPreference('SUBLIST_TRIGGER_I', (string) (int) $request->get('SUBLIST_TRIGGER_I', 200)); |
|
1102 | 1102 | $tree->setPreference('SURNAME_LIST_STYLE', $request->get('SURNAME_LIST_STYLE')); |
1103 | 1103 | $tree->setPreference('SURNAME_TRADITION', $request->get('SURNAME_TRADITION')); |
1104 | 1104 | $tree->setPreference('THEME_DIR', $request->get('THEME_DIR')); |
1105 | - $tree->setPreference('USE_SILHOUETTE', (string)(bool)$request->get('USE_SILHOUETTE')); |
|
1105 | + $tree->setPreference('USE_SILHOUETTE', (string) (bool) $request->get('USE_SILHOUETTE')); |
|
1106 | 1106 | $tree->setPreference('WEBMASTER_USER_ID', $request->get('WEBMASTER_USER_ID')); |
1107 | 1107 | $tree->setPreference('WEBTREES_EMAIL', $request->get('WEBTREES_EMAIL')); |
1108 | 1108 | $tree->setPreference('title', $request->get('title')); |
@@ -1607,7 +1607,7 @@ discard block |
||
1607 | 1607 | |
1608 | 1608 | foreach ($gedcom_files as $gedcom_file) { |
1609 | 1609 | // Only import files that have changed |
1610 | - $filemtime = (string)filemtime(WT_DATA_DIR . $gedcom_file); |
|
1610 | + $filemtime = (string) filemtime(WT_DATA_DIR . $gedcom_file); |
|
1611 | 1611 | |
1612 | 1612 | $tree = Tree::findByName($gedcom_file) ?? Tree::create($gedcom_file, $gedcom_file); |
1613 | 1613 | |
@@ -1640,7 +1640,7 @@ discard block |
||
1640 | 1640 | */ |
1641 | 1641 | public function unconnected(Request $request, Tree $tree, User $user): Response |
1642 | 1642 | { |
1643 | - $associates = (bool)$request->get('associates'); |
|
1643 | + $associates = (bool) $request->get('associates'); |
|
1644 | 1644 | |
1645 | 1645 | if ($associates) { |
1646 | 1646 | $sql = "SELECT l_from, l_to FROM `##link` WHERE l_file = :tree_id AND l_type IN ('FAMS', 'FAMC', 'ASSO', '_ASSO')"; |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | public function page(Request $request): Response |
44 | 44 | { |
45 | 45 | $surname = $request->get('surname', ''); |
46 | - $soundex_std = (bool)$request->get('soundex_std'); |
|
47 | - $soundex_dm = (bool)$request->get('soundex_dm'); |
|
46 | + $soundex_std = (bool) $request->get('soundex_std'); |
|
47 | + $soundex_dm = (bool) $request->get('soundex_dm'); |
|
48 | 48 | |
49 | 49 | if ($surname !== '') { |
50 | 50 | $title = /* I18N: %s is a surname */ |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function list(Request $request, Tree $tree, User $user): Response |
73 | 73 | { |
74 | - $soundex_dm = (bool)$request->get('soundex_dm'); |
|
75 | - $soundex_std = (bool)$request->get('soundex_std'); |
|
74 | + $soundex_dm = (bool) $request->get('soundex_dm'); |
|
75 | + $soundex_std = (bool) $request->get('soundex_std'); |
|
76 | 76 | $surname = $request->get('surname', ''); |
77 | 77 | |
78 | 78 | // Highlight direct-line ancestors of this individual. |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $sdx = Soundex::russell($surname); |
161 | 161 | if ($sdx !== '') { |
162 | 162 | foreach (explode(':', $sdx) as $value) { |
163 | - $sql .= " OR n_soundex_surn_std LIKE CONCAT('%', ?, '%')"; |
|
163 | + $sql .= " OR n_soundex_surn_std LIKE CONCAT('%', ?, '%')"; |
|
164 | 164 | $args[] = $value; |
165 | 165 | } |
166 | 166 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $sdx = Soundex::daitchMokotoff($surname); |
171 | 171 | if ($sdx !== '') { |
172 | 172 | foreach (explode(':', $sdx) as $value) { |
173 | - $sql .= " OR n_soundex_surn_dm LIKE CONCAT('%', ?, '%')"; |
|
173 | + $sql .= " OR n_soundex_surn_dm LIKE CONCAT('%', ?, '%')"; |
|
174 | 174 | $args[] = $value; |
175 | 175 | } |
176 | 176 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | */ |
341 | 341 | private static function sosaGeneration($sosa) |
342 | 342 | { |
343 | - $generation = (int)log($sosa, 2) + 1; |
|
343 | + $generation = (int) log($sosa, 2) + 1; |
|
344 | 344 | |
345 | 345 | return '<sup title="' . I18N::translate('Generation') . '">' . $generation . '</sup>'; |
346 | 346 | } |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | */ |
699 | 699 | public function changesLogData(Request $request): Response |
700 | 700 | { |
701 | - list($select, , $where, $args1) = $this->changesQuery($request); |
|
701 | + list($select,, $where, $args1) = $this->changesQuery($request); |
|
702 | 702 | list($order_by, $limit, $args2) = $this->dataTablesPagination($request); |
703 | 703 | |
704 | 704 | $rows = Database::prepare( |
@@ -706,8 +706,8 @@ discard block |
||
706 | 706 | )->execute(array_merge($args1, $args2))->fetchAll(); |
707 | 707 | |
708 | 708 | // Total filtered/unfiltered rows |
709 | - $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
710 | - $recordsTotal = (int)Database::prepare("SELECT COUNT(*) FROM `##change`")->fetchOne(); |
|
709 | + $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
710 | + $recordsTotal = (int) Database::prepare("SELECT COUNT(*) FROM `##change`")->fetchOne(); |
|
711 | 711 | |
712 | 712 | $data = []; |
713 | 713 | $algorithm = new MyersDiff; |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | |
758 | 758 | // See http://www.datatables.net/usage/server-side |
759 | 759 | return new JsonResponse([ |
760 | - 'draw' => (int)$request->get('draw'), |
|
760 | + 'draw' => (int) $request->get('draw'), |
|
761 | 761 | 'recordsTotal' => $recordsTotal, |
762 | 762 | 'recordsFiltered' => $recordsFiltered, |
763 | 763 | 'data' => $data, |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | */ |
774 | 774 | public function changesLogDownload(Request $request): Response |
775 | 775 | { |
776 | - list($select, , $where, $args) = $this->changesQuery($request); |
|
776 | + list($select,, $where, $args) = $this->changesQuery($request); |
|
777 | 777 | |
778 | 778 | $rows = Database::prepare($select . $where)->execute($args)->fetchAll(); |
779 | 779 | |
@@ -917,8 +917,8 @@ discard block |
||
917 | 917 | 'RESN', |
918 | 918 | ]; |
919 | 919 | |
920 | - $start = (int)$request->get('start', 0); |
|
921 | - $length = (int)$request->get('length', 20); |
|
920 | + $start = (int) $request->get('start', 0); |
|
921 | + $length = (int) $request->get('length', 20); |
|
922 | 922 | $search = $request->get('search', []); |
923 | 923 | $search = $search['value'] ?? ''; |
924 | 924 | |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | $args = []; |
939 | 939 | |
940 | 940 | if ($search !== '') { |
941 | - $where .= " AND (multimedia_file_refn LIKE CONCAT('%', :search1, '%') OR multimedia_file_refn LIKE CONCAT('%', :search2, '%'))"; |
|
941 | + $where .= " AND (multimedia_file_refn LIKE CONCAT('%', :search1, '%') OR multimedia_file_refn LIKE CONCAT('%', :search2, '%'))"; |
|
942 | 942 | $args['search1'] = $search; |
943 | 943 | $args['search2'] = $search; |
944 | 944 | } |
@@ -957,8 +957,8 @@ discard block |
||
957 | 957 | )->fetchAll(); |
958 | 958 | |
959 | 959 | // Total filtered/unfiltered rows |
960 | - $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
961 | - $recordsTotal = (int)Database::prepare($select2)->fetchOne(); |
|
960 | + $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
961 | + $recordsTotal = (int) Database::prepare($select2)->fetchOne(); |
|
962 | 962 | |
963 | 963 | // Turn each row from the query into a row for the table |
964 | 964 | $data = array_map(function (stdClass $datum) use ($ignore_facts) { |
@@ -1000,7 +1000,7 @@ discard block |
||
1000 | 1000 | }, $data); |
1001 | 1001 | |
1002 | 1002 | return new JsonResponse([ |
1003 | - 'draw' => (int)$request->get('draw'), |
|
1003 | + 'draw' => (int) $request->get('draw'), |
|
1004 | 1004 | 'recordsTotal' => $recordsTotal, |
1005 | 1005 | 'recordsFiltered' => $recordsFiltered, |
1006 | 1006 | 'data' => $data, |
@@ -1089,8 +1089,8 @@ discard block |
||
1089 | 1089 | */ |
1090 | 1090 | public function webtrees1ThumbnailsData(Request $request): JsonResponse |
1091 | 1091 | { |
1092 | - $start = (int)$request->get('start', 0); |
|
1093 | - $length = (int)$request->get('length', 20); |
|
1092 | + $start = (int) $request->get('start', 0); |
|
1093 | + $length = (int) $request->get('length', 20); |
|
1094 | 1094 | $search = $request->get('search', []); |
1095 | 1095 | $search = $search['value'] ?? ''; |
1096 | 1096 | |
@@ -1121,7 +1121,7 @@ discard block |
||
1121 | 1121 | $data = array_map(function (string $thumbnail) { |
1122 | 1122 | $original = $this->findOriginalFileFromThumbnail($thumbnail); |
1123 | 1123 | |
1124 | - $original_url = route('unused-media-thumbnail', [ |
|
1124 | + $original_url = route('unused-media-thumbnail', [ |
|
1125 | 1125 | 'folder' => dirname($original), |
1126 | 1126 | 'file' => basename($original), |
1127 | 1127 | 'w' => 100, |
@@ -1163,7 +1163,7 @@ discard block |
||
1163 | 1163 | }, $thumbnails); |
1164 | 1164 | |
1165 | 1165 | return new JsonResponse([ |
1166 | - 'draw' => (int)$request->get('draw'), |
|
1166 | + 'draw' => (int) $request->get('draw'), |
|
1167 | 1167 | 'recordsTotal' => $recordsTotal, |
1168 | 1168 | 'recordsFiltered' => $recordsFiltered, |
1169 | 1169 | 'data' => $data, |
@@ -1481,7 +1481,7 @@ discard block |
||
1481 | 1481 | */ |
1482 | 1482 | public function treePrivacyUpdate(Request $request, Tree $tree): RedirectResponse |
1483 | 1483 | { |
1484 | - foreach ((array)$request->get('delete') as $default_resn_id) { |
|
1484 | + foreach ((array) $request->get('delete') as $default_resn_id) { |
|
1485 | 1485 | Database::prepare( |
1486 | 1486 | "DELETE FROM `##default_resn` WHERE default_resn_id = :default_resn_id" |
1487 | 1487 | )->execute([ |
@@ -1489,13 +1489,13 @@ discard block |
||
1489 | 1489 | ]); |
1490 | 1490 | } |
1491 | 1491 | |
1492 | - $xrefs = (array)$request->get('xref'); |
|
1493 | - $tag_types = (array)$request->get('tag_type'); |
|
1494 | - $resns = (array)$request->get('resn'); |
|
1492 | + $xrefs = (array) $request->get('xref'); |
|
1493 | + $tag_types = (array) $request->get('tag_type'); |
|
1494 | + $resns = (array) $request->get('resn'); |
|
1495 | 1495 | |
1496 | 1496 | foreach ($xrefs as $n => $xref) { |
1497 | - $tag_type = (string)$tag_types[$n]; |
|
1498 | - $resn = (string)$resns[$n]; |
|
1497 | + $tag_type = (string) $tag_types[$n]; |
|
1498 | + $resn = (string) $resns[$n]; |
|
1499 | 1499 | |
1500 | 1500 | if ($tag_type !== '' || $xref !== '') { |
1501 | 1501 | // Delete any existing data |
@@ -1541,10 +1541,10 @@ discard block |
||
1541 | 1541 | FlashMessages::addMessage(I18N::translate('The preferences for the family tree “%s” have been updated.', e($tree->getTitle()), 'success')); |
1542 | 1542 | |
1543 | 1543 | // Coming soon... |
1544 | - if ((bool)$request->get('all_trees')) { |
|
1544 | + if ((bool) $request->get('all_trees')) { |
|
1545 | 1545 | FlashMessages::addMessage(I18N::translate('The preferences for all family trees have been updated.', e($tree->getTitle())), 'success'); |
1546 | 1546 | } |
1547 | - if ((bool)$request->get('new_trees')) { |
|
1547 | + if ((bool) $request->get('new_trees')) { |
|
1548 | 1548 | FlashMessages::addMessage(I18N::translate('The preferences for new family trees have been updated.', e($tree->getTitle())), 'success'); |
1549 | 1549 | } |
1550 | 1550 | |
@@ -1567,7 +1567,7 @@ discard block |
||
1567 | 1567 | foreach ($modules as $module) { |
1568 | 1568 | foreach (Tree::getAll() as $tree) { |
1569 | 1569 | $key = 'access-' . $module->getName() . '-' . $tree->getTreeId(); |
1570 | - $access_level = (int)$request->get($key, $module->defaultAccessLevel()); |
|
1570 | + $access_level = (int) $request->get($key, $module->defaultAccessLevel()); |
|
1571 | 1571 | |
1572 | 1572 | Database::prepare("REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level)" . " VALUES (:module_name, :tree_id, :component, :access_level)")->execute([ |
1573 | 1573 | 'module_name' => $module->getName(), |
@@ -1594,7 +1594,7 @@ discard block |
||
1594 | 1594 | $module_status = Database::prepare("SELECT module_name, status FROM `##module`")->fetchAssoc(); |
1595 | 1595 | |
1596 | 1596 | foreach ($modules as $module) { |
1597 | - $new_status = (bool)$request->get('status-' . $module->getName()) ? 'enabled' : 'disabled'; |
|
1597 | + $new_status = (bool) $request->get('status-' . $module->getName()) ? 'enabled' : 'disabled'; |
|
1598 | 1598 | $old_status = $module_status[$module->getName()]; |
1599 | 1599 | |
1600 | 1600 | if ($new_status !== $old_status) { |
@@ -1657,36 +1657,36 @@ discard block |
||
1657 | 1657 | $where = ' WHERE 1'; |
1658 | 1658 | $args = []; |
1659 | 1659 | if ($search !== '') { |
1660 | - $where .= " AND (old_gedcom LIKE CONCAT('%', :search_1, '%') OR new_gedcom LIKE CONCAT('%', :search_2, '%'))"; |
|
1660 | + $where .= " AND (old_gedcom LIKE CONCAT('%', :search_1, '%') OR new_gedcom LIKE CONCAT('%', :search_2, '%'))"; |
|
1661 | 1661 | $args['search_1'] = $search; |
1662 | 1662 | $args['search_2'] = $search; |
1663 | 1663 | } |
1664 | 1664 | if ($from !== '') { |
1665 | - $where .= " AND change_time >= :from"; |
|
1665 | + $where .= " AND change_time >= :from"; |
|
1666 | 1666 | $args['from'] = $from; |
1667 | 1667 | } |
1668 | 1668 | if ($to !== '') { |
1669 | - $where .= ' AND change_time < TIMESTAMPADD(DAY, 1 , :to)'; // before end of the day |
|
1669 | + $where .= ' AND change_time < TIMESTAMPADD(DAY, 1 , :to)'; // before end of the day |
|
1670 | 1670 | $args['to'] = $to; |
1671 | 1671 | } |
1672 | 1672 | if ($type !== '') { |
1673 | - $where .= ' AND status = :status'; |
|
1673 | + $where .= ' AND status = :status'; |
|
1674 | 1674 | $args['status'] = $type; |
1675 | 1675 | } |
1676 | 1676 | if ($oldged !== '') { |
1677 | - $where .= " AND old_gedcom LIKE CONCAT('%', :old_ged, '%')"; |
|
1677 | + $where .= " AND old_gedcom LIKE CONCAT('%', :old_ged, '%')"; |
|
1678 | 1678 | $args['old_ged'] = $oldged; |
1679 | 1679 | } |
1680 | 1680 | if ($newged !== '') { |
1681 | - $where .= " AND new_gedcom LIKE CONCAT('%', :new_ged, '%')"; |
|
1681 | + $where .= " AND new_gedcom LIKE CONCAT('%', :new_ged, '%')"; |
|
1682 | 1682 | $args['new_ged'] = $newged; |
1683 | 1683 | } |
1684 | 1684 | if ($xref !== '') { |
1685 | - $where .= " AND xref = :xref"; |
|
1685 | + $where .= " AND xref = :xref"; |
|
1686 | 1686 | $args['xref'] = $xref; |
1687 | 1687 | } |
1688 | 1688 | if ($username !== '') { |
1689 | - $where .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
1689 | + $where .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
1690 | 1690 | $args['user'] = $username; |
1691 | 1691 | } |
1692 | 1692 | if ($ged !== '') { |
@@ -1737,8 +1737,8 @@ discard block |
||
1737 | 1737 | */ |
1738 | 1738 | private function dataTablesPagination(Request $request): array |
1739 | 1739 | { |
1740 | - $start = (int)$request->get('start', '0'); |
|
1741 | - $length = (int)$request->get('length', '0'); |
|
1740 | + $start = (int) $request->get('start', '0'); |
|
1741 | + $length = (int) $request->get('length', '0'); |
|
1742 | 1742 | $order = $request->get('order', []); |
1743 | 1743 | $args = []; |
1744 | 1744 | |
@@ -1907,7 +1907,7 @@ discard block |
||
1907 | 1907 | } |
1908 | 1908 | |
1909 | 1909 | // The maximum difference is 255 (black versus white). |
1910 | - return 100 - (int)($max_difference * 100 / 255); |
|
1910 | + return 100 - (int) ($max_difference * 100 / 255); |
|
1911 | 1911 | } |
1912 | 1912 | |
1913 | 1913 | /** |
@@ -1938,7 +1938,7 @@ discard block |
||
1938 | 1938 | $pixels[$x] = []; |
1939 | 1939 | for ($y = 0; $y < $size; ++$y) { |
1940 | 1940 | $pixel = $image->pickColor($x, $y); |
1941 | - $pixels[$x][$y] = (int)(($pixel[0] + $pixel[1] + $pixel[2]) / 3); |
|
1941 | + $pixels[$x][$y] = (int) (($pixel[0] + $pixel[1] + $pixel[2]) / 3); |
|
1942 | 1942 | } |
1943 | 1943 | } |
1944 | 1944 |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | { |
53 | 53 | $this->checkModuleIsActive($tree, 'lifespans_chart'); |
54 | 54 | |
55 | - $xrefs = (array)$request->get('xrefs', []); |
|
55 | + $xrefs = (array) $request->get('xrefs', []); |
|
56 | 56 | $addxref = $request->get('addxref', ''); |
57 | - $addfam = (bool)$request->get('addfam', false); |
|
57 | + $addfam = (bool) $request->get('addfam', false); |
|
58 | 58 | $placename = $request->get('placename', ''); |
59 | 59 | $start = $request->get('start', ''); |
60 | 60 | $end = $request->get('end', ''); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $this->checkModuleIsActive($tree, 'lifespans_chart'); |
113 | 113 | |
114 | - $xrefs = (array)$request->get('xrefs', []); |
|
114 | + $xrefs = (array) $request->get('xrefs', []); |
|
115 | 115 | $xrefs = array_unique($xrefs); |
116 | 116 | |
117 | 117 | /** @var Individual[] $individuals */ |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | $subtitle = $request->get('subtitle'); |
132 | 132 | |
133 | 133 | // Round to whole decades |
134 | - $start_year = (int)floor($this->minYear($individuals) / 10) * 10; |
|
135 | - $end_year = (int)ceil($this->maxYear($individuals) / 10) * 10; |
|
134 | + $start_year = (int) floor($this->minYear($individuals) / 10) * 10; |
|
135 | + $end_year = (int) ceil($this->maxYear($individuals) / 10) * 10; |
|
136 | 136 | |
137 | 137 | $lifespans = $this->layoutIndividuals($individuals); |
138 | 138 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | 'U' => new ColorGenerator(120, self::SATURATION, self::LIGHTNESS, self::ALPHA, self::RANGE), |
168 | 168 | ]; |
169 | 169 | |
170 | - $current_year = (int)date('Y'); |
|
170 | + $current_year = (int) date('Y'); |
|
171 | 171 | |
172 | 172 | // Latest year used in each row |
173 | 173 | $rows = []; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | // Fill the row up to the year (leaving a small gap) |
197 | 197 | $rows[$next_row] = $death_year; |
198 | 198 | |
199 | - $lifespans[] = (object)[ |
|
199 | + $lifespans[] = (object) [ |
|
200 | 200 | 'background' => $colors[$individual->getSex()]->getNextColor(), |
201 | 201 | 'birth_year' => $birth_year, |
202 | 202 | 'death_year' => $death_year, |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $year = $this->jdToYear($jd); |
226 | 226 | |
227 | 227 | // Don't show future dates |
228 | - return min($year, (int)date('Y')); |
|
228 | + return min($year, (int) date('Y')); |
|
229 | 229 | |
230 | 230 | } |
231 | 231 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | class PedigreeMapModule extends AbstractModule implements ModuleChartInterface |
37 | 37 | { |
38 | - const LINE_COLORS = [ |
|
38 | + const LINE_COLORS = [ |
|
39 | 39 | '#FF0000', |
40 | 40 | // Red |
41 | 41 | '#00FF00', |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $color = self::LINE_COLORS[log($id, 2) % $color_count]; |
141 | 141 | $icon['color'] = $color; //make icon color the same as the line |
142 | 142 | $sosa_points[$id] = $event->getLatLonJSArray(); |
143 | - $sosa_parent = (int)floor($id / 2); |
|
143 | + $sosa_parent = (int) floor($id / 2); |
|
144 | 144 | if (array_key_exists($sosa_parent, $sosa_points)) { |
145 | 145 | // Would like to use a GeometryCollection to hold LineStrings |
146 | 146 | // rather than generate polylines but the MarkerCluster library |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | 'icon' => $icon, |
169 | 169 | 'tooltip' => $event->toolTip(), |
170 | 170 | 'summary' => view('modules/pedigree-map/event-sidebar', $event->shortSummary('pedigree', $id)), |
171 | - 'zoom' => (int)$event->getZoom(), |
|
171 | + 'zoom' => (int) $event->getZoom(), |
|
172 | 172 | ], |
173 | 173 | ]; |
174 | 174 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | { |
189 | 189 | $xref = $request->get('reference'); |
190 | 190 | $individual = Individual::getInstance($xref, $tree); |
191 | - $generations = (int)$request->get( |
|
191 | + $generations = (int) $request->get( |
|
192 | 192 | 'generations', |
193 | 193 | $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS') |
194 | 194 | ); |
@@ -241,14 +241,14 @@ discard block |
||
241 | 241 | function ($item) { |
242 | 242 | return preg_replace('/[^a-z\d]/i', '', strtolower($item)); |
243 | 243 | }, |
244 | - (array)$provider->styles |
|
244 | + (array) $provider->styles |
|
245 | 245 | ); |
246 | 246 | |
247 | - $key = preg_replace('/[^a-z\d]/i', '', strtolower((string)$provider->name)); |
|
247 | + $key = preg_replace('/[^a-z\d]/i', '', strtolower((string) $provider->name)); |
|
248 | 248 | |
249 | 249 | self::$map_providers[$key] = [ |
250 | - 'name' => (string)$provider->name, |
|
251 | - 'styles' => array_combine($style_keys, (array)$provider->styles), |
|
250 | + 'name' => (string) $provider->name, |
|
251 | + 'styles' => array_combine($style_keys, (array) $provider->styles), |
|
252 | 252 | ]; |
253 | 253 | } |
254 | 254 | } catch (Exception $ex) { |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | 'provider' => 'openstreetmap', |
258 | 258 | 'style' => 'mapnik', |
259 | 259 | ]; |
260 | - self::$map_providers = [ |
|
260 | + self::$map_providers = [ |
|
261 | 261 | 'openstreetmap' => [ |
262 | 262 | 'name' => 'OpenStreetMap', |
263 | 263 | 'styles' => ['mapnik' => 'Mapnik'], |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | throw new IndividualAccessDeniedException; |
319 | 319 | } |
320 | 320 | |
321 | - return (object)[ |
|
321 | + return (object) [ |
|
322 | 322 | 'name' => 'modules/pedigree-map/pedigree-map-page', |
323 | 323 | 'data' => [ |
324 | 324 | 'module' => $this->getName(), |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function postDeleteMessageAction(Request $request, Tree $tree): Response |
57 | 57 | { |
58 | - $message_ids = (array)$request->get('message_id', []); |
|
58 | + $message_ids = (array) $request->get('message_id', []); |
|
59 | 59 | |
60 | 60 | $stmt = Database::prepare("DELETE FROM `##message` WHERE user_id = :user_id AND message_id = :message_id"); |
61 | 61 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | $content = ''; |
102 | 102 | if (!empty($users)) { |
103 | - $url = route('user-page', ['ged' => $tree->getName()]); |
|
103 | + $url = route('user-page', ['ged' => $tree->getName()]); |
|
104 | 104 | $content .= '<form onsubmit="return $("#to").val() !== """>'; |
105 | 105 | $content .= '<input type="hidden" name="route" value="message">'; |
106 | 106 | $content .= '<input type="hidden" name="ged" value="' . e($tree->getName()) . '">'; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $content .= '<td class="list_value_wrap"><a href="#" onclick="return expand_layer(\'message' . $message->message_id . '\');"><i id="message' . $message->message_id . '_img" class="icon-plus"></i> <b dir="auto">' . e($message->subject) . '</b></a></td>'; |
137 | 137 | $content .= '<td class="list_value_wrap">' . FunctionsDate::formatTimestamp($message->created + WT_TIMESTAMP_OFFSET) . '</td>'; |
138 | 138 | $content .= '<td class="list_value_wrap">'; |
139 | - $user = User::findByIdentifier($message->sender); |
|
139 | + $user = User::findByIdentifier($message->sender); |
|
140 | 140 | if ($user) { |
141 | 141 | $content .= '<span dir="auto">' . e($user->getRealName()) . '</span> - <span dir="auto">' . $user->getEmail() . '</span>'; |
142 | 142 | } else { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | 'subject' => $message->subject, |
159 | 159 | 'ged' => $tree->getName(), |
160 | 160 | ]); |
161 | - $content .= '<a class="btn btn-primary" href="' . e($reply_url) . '" title="' . I18N::translate('Reply') . '">' . I18N::translate('Reply') . '</a> '; |
|
161 | + $content .= '<a class="btn btn-primary" href="' . e($reply_url) . '" title="' . I18N::translate('Reply') . '">' . I18N::translate('Reply') . '</a> '; |
|
162 | 162 | } |
163 | 163 | $content .= '<button type="button" class="btn btn-danger" data-confirm="' . I18N::translate('Are you sure you want to delete this message? It cannot be retrieved later.') . '" onclick="if (confirm(this.dataset.confirm)) {$(\'#messageform :checkbox\').prop(\'checked\', false); $(\'#cb_message' . $message->message_id . '\').prop(\'checked\', true); document.messageform.submit();}">' . I18N::translate('Delete') . '</button></div></td></tr>'; |
164 | 164 | } |
@@ -191,7 +191,7 @@ |
||
191 | 191 | */ |
192 | 192 | public function postDeleteFavoriteAction(Request $request, Tree $tree, User $user): RedirectResponse |
193 | 193 | { |
194 | - $favorite_id = (int)$request->get('favorite_id'); |
|
194 | + $favorite_id = (int) $request->get('favorite_id'); |
|
195 | 195 | |
196 | 196 | if (Auth::check()) { |
197 | 197 | Database::prepare( |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public function postAdminDeleteAction(Request $request, Tree $tree): RedirectResponse |
158 | 158 | { |
159 | - $block_id = (int)$request->get('block_id'); |
|
159 | + $block_id = (int) $request->get('block_id'); |
|
160 | 160 | |
161 | 161 | Database::prepare( |
162 | 162 | "DELETE FROM `##block_setting` WHERE block_id = :block_id" |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function postAdminMoveDownAction(Request $request, Tree $tree): RedirectResponse |
186 | 186 | { |
187 | - $block_id = (int)$request->get('block_id'); |
|
187 | + $block_id = (int) $request->get('block_id'); |
|
188 | 188 | |
189 | 189 | $block_order = Database::prepare( |
190 | 190 | "SELECT block_order FROM `##block` WHERE block_id = :block_id" |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function postAdminMoveUpAction(Request $request, Tree $tree): RedirectResponse |
239 | 239 | { |
240 | - $block_id = (int)$request->get('block_id'); |
|
240 | + $block_id = (int) $request->get('block_id'); |
|
241 | 241 | |
242 | 242 | $block_order = Database::prepare( |
243 | 243 | "SELECT block_order FROM `##block` WHERE block_id = :block_id" |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | { |
293 | 293 | $this->layout = 'layouts/administration'; |
294 | 294 | |
295 | - $block_id = (int)$request->get('block_id'); |
|
295 | + $block_id = (int) $request->get('block_id'); |
|
296 | 296 | |
297 | 297 | if ($block_id === 0) { |
298 | 298 | // Creating a new faq |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | )->execute([ |
304 | 304 | 'module_name' => $this->getName(), |
305 | 305 | ])->fetchOne(); |
306 | - $languages = []; |
|
306 | + $languages = []; |
|
307 | 307 | |
308 | 308 | $title = I18N::translate('Add an FAQ'); |
309 | 309 | } else { |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | */ |
341 | 341 | public function postAdminEditAction(Request $request, Tree $tree): RedirectResponse |
342 | 342 | { |
343 | - $block_id = (int)$request->get('block_id'); |
|
343 | + $block_id = (int) $request->get('block_id'); |
|
344 | 344 | $faqbody = $request->get('faqbody', ''); |
345 | 345 | $header = $request->get('header', ''); |
346 | 346 | $languages = $request->get('languages', []); |
@@ -190,7 +190,7 @@ |
||
190 | 190 | */ |
191 | 191 | public function postDeleteFavoriteAction(Request $request, Tree $tree, User $user): RedirectResponse |
192 | 192 | { |
193 | - $favorite_id = (int)$request->get('favorite_id'); |
|
193 | + $favorite_id = (int) $request->get('favorite_id'); |
|
194 | 194 | |
195 | 195 | if (Auth::isManager($tree, $user)) { |
196 | 196 | Database::prepare( |