@@ -327,9 +327,9 @@ |
||
327 | 327 | |
328 | 328 | // Now fetch these anniversaries |
329 | 329 | foreach ([ |
330 | - 'INDI' => $ind_sql . $where . $order_by, |
|
331 | - 'FAM' => $fam_sql . $where . $order_by, |
|
332 | - ] as $type => $sql) { |
|
330 | + 'INDI' => $ind_sql . $where . $order_by, |
|
331 | + 'FAM' => $fam_sql . $where . $order_by, |
|
332 | + ] as $type => $sql) { |
|
333 | 333 | $rows = Database::prepare($sql)->execute($args)->fetchAll(); |
334 | 334 | foreach ($rows as $row) { |
335 | 335 | if ($type === 'INDI') { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | "SELECT DISTINCT f_id AS xref, f_gedcom AS gedcom, d_type, d_day, d_month, d_year, d_fact" . |
184 | 184 | " FROM `##dates` JOIN `##families` ON d_gid = f_id AND d_file = f_file" . |
185 | 185 | " WHERE d_type = :type AND d_file = :tree_id"; |
186 | - $args = [ |
|
186 | + $args = [ |
|
187 | 187 | 'type' => $anniv->format('%@'), |
188 | 188 | 'tree_id' => $tree->getTreeId(), |
189 | 189 | ]; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $where .= " AND d_day = :day"; |
214 | 214 | $args['day'] = $anniv->d; |
215 | 215 | } |
216 | - $where .= " AND d_mon = :month"; |
|
216 | + $where .= " AND d_mon = :month"; |
|
217 | 217 | $args['month'] = $anniv->m; |
218 | 218 | } else { |
219 | 219 | // SPECIAL CASES: |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | } elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) { |
228 | 228 | $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2"; |
229 | 229 | } else { |
230 | - $where .= " AND d_day = :day AND d_mon = 2"; |
|
230 | + $where .= " AND d_day = :day AND d_mon = 2"; |
|
231 | 231 | $args['day'] = $anniv->d; |
232 | 232 | } |
233 | 233 | break; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | } elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) { |
251 | 251 | $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3"; |
252 | 252 | } else { |
253 | - $where .= " AND d_day = :day AND d_mon = 3"; |
|
253 | + $where .= " AND d_day = :day AND d_mon = 3"; |
|
254 | 254 | $args['day'] = $anniv->d; |
255 | 255 | } |
256 | 256 | break; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | } |
306 | 306 | } |
307 | 307 | // Only events in the past (includes dates without a year) |
308 | - $where .= " AND d_year <= :year"; |
|
308 | + $where .= " AND d_year <= :year"; |
|
309 | 309 | $args['year'] = $anniv->y; |
310 | 310 | |
311 | 311 | if ($facts) { |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | // Fixing the width for td to the box initial width when the person is the root person fix a rare bug that happen when a person without child and without known parents is the root person : an unwanted white rectangle appear at the right of the person’s boxes, otherwise. |
255 | 255 | $html .= '<td' . ($isRoot ? ' style="width:1px"' : '') . '><div class="tv_box' . ($isRoot ? ' rootPerson' : '') . '" dir="' . I18N::direction() . '" style="text-align: ' . (I18N::direction() === 'rtl' ? 'right' : 'left') . '; direction: ' . I18N::direction() . '" abbr="' . $person->getXref() . '" onclick="' . $this->name . 'Handler.expandBox(this, event);">'; |
256 | 256 | $html .= $this->drawPersonName($person); |
257 | - $fop = []; // $fop is fathers of partners |
|
257 | + $fop = []; // $fop is fathers of partners |
|
258 | 258 | if ($partner !== null) { |
259 | 259 | $dashed = ''; |
260 | 260 | foreach ($person->getSpouseFamilies() as $family) { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $spouse_parents, |
273 | 273 | ]; |
274 | 274 | } |
275 | - $html .= $this->drawPersonName($spouse, $dashed); |
|
275 | + $html .= $this->drawPersonName($spouse, $dashed); |
|
276 | 276 | $dashed = 'dashed'; |
277 | 277 | } |
278 | 278 | } |
@@ -292,9 +292,9 @@ discard block |
||
292 | 292 | /* draw the parents */ |
293 | 293 | if ($state >= 0 && (!empty($parent) || count($fop))) { |
294 | 294 | $unique = (empty($parent) || count($fop) == 0); |
295 | - $html .= '<td align="left"><table class="tv_tree"><tbody>'; |
|
295 | + $html .= '<td align="left"><table class="tv_tree"><tbody>'; |
|
296 | 296 | if (!empty($parent)) { |
297 | - $u = $unique ? 'c' : 't'; |
|
297 | + $u = $unique ? 'c' : 't'; |
|
298 | 298 | $html .= '<tr><td ' . ($gen == 0 ? ' abbr="p' . $primaryChildFamily->getXref() . '@' . $u . '"' : '') . '>'; |
299 | 299 | $html .= $this->drawPerson($parent, $gen - 1, 1, $primaryChildFamily, $u); |
300 | 300 | $html .= '</td></tr>'; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $nb = count($fop); |
305 | 305 | foreach ($fop as $p) { |
306 | 306 | $n++; |
307 | - $u = $unique ? 'c' : ($n == $nb || empty($p[1]) ? 'b' : 'h'); |
|
307 | + $u = $unique ? 'c' : ($n == $nb || empty($p[1]) ? 'b' : 'h'); |
|
308 | 308 | $html .= '<tr><td ' . ($gen == 0 ? ' abbr="p' . $p[1]->getXref() . '@' . $u . '"' : '') . '>' . $this->drawPerson($p[0], $gen - 1, 1, $p[1], $u) . '</td></tr>'; |
309 | 309 | } |
310 | 310 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | if ($changes === '1' && $sendmail === '1') { |
75 | 75 | // There are pending changes - tell moderators/managers/administrators about them. |
76 | - if (WT_TIMESTAMP - (int)Site::getPreference('LAST_CHANGE_EMAIL') > (60 * 60 * 24 * $days)) { |
|
76 | + if (WT_TIMESTAMP - (int) Site::getPreference('LAST_CHANGE_EMAIL') > (60 * 60 * 24 * $days)) { |
|
77 | 77 | // Which users have pending changes? |
78 | 78 | foreach (User::all() as $user) { |
79 | 79 | if ($user->getPreference('contactmethod') !== 'none') { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | I18N::init($user->getPreference('language')); |
83 | 83 | |
84 | 84 | $sender = new User( |
85 | - (object)[ |
|
85 | + (object) [ |
|
86 | 86 | 'user_id' => null, |
87 | 87 | 'user_name' => '', |
88 | 88 | 'real_name' => $tmp_tree->getTitle(), |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | if ($sendmail === '1') { |
121 | 121 | $content .= I18N::translate('Last email reminder was sent ') . FunctionsDate::formatTimestamp(Site::getPreference('LAST_CHANGE_EMAIL')) . '<br>'; |
122 | - $content .= I18N::translate('Next email reminder will be sent after ') . FunctionsDate::formatTimestamp((int)Site::getPreference('LAST_CHANGE_EMAIL') + (60 * 60 * 24 * $days)) . '<br><br>'; |
|
122 | + $content .= I18N::translate('Next email reminder will be sent after ') . FunctionsDate::formatTimestamp((int) Site::getPreference('LAST_CHANGE_EMAIL') + (60 * 60 * 24 * $days)) . '<br><br>'; |
|
123 | 123 | } |
124 | 124 | $content .= '<ul>'; |
125 | 125 | $changes = Database::prepare( |
@@ -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 | /* 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): string |
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 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | */ |
63 | 63 | private function significant(Family $family): stdClass |
64 | 64 | { |
65 | - $significant = (object)[ |
|
65 | + $significant = (object) [ |
|
66 | 66 | 'family' => $family, |
67 | 67 | 'individual' => null, |
68 | 68 | 'surname' => '', |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | private function validContacts(Tree $tree): array |
329 | 329 | { |
330 | 330 | $contacts = [ |
331 | - User::find((int)$tree->getPreference('CONTACT_USER_ID')), |
|
332 | - User::find((int)$tree->getPreference('WEBMASTER_USER_ID')), |
|
331 | + User::find((int) $tree->getPreference('CONTACT_USER_ID')), |
|
332 | + User::find((int) $tree->getPreference('WEBMASTER_USER_ID')), |
|
333 | 333 | ]; |
334 | 334 | |
335 | 335 | return array_filter($contacts); |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | { |
354 | 354 | // Create a dummy user, so we can send messages from the tree. |
355 | 355 | $from = new User( |
356 | - (object)[ |
|
356 | + (object) [ |
|
357 | 357 | 'user_id' => null, |
358 | 358 | 'user_name' => '', |
359 | 359 | 'real_name' => $tree->getTitle(), |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | |
364 | 364 | // Create a dummy user, so we can reply to visitors. |
365 | 365 | $sender = new User( |
366 | - (object)[ |
|
366 | + (object) [ |
|
367 | 367 | 'user_id' => null, |
368 | 368 | 'user_name' => '', |
369 | 369 | 'real_name' => $sender_name, |
@@ -448,7 +448,7 @@ |
||
448 | 448 | */ |
449 | 449 | public function julianDay(): int |
450 | 450 | { |
451 | - return (int)(($this->minimumJulianDay() + $this->maximumJulianDay()) / 2); |
|
451 | + return (int) (($this->minimumJulianDay() + $this->maximumJulianDay()) / 2); |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | /** |
@@ -88,8 +88,7 @@ discard block |
||
88 | 88 | self::$table_prefix = $config['tblpfx']; |
89 | 89 | |
90 | 90 | $dsn = (substr($config['dbhost'], 0, 1) === '/' ? |
91 | - "mysql:unix_socket='{$config['dbhost']};dbname={$config['dbname']}" : |
|
92 | - "mysql:host={$config['dbhost']};dbname={$config['dbname']};port={$config['dbport']}" |
|
91 | + "mysql:unix_socket='{$config['dbhost']};dbname={$config['dbname']}" : "mysql:host={$config['dbhost']};dbname={$config['dbname']};port={$config['dbport']}" |
|
93 | 92 | ); |
94 | 93 | |
95 | 94 | // Create the underlying PDO object. |
@@ -222,7 +221,7 @@ discard block |
||
222 | 221 | public static function updateSchema($namespace, $schema_name, $target_version): bool |
223 | 222 | { |
224 | 223 | try { |
225 | - $current_version = (int)Site::getPreference($schema_name); |
|
224 | + $current_version = (int) Site::getPreference($schema_name); |
|
226 | 225 | } catch (PDOException $ex) { |
227 | 226 | DebugBar::addThrowable($ex); |
228 | 227 | |
@@ -239,7 +238,7 @@ discard block |
||
239 | 238 | $migration = new $class(); |
240 | 239 | $migration->upgrade(); |
241 | 240 | $current_version++; |
242 | - Site::setPreference($schema_name, (string)$current_version); |
|
241 | + Site::setPreference($schema_name, (string) $current_version); |
|
243 | 242 | $updates_applied = true; |
244 | 243 | } |
245 | 244 |
@@ -97,7 +97,7 @@ |
||
97 | 97 | */ |
98 | 98 | private function isChild(Individual $individual): bool |
99 | 99 | { |
100 | - $age = (int)Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); |
|
100 | + $age = (int) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); |
|
101 | 101 | |
102 | 102 | return $age < $this->age_adult; |
103 | 103 | } |