@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | { |
61 | 61 | $this->checkModuleIsActive($tree, 'timeline_chart'); |
62 | 62 | |
63 | - $scale = (int)$request->get('scale', self::SCALE_DEFAULT); |
|
63 | + $scale = (int) $request->get('scale', self::SCALE_DEFAULT); |
|
64 | 64 | $scale = min($scale, self::SCALE_MAX); |
65 | 65 | $scale = max($scale, self::SCALE_MIN); |
66 | 66 | |
67 | - $xrefs = (array)$request->get('xrefs', []); |
|
67 | + $xrefs = (array) $request->get('xrefs', []); |
|
68 | 68 | $xrefs = array_unique($xrefs); |
69 | 69 | $xrefs = array_filter($xrefs, function (string $xref) use ($tree): bool { |
70 | 70 | $individual = Individual::getInstance($xref, $tree); |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | |
101 | 101 | $zoom_in_url = route('timeline', [ |
102 | 102 | 'ged' => $tree->getName(), |
103 | - 'scale' => min(self::SCALE_MAX, $scale + (int)($scale * 0.2 + 1)), |
|
103 | + 'scale' => min(self::SCALE_MAX, $scale + (int) ($scale * 0.2 + 1)), |
|
104 | 104 | 'xrefs' => $xrefs, |
105 | 105 | ]); |
106 | 106 | |
107 | 107 | $zoom_out_url = route('timeline', [ |
108 | 108 | 'route' => 'timeline', |
109 | 109 | 'ged' => $tree->getName(), |
110 | - 'scale' => max(self::SCALE_MIN, $scale - (int)($scale * 0.2 + 1)), |
|
110 | + 'scale' => max(self::SCALE_MIN, $scale - (int) ($scale * 0.2 + 1)), |
|
111 | 111 | 'xrefs' => $xrefs, |
112 | 112 | ]); |
113 | 113 | |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | { |
133 | 133 | $this->checkModuleIsActive($tree, 'timeline_chart'); |
134 | 134 | |
135 | - $scale = (int)$request->get('scale', self::SCALE_DEFAULT); |
|
135 | + $scale = (int) $request->get('scale', self::SCALE_DEFAULT); |
|
136 | 136 | $scale = min($scale, self::SCALE_MAX); |
137 | 137 | $scale = max($scale, self::SCALE_MIN); |
138 | 138 | |
139 | - $xrefs = (array)$request->get('xrefs', []); |
|
139 | + $xrefs = (array) $request->get('xrefs', []); |
|
140 | 140 | $xrefs = array_unique($xrefs); |
141 | 141 | |
142 | 142 | /** @var Individual[] $individuals */ |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | return $individual !== null && $individual->canShow(); |
149 | 149 | }); |
150 | 150 | |
151 | - $baseyear = (int)date('Y'); |
|
151 | + $baseyear = (int) date('Y'); |
|
152 | 152 | $topyear = 0; |
153 | 153 | $indifacts = []; |
154 | 154 | $birthyears = []; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $topyear = max($topyear, $date->y); |
184 | 184 | |
185 | 185 | if (!$individual->isDead()) { |
186 | - $topyear = max($topyear, (int)date('Y')); |
|
186 | + $topyear = max($topyear, (int) date('Y')); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | // do not add the same fact twice (prevents marriages from being added multiple times) |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | if ($scale === 0) { |
199 | - $scale = (int)(($topyear - $baseyear) / 20 * count($indifacts) / 4); |
|
199 | + $scale = (int) (($topyear - $baseyear) / 20 * count($indifacts) / 4); |
|
200 | 200 | if ($scale < 6) { |
201 | 201 | $scale = 6; |
202 | 202 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | { |
74 | 74 | $latest_version = $this->fetchLatestVersion(); |
75 | 75 | |
76 | - list(, , $url) = explode('|', $latest_version . '||'); |
|
76 | + list(,, $url) = explode('|', $latest_version . '||'); |
|
77 | 77 | |
78 | 78 | return $url; |
79 | 79 | } |
@@ -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 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | |
73 | 73 | extract($cfg, EXTR_OVERWRITE); |
74 | 74 | |
75 | - // Use the count of base surnames. |
|
75 | + // Use the count of base surnames. |
|
76 | 76 | $top_surnames = Database::prepare( |
77 | 77 | "SELECT n_surn FROM `##name`" . |
78 | 78 | " WHERE n_file = :tree_id AND n_type != '_MARNM' AND n_surn NOT IN ('@N.N.', '')" . |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | Log::addAuthenticationLog('Password request was sent to user: ' . $user->getUserName()); |
71 | 71 | |
72 | - $sender = new User((object)[ |
|
72 | + $sender = new User((object) [ |
|
73 | 73 | 'user_id' => null, |
74 | 74 | 'user_name' => '', |
75 | 75 | 'real_name' => $tree->getTitle(), |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $max = strlen($passchars) - 1; |
105 | 105 | |
106 | 106 | for ($i = 0; $i < 8; $i++) { |
107 | - $index = random_int(0, $max); |
|
107 | + $index = random_int(0, $max); |
|
108 | 108 | $password .= $passchars{$index}; |
109 | 109 | } |
110 | 110 |
@@ -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>'; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | define('WT_LOCALE', I18N::init('en-US')); |
49 | 49 | |
50 | - $step = (int)$request->get('step', '1'); |
|
50 | + $step = (int) $request->get('step', '1'); |
|
51 | 51 | $errors = $this->serverErrors(); |
52 | 52 | $warnings = $this->serverWarnings(); |
53 | 53 | $data = $this->extractParameters($request); |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | */ |
365 | 365 | private function maxExecutionTime(): int |
366 | 366 | { |
367 | - return (int)ini_get('max_execution_time'); |
|
367 | + return (int) ini_get('max_execution_time'); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | $memory_limit = $memory_limit / 1024 / 1024; |
398 | 398 | } |
399 | 399 | |
400 | - return (int)$memory_limit; |
|
400 | + return (int) $memory_limit; |
|
401 | 401 | } |
402 | 402 | |
403 | 403 | /** |
@@ -454,11 +454,11 @@ discard block |
||
454 | 454 | /* I18N: a program feature */ |
455 | 455 | 'simplexml' => I18N::translate('reporting'), |
456 | 456 | ]; |
457 | - $settings = [ |
|
457 | + $settings = [ |
|
458 | 458 | /* I18N: a program feature */ |
459 | 459 | 'file_uploads' => I18N::translate('file upload capability'), |
460 | 460 | ]; |
461 | - $warnings = []; |
|
461 | + $warnings = []; |
|
462 | 462 | |
463 | 463 | foreach ($extensions as $extension => $features) { |
464 | 464 | if (!extension_loaded($extension)) { |