@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function cleanup(Request $request): Response |
52 | 52 | { |
53 | - $months = (int)$request->get('months', 6); |
|
53 | + $months = (int) $request->get('months', 6); |
|
54 | 54 | |
55 | 55 | $inactive_threshold = time() - $months * 30 * self::SECONDS_PER_DAY; |
56 | 56 | $unverified_threshold = time() - 7 * self::SECONDS_PER_DAY; |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | |
60 | 60 | $inactive_users = array_filter($users, function (User $user) use ($inactive_threshold): bool { |
61 | 61 | if ($user->getPreference('sessiontime') === '0') { |
62 | - $datelogin = (int)$user->getPreference('reg_timestamp'); |
|
62 | + $datelogin = (int) $user->getPreference('reg_timestamp'); |
|
63 | 63 | } else { |
64 | - $datelogin = (int)$user->getPreference('sessiontime'); |
|
64 | + $datelogin = (int) $user->getPreference('sessiontime'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | return $datelogin < $inactive_threshold && $user->getPreference('verified'); |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | |
70 | 70 | $unverified_users = array_filter($users, function (User $user) use ($unverified_threshold): bool { |
71 | 71 | if ($user->getPreference('sessiontime') === '0') { |
72 | - $datelogin = (int)$user->getPreference('reg_timestamp'); |
|
72 | + $datelogin = (int) $user->getPreference('reg_timestamp'); |
|
73 | 73 | } else { |
74 | - $datelogin = (int)$user->getPreference('sessiontime'); |
|
74 | + $datelogin = (int) $user->getPreference('sessiontime'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $datelogin < $unverified_threshold && !$user->getPreference('verified'); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | public function cleanupAction(Request $request): RedirectResponse |
99 | 99 | { |
100 | 100 | foreach (User::all() as $user) { |
101 | - if ((bool)$request->get('del_' . $user->getUserId())) { |
|
101 | + if ((bool) $request->get('del_' . $user->getUserId())) { |
|
102 | 102 | Log::addAuthenticationLog('Deleted user: ' . $user->getUserName()); |
103 | 103 | $user->delete(); |
104 | 104 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | $all_users = User::all(); |
125 | 125 | |
126 | - $page_size = (int)$user->getPreference(' admin_users_page_size', 10); |
|
126 | + $page_size = (int) $user->getPreference(' admin_users_page_size', 10); |
|
127 | 127 | |
128 | 128 | $title = I18N::translate('User administration'); |
129 | 129 | |
@@ -145,10 +145,10 @@ discard block |
||
145 | 145 | public function data(Request $request, User $user): JsonResponse |
146 | 146 | { |
147 | 147 | $search = $request->get('search')['value']; |
148 | - $start = (int)$request->get('start'); |
|
149 | - $length = (int)$request->get('length'); |
|
148 | + $start = (int) $request->get('start'); |
|
149 | + $length = (int) $request->get('length'); |
|
150 | 150 | $order = $request->get('order', []); |
151 | - $draw = (int)$request->get('draw'); |
|
151 | + $draw = (int) $request->get('draw'); |
|
152 | 152 | |
153 | 153 | $sql_select = |
154 | 154 | "SELECT SQL_CALC_FOUND_ROWS u.user_id, user_name, real_name, email, us1.setting_value AS language, us2.setting_value AS registered_at, us3.setting_value AS active_at, us4.setting_value AS verified, us5.setting_value AS verified_by_admin" . |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $args = []; |
164 | 164 | |
165 | 165 | if ($search) { |
166 | - $sql_select .= " AND (user_name LIKE CONCAT('%', :search_1, '%') OR real_name LIKE CONCAT('%', :search_2, '%') OR email LIKE CONCAT('%', :search_3, '%'))"; |
|
166 | + $sql_select .= " AND (user_name LIKE CONCAT('%', :search_1, '%') OR real_name LIKE CONCAT('%', :search_2, '%') OR email LIKE CONCAT('%', :search_3, '%'))"; |
|
167 | 167 | $args['search_1'] = $search; |
168 | 168 | $args['search_2'] = $search; |
169 | 169 | $args['search_3'] = $search; |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | |
193 | 193 | if ($length) { |
194 | 194 | $user->setPreference('admin_users_page_size', $length); |
195 | - $sql_select .= " LIMIT :limit OFFSET :offset"; |
|
195 | + $sql_select .= " LIMIT :limit OFFSET :offset"; |
|
196 | 196 | $args['limit'] = $length; |
197 | 197 | $args['offset'] = $start; |
198 | 198 | } |
@@ -200,8 +200,8 @@ discard block |
||
200 | 200 | $rows = Database::prepare($sql_select)->execute($args)->fetchAll(); |
201 | 201 | |
202 | 202 | // Total filtered/unfiltered rows |
203 | - $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
204 | - $recordsTotal = (int)Database::prepare("SELECT COUNT(*) FROM `##user` WHERE user_id > 0")->fetchOne(); |
|
203 | + $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
204 | + $recordsTotal = (int) Database::prepare("SELECT COUNT(*) FROM `##user` WHERE user_id > 0")->fetchOne(); |
|
205 | 205 | |
206 | 206 | $installed_languages = []; |
207 | 207 | foreach (I18N::installedLocales() as $installed_locale) { |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | */ |
290 | 290 | public function edit(Request $request): Response |
291 | 291 | { |
292 | - $user_id = (int)$request->get('user_id'); |
|
292 | + $user_id = (int) $request->get('user_id'); |
|
293 | 293 | $user = User::find($user_id); |
294 | 294 | |
295 | 295 | if ($user === null) { |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | */ |
373 | 373 | public function update(Request $request, User $user): RedirectResponse |
374 | 374 | { |
375 | - $user_id = (int)$request->get('user_id'); |
|
375 | + $user_id = (int) $request->get('user_id'); |
|
376 | 376 | $username = $request->get('username'); |
377 | 377 | $real_name = $request->get('real_name'); |
378 | 378 | $email = $request->get('email'); |
@@ -382,11 +382,11 @@ discard block |
||
382 | 382 | $timezone = $request->get('timezone'); |
383 | 383 | $contact_method = $request->get('contact_method'); |
384 | 384 | $comment = $request->get('comment'); |
385 | - $auto_accept = (bool)$request->get('auto_accept'); |
|
386 | - $canadmin = (bool)$request->get('canadmin'); |
|
387 | - $visible_online = (bool)$request->get('visible_online'); |
|
388 | - $verified = (bool)$request->get('verified'); |
|
389 | - $approved = (bool)$request->get('approved'); |
|
385 | + $auto_accept = (bool) $request->get('auto_accept'); |
|
386 | + $canadmin = (bool) $request->get('canadmin'); |
|
387 | + $visible_online = (bool) $request->get('visible_online'); |
|
388 | + $verified = (bool) $request->get('verified'); |
|
389 | + $approved = (bool) $request->get('approved'); |
|
390 | 390 | |
391 | 391 | $edit_user = User::find($user_id); |
392 | 392 | |
@@ -403,10 +403,10 @@ discard block |
||
403 | 403 | ->setPreference('TIMEZONE', $timezone) |
404 | 404 | ->setPreference('contactmethod', $contact_method) |
405 | 405 | ->setPreference('comment', $comment) |
406 | - ->setPreference('auto_accept', (string)$auto_accept) |
|
407 | - ->setPreference('visibleonline', (string)$visible_online) |
|
408 | - ->setPreference('verified', (string)$verified) |
|
409 | - ->setPreference('verified_by_admin', (string)$approved); |
|
406 | + ->setPreference('auto_accept', (string) $auto_accept) |
|
407 | + ->setPreference('visibleonline', (string) $visible_online) |
|
408 | + ->setPreference('verified', (string) $verified) |
|
409 | + ->setPreference('verified_by_admin', (string) $approved); |
|
410 | 410 | |
411 | 411 | if ($pass1 !== '') { |
412 | 412 | $edit_user->setPassword($pass1); |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | } |
419 | 419 | |
420 | 420 | foreach (Tree::getAll() as $tree) { |
421 | - $path_length = (int)$request->get('RELATIONSHIP_PATH_LENGTH' . $tree->getTreeId()); |
|
421 | + $path_length = (int) $request->get('RELATIONSHIP_PATH_LENGTH' . $tree->getTreeId()); |
|
422 | 422 | $gedcom_id = $request->get('gedcomid' . $tree->getTreeId(), ''); |
423 | 423 | $can_edit = $request->get('canedit' . $tree->getTreeId(), ''); |
424 | 424 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | |
430 | 430 | $tree->setUserPreference($edit_user, 'gedcomid', $gedcom_id); |
431 | 431 | $tree->setUserPreference($edit_user, 'canedit', $can_edit); |
432 | - $tree->setUserPreference($edit_user, 'RELATIONSHIP_PATH_LENGTH', (string)$path_length); |
|
432 | + $tree->setUserPreference($edit_user, 'RELATIONSHIP_PATH_LENGTH', (string) $path_length); |
|
433 | 433 | } |
434 | 434 | |
435 | 435 | $url = route('admin-users'); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } else { |
54 | 54 | $size = 75.0 + 125.0 * ($count - $minimum) / ($maximum - $minimum); |
55 | 55 | } |
56 | - $url = route($route, [ |
|
56 | + $url = route($route, [ |
|
57 | 57 | 'surname' => $surn, |
58 | 58 | 'ged' => $tree->getName(), |
59 | 59 | ]); |
@@ -130,13 +130,13 @@ discard block |
||
130 | 130 | } |
131 | 131 | $newcol = ceil($count / $col); |
132 | 132 | $html2 = '<table class="list_table"><tr>'; |
133 | - $html2 .= '<td class="list_value" style="padding: 14px;">'; |
|
133 | + $html2 .= '<td class="list_value" style="padding: 14px;">'; |
|
134 | 134 | |
135 | 135 | foreach ($html as $surns) { |
136 | 136 | $html2 .= $surns . '<br>'; |
137 | 137 | $i++; |
138 | 138 | if ($i == $newcol && $i < $count) { |
139 | - $html2 .= '</td><td class="list_value" style="padding: 14px;">'; |
|
139 | + $html2 .= '</td><td class="list_value" style="padding: 14px;">'; |
|
140 | 140 | $newcol = $i + ceil($count / $col); |
141 | 141 | } |
142 | 142 | } |
@@ -841,23 +841,23 @@ |
||
841 | 841 | $year = 365 * $day; |
842 | 842 | |
843 | 843 | if ($seconds > $year) { |
844 | - $years = (int)($seconds / $year); |
|
844 | + $years = (int) ($seconds / $year); |
|
845 | 845 | |
846 | 846 | return self::plural('%s year ago', '%s years ago', $years, self::number($years)); |
847 | 847 | } elseif ($seconds > $month) { |
848 | - $months = (int)($seconds / $month); |
|
848 | + $months = (int) ($seconds / $month); |
|
849 | 849 | |
850 | 850 | return self::plural('%s month ago', '%s months ago', $months, self::number($months)); |
851 | 851 | } elseif ($seconds > $day) { |
852 | - $days = (int)($seconds / $day); |
|
852 | + $days = (int) ($seconds / $day); |
|
853 | 853 | |
854 | 854 | return self::plural('%s day ago', '%s days ago', $days, self::number($days)); |
855 | 855 | } elseif ($seconds > $hour) { |
856 | - $hours = (int)($seconds / $hour); |
|
856 | + $hours = (int) ($seconds / $hour); |
|
857 | 857 | |
858 | 858 | return self::plural('%s hour ago', '%s hours ago', $hours, self::number($hours)); |
859 | 859 | } elseif ($seconds > $minute) { |
860 | - $minutes = (int)($seconds / $minute); |
|
860 | + $minutes = (int) ($seconds / $minute); |
|
861 | 861 | |
862 | 862 | return self::plural('%s minute ago', '%s minutes ago', $minutes, self::number($minutes)); |
863 | 863 | } else { |
@@ -1843,7 +1843,7 @@ discard block |
||
1843 | 1843 | // Some filters/sorts can be applied using SQL, while others require PHP |
1844 | 1844 | switch ($listname) { |
1845 | 1845 | case 'pending': |
1846 | - $rows = Database::prepare( |
|
1846 | + $rows = Database::prepare( |
|
1847 | 1847 | "SELECT xref, CASE new_gedcom WHEN '' THEN old_gedcom ELSE new_gedcom END AS gedcom" . |
1848 | 1848 | " FROM `##change`" . " WHERE (xref, change_id) IN (" . |
1849 | 1849 | " SELECT xref, MAX(change_id)" . |
@@ -1882,7 +1882,7 @@ discard block |
||
1882 | 1882 | $sql_params[$attr . 'date'] = $date->minimumJulianDay(); |
1883 | 1883 | } |
1884 | 1884 | if ($sortby == $match[1]) { |
1885 | - $sortby = ""; |
|
1885 | + $sortby = ""; |
|
1886 | 1886 | $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.d_julianday1"; |
1887 | 1887 | } |
1888 | 1888 | unset($attrs[$attr]); // This filter has been fully processed |
@@ -1894,13 +1894,13 @@ discard block |
||
1894 | 1894 | if ($match[1] != '') { |
1895 | 1895 | $names = explode(' ', $match[1]); |
1896 | 1896 | foreach ($names as $n => $name) { |
1897 | - $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1897 | + $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1898 | 1898 | $sql_params[$attr . 'name' . $n] = $name; |
1899 | 1899 | } |
1900 | 1900 | } |
1901 | 1901 | // Let the DB do the name sorting even when no name was entered |
1902 | 1902 | if ($sortby == 'NAME') { |
1903 | - $sortby = ''; |
|
1903 | + $sortby = ''; |
|
1904 | 1904 | $sql_order_by .= ($sql_order_by ? ', ' : ' ORDER BY ') . "{$attr}.n_sort"; |
1905 | 1905 | } |
1906 | 1906 | } |
@@ -1917,7 +1917,7 @@ discard block |
||
1917 | 1917 | $sql_params[$attr . 'place'] = $match[1]; |
1918 | 1918 | // Don't unset this filter. This is just initial filtering |
1919 | 1919 | } elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) { |
1920 | - $sql_where .= " AND i_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
1920 | + $sql_where .= " AND i_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
1921 | 1921 | $sql_params[$attr . 'contains1'] = $match[1]; |
1922 | 1922 | $sql_params[$attr . 'contains2'] = $match[2]; |
1923 | 1923 | $sql_params[$attr . 'contains3'] = $match[3]; |
@@ -1959,7 +1959,7 @@ discard block |
||
1959 | 1959 | $sql_params[$attr . 'date'] = $date->minimumJulianDay(); |
1960 | 1960 | } |
1961 | 1961 | if ($sortby == $match[1]) { |
1962 | - $sortby = ''; |
|
1962 | + $sortby = ''; |
|
1963 | 1963 | $sql_order_by .= ($sql_order_by ? ', ' : ' ORDER BY ') . "{$attr}.d_julianday1"; |
1964 | 1964 | } |
1965 | 1965 | unset($attrs[$attr]); // This filter has been fully processed |
@@ -1976,13 +1976,13 @@ discard block |
||
1976 | 1976 | if ($match[1] != '') { |
1977 | 1977 | $names = explode(' ', $match[1]); |
1978 | 1978 | foreach ($names as $n => $name) { |
1979 | - $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1979 | + $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')"; |
|
1980 | 1980 | $sql_params[$attr . 'name' . $n] = $name; |
1981 | 1981 | } |
1982 | 1982 | } |
1983 | 1983 | // Let the DB do the name sorting even when no name was entered |
1984 | 1984 | if ($sortby == 'NAME') { |
1985 | - $sortby = ''; |
|
1985 | + $sortby = ''; |
|
1986 | 1986 | $sql_order_by .= ($sql_order_by ? ', ' : ' ORDER BY ') . "{$attr}.n_sort"; |
1987 | 1987 | } |
1988 | 1988 | } |
@@ -1994,7 +1994,7 @@ discard block |
||
1994 | 1994 | $sql_params[$attr . 'place'] = $match[1]; |
1995 | 1995 | // Don't unset this filter. This is just initial filtering |
1996 | 1996 | } elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) { |
1997 | - $sql_where .= " AND f_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
1997 | + $sql_where .= " AND f_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')"; |
|
1998 | 1998 | $sql_params[$attr . 'contains1'] = $match[1]; |
1999 | 1999 | $sql_params[$attr . 'contains2'] = $match[2]; |
2000 | 2000 | $sql_params[$attr . 'contains3'] = $match[3]; |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | $files = $request->get('files'); // local|external|unused |
120 | 120 | $search = $request->get('search'); |
121 | 121 | $search = $search['value']; |
122 | - $start = (int)$request->get('start'); |
|
123 | - $length = (int)$request->get('length'); |
|
122 | + $start = (int) $request->get('start'); |
|
123 | + $length = (int) $request->get('length'); |
|
124 | 124 | |
125 | 125 | // family tree setting MEDIA_DIRECTORY |
126 | 126 | $media_folders = $this->allMediaFolders(); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | " OR descriptive_title LIKE CONCAT('%', :search_2, '%'))" . |
157 | 157 | " AND multimedia_file_refn NOT LIKE 'http://%'" . |
158 | 158 | " AND multimedia_file_refn NOT LIKE 'https://%'"; |
159 | - $ARGS1 = [ |
|
159 | + $ARGS1 = [ |
|
160 | 160 | 'media_path_1' => $media_path, |
161 | 161 | 'media_folder' => $media_folder, |
162 | 162 | 'media_path_2' => Database::escapeLike($media_path), |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | " AND multimedia_file_refn LIKE CONCAT(:media_path_3, '%')" . |
174 | 174 | " AND multimedia_file_refn NOT LIKE 'http://%'" . |
175 | 175 | " AND multimedia_file_refn NOT LIKE 'https://%'"; |
176 | - $ARGS2 = [ |
|
176 | + $ARGS2 = [ |
|
177 | 177 | 'media_folder' => $media_folder, |
178 | 178 | 'media_path_3' => $media_path, |
179 | 179 | ]; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $ARGS2['media_path_4'] = Database::escapeLike($media_path); |
186 | 186 | } |
187 | 187 | |
188 | - $order = $request->get('order', []); |
|
188 | + $order = $request->get('order', []); |
|
189 | 189 | $SELECT1 .= " ORDER BY "; |
190 | 190 | if ($order) { |
191 | 191 | foreach ($order as $key => $value) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | } |
210 | 210 | |
211 | 211 | if ($length > 0) { |
212 | - $SELECT1 .= " LIMIT :length OFFSET :start"; |
|
212 | + $SELECT1 .= " LIMIT :length OFFSET :start"; |
|
213 | 213 | $ARGS1['length'] = $length; |
214 | 214 | $ARGS1['start'] = $start; |
215 | 215 | } |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | " JOIN `##media_file` USING (m_id, m_file)" . |
243 | 243 | " WHERE (multimedia_file_refn LIKE 'http://%' OR multimedia_file_refn LIKE 'https://%')" . |
244 | 244 | " AND (multimedia_file_refn LIKE CONCAT('%', :search_1, '%') OR descriptive_title LIKE CONCAT('%', :search_2, '%'))"; |
245 | - $ARGS1 = [ |
|
245 | + $ARGS1 = [ |
|
246 | 246 | 'search_1' => Database::escapeLike($search), |
247 | 247 | 'search_2' => Database::escapeLike($search), |
248 | 248 | ]; |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | } |
279 | 279 | |
280 | 280 | if ($length > 0) { |
281 | - $SELECT1 .= " LIMIT :length OFFSET :start"; |
|
281 | + $SELECT1 .= " LIMIT :length OFFSET :start"; |
|
282 | 282 | $ARGS1['length'] = $length; |
283 | 283 | $ARGS1['start'] = $start; |
284 | 284 | } |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | $full_path = WT_DATA_DIR . $media_folder . $media_path . $file; |
661 | 661 | try { |
662 | 662 | $size = filesize($full_path); |
663 | - $size = (int)(($size + 1023) / 1024); // Round up to next KB |
|
663 | + $size = (int) (($size + 1023) / 1024); // Round up to next KB |
|
664 | 664 | /* I18N: size of file in KB */ |
665 | 665 | $size = I18N::translate('%s KB', I18N::number($size)); |
666 | 666 | $html .= '<dt>' . I18N::translate('File size') . '</dt>'; |
@@ -55,15 +55,15 @@ discard block |
||
55 | 55 | |
56 | 56 | $this->checkIndividualAccess($individual); |
57 | 57 | |
58 | - $maximum_generations = (int)$tree->getPreference('MAX_DESCENDANCY_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
59 | - $default_generations = (int)$tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
58 | + $maximum_generations = (int) $tree->getPreference('MAX_DESCENDANCY_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
59 | + $default_generations = (int) $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
60 | 60 | |
61 | - $generations = (int)$request->get('generations', $default_generations); |
|
61 | + $generations = (int) $request->get('generations', $default_generations); |
|
62 | 62 | |
63 | 63 | $generations = min($generations, $maximum_generations); |
64 | 64 | $generations = max($generations, self::MINIMUM_GENERATIONS); |
65 | 65 | |
66 | - $show_spouse = (bool)$request->get('show_spouse'); |
|
66 | + $show_spouse = (bool) $request->get('show_spouse'); |
|
67 | 67 | |
68 | 68 | /* I18N: %s is an individual’s name */ |
69 | 69 | $title = I18N::translate('Hourglass chart of %s', $individual->getFullName()); |
@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | |
96 | 96 | $this->checkIndividualAccess($individual); |
97 | 97 | |
98 | - $maximum_generations = (int)$tree->getPreference('MAX_DESCENDANCY_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
99 | - $default_generations = (int)$tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
98 | + $maximum_generations = (int) $tree->getPreference('MAX_DESCENDANCY_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
99 | + $default_generations = (int) $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
100 | 100 | |
101 | - $generations = (int)$request->get('generations', $default_generations); |
|
101 | + $generations = (int) $request->get('generations', $default_generations); |
|
102 | 102 | $generations = min($generations, $maximum_generations); |
103 | 103 | $generations = max($generations, self::MINIMUM_GENERATIONS); |
104 | 104 | |
105 | - $show_spouse = (bool)$request->get('show_spouse'); |
|
105 | + $show_spouse = (bool) $request->get('show_spouse'); |
|
106 | 106 | |
107 | 107 | ob_start(); |
108 | 108 | $this->printDescendency($individual, 1, $generations, $show_spouse, true); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | return new Response(view('hourglass-chart', [ |
116 | 116 | 'descendants' => $descendants, |
117 | 117 | 'ancestors' => $ancestors, |
118 | - 'bhalfheight' => (int)(Theme::theme()->parameter('chart-box-y') / 2), |
|
118 | + 'bhalfheight' => (int) (Theme::theme()->parameter('chart-box-y') / 2), |
|
119 | 119 | ])); |
120 | 120 | } |
121 | 121 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | $this->checkIndividualAccess($individual); |
136 | 136 | |
137 | - $show_spouse = (bool)$request->get('show_spouse'); |
|
137 | + $show_spouse = (bool) $request->get('show_spouse'); |
|
138 | 138 | |
139 | 139 | ob_start(); |
140 | 140 | $this->printPersonPedigree($individual, 0, 1, $show_spouse); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $xref = $request->get('xref'); |
157 | 157 | $individual = Individual::getInstance($xref, $tree); |
158 | 158 | |
159 | - $show_spouse = (bool)$request->get('show_spouse'); |
|
159 | + $show_spouse = (bool) $request->get('show_spouse'); |
|
160 | 160 | |
161 | 161 | ob_start(); |
162 | 162 | $this->printDescendency($individual, 1, 2, $show_spouse, false); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | echo '<a href="' . e(route('hourglass', [ |
310 | 310 | 'xref' => $spouse->getXref(), |
311 | 311 | 'generations' => $generations, |
312 | - 'show_spouse' => (int)$show_spouse, |
|
312 | + 'show_spouse' => (int) $show_spouse, |
|
313 | 313 | 'ged' => $spouse->getTree()->getName(), |
314 | 314 | ])) . '" class="name1">' . $spouse->getFullName() . '</a>'; |
315 | 315 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | echo '<a href="' . e(route('hourglass', [ |
318 | 318 | 'xref' => $child->getXref(), |
319 | 319 | 'generations' => $generations, |
320 | - 'show_spouse' => (int)$show_spouse, |
|
320 | + 'show_spouse' => (int) $show_spouse, |
|
321 | 321 | 'ged' => $child->getTree()->getName(), |
322 | 322 | ])) . '" class="name1">' . $child->getFullName() . '</a>'; |
323 | 323 | } |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | echo '<a href="' . e(route('hourglass', [ |
333 | 333 | 'xref' => $husb->getXref(), |
334 | 334 | 'generations' => $generations, |
335 | - 'show_spouse' => (int)$show_spouse, |
|
335 | + 'show_spouse' => (int) $show_spouse, |
|
336 | 336 | 'ged' => $husb->getTree()->getName(), |
337 | 337 | ])) . '" class="name1">' . $husb->getFullName() . '</a>'; |
338 | 338 | } |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | echo '<a href="' . e(route('hourglass', [ |
342 | 342 | 'xref' => $wife->getXref(), |
343 | 343 | 'generations' => $generations, |
344 | - 'show_spouse' => (int)$show_spouse, |
|
344 | + 'show_spouse' => (int) $show_spouse, |
|
345 | 345 | 'ged' => $wife->getTree()->getName(), |
346 | 346 | ])) . '" class="name1">' . $wife->getFullName() . '</a>'; |
347 | 347 | } |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | echo '<a href="' . e(route('hourglass', [ |
361 | 361 | 'xref' => $child->getXref(), |
362 | 362 | 'generations' => $generations, |
363 | - 'show_spouse' => (int)$show_spouse, |
|
363 | + 'show_spouse' => (int) $show_spouse, |
|
364 | 364 | 'ged' => $child->getTree()->getName(), |
365 | 365 | ])) . '" class="name1">' . $child->getFullName() . '</a>'; |
366 | 366 | } |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | 'href' => '#', |
424 | 424 | 'data-route' => 'hourglass-add-asc', |
425 | 425 | 'data-xref' => $ARID, |
426 | - 'data-spouses' => (int)$show_spouse, |
|
426 | + 'data-spouses' => (int) $show_spouse, |
|
427 | 427 | 'data-tree' => $family->getHusband()->getTree()->getName(), |
428 | 428 | ]); |
429 | 429 | } |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | 'href' => '#', |
461 | 461 | 'data-route' => 'hourglass-add-asc', |
462 | 462 | 'data-xref' => $ARID, |
463 | - 'data-spouses' => (int)$show_spouse, |
|
463 | + 'data-spouses' => (int) $show_spouse, |
|
464 | 464 | 'data-tree' => $family->getWife()->getTree()->getName(), |
465 | 465 | ]); |
466 | 466 | } |
@@ -175,7 +175,7 @@ |
||
175 | 175 | 'words' => I18N::translate('Match the exact text, unless it occurs in the middle of a word.'), |
176 | 176 | 'wildcards' => I18N::translate('Use a “?” to match a single character, use “*” to match zero or more characters.'), |
177 | 177 | /* I18N: http://en.wikipedia.org/wiki/Regular_expression */ |
178 | - 'regex' => I18N::translate('Regular expressions are an advanced pattern matching technique.') . '<br>' . I18N::translate('See %s for more information.', '<a href="http://php.net/manual/regexp.reference.php">php.net/manual/regexp.reference.php</a>'), |
|
178 | + 'regex' => I18N::translate('Regular expressions are an advanced pattern matching technique.') . '<br>' . I18N::translate('See %s for more information.', '<a href="http://php.net/manual/regexp.reference.php">php.net/manual/regexp.reference.php</a>'), |
|
179 | 179 | ]; |
180 | 180 | |
181 | 181 | return |
@@ -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 | /** |
@@ -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')); |