@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | public function reorderChildrenAction(Request $request, Tree $tree): Response |
| 63 | 63 | { |
| 64 | 64 | $xref = $request->get('xref'); |
| 65 | - $order = (array)$request->get('order', []); |
|
| 65 | + $order = (array) $request->get('order', []); |
|
| 66 | 66 | $family = Family::getInstance($xref, $tree); |
| 67 | 67 | |
| 68 | 68 | $this->checkFamilyAccess($family, true); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $this->checkFamilyAccess($family, true); |
| 139 | 139 | |
| 140 | 140 | $PEDI = $request->get('PEDI', ''); |
| 141 | - $keep_chan = (bool)$request->get('keep_chan'); |
|
| 141 | + $keep_chan = (bool) $request->get('keep_chan'); |
|
| 142 | 142 | |
| 143 | 143 | $this->glevels = $request->get('glevels', []); |
| 144 | 144 | $this->tag = $request->get('tag', []); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | $gedrec .= "\n" . GedcomCodePedi::createNewFamcPedi($PEDI, $xref); |
| 158 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 158 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 159 | 159 | $gedrec = $this->handleUpdates($gedrec); |
| 160 | 160 | } else { |
| 161 | 161 | $gedrec = $this->updateRest($gedrec); |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 256 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 257 | 257 | $gedrec = $this->handleUpdates($gedrec); |
| 258 | 258 | } else { |
| 259 | 259 | $gedrec = $this->updateRest($gedrec); |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | $famrec .= $this->addNewFact($request, $tree, $match); |
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | - if ((bool)$request->get('SOUR_FAM')) { |
|
| 276 | + if ((bool) $request->get('SOUR_FAM')) { |
|
| 277 | 277 | $famrec = $this->handleUpdates($famrec); |
| 278 | 278 | } else { |
| 279 | 279 | $famrec = $this->updateRest($famrec); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | public function reorderMediaAction(Request $request, Tree $tree): Response |
| 63 | 63 | { |
| 64 | 64 | $xref = $request->get('xref'); |
| 65 | - $order = (array)$request->get('order', []); |
|
| 65 | + $order = (array) $request->get('order', []); |
|
| 66 | 66 | $individual = Individual::getInstance($xref, $tree); |
| 67 | 67 | |
| 68 | 68 | $this->checkIndividualAccess($individual, true); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | public function reorderNamesAction(Request $request, Tree $tree): Response |
| 124 | 124 | { |
| 125 | 125 | $xref = $request->get('xref'); |
| 126 | - $order = (array)$request->get('order', []); |
|
| 126 | + $order = (array) $request->get('order', []); |
|
| 127 | 127 | $individual = Individual::getInstance($xref, $tree); |
| 128 | 128 | |
| 129 | 129 | $this->checkIndividualAccess($individual, true); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | public function reorderSpousesAction(Request $request, Tree $tree): Response |
| 185 | 185 | { |
| 186 | 186 | $xref = $request->get('xref'); |
| 187 | - $order = (array)$request->get('order', []); |
|
| 187 | + $order = (array) $request->get('order', []); |
|
| 188 | 188 | $individual = Individual::getInstance($xref, $tree); |
| 189 | 189 | |
| 190 | 190 | $this->checkIndividualAccess($individual, true); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | $gedcom .= $this->addNewFact($request, $tree, $match); |
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 294 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 295 | 295 | $gedcom = $this->handleUpdates($gedcom); |
| 296 | 296 | } else { |
| 297 | 297 | $gedcom = $this->updateRest($gedcom); |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | $gedcom .= $this->addNewFact($request, $tree, $match); |
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 386 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 387 | 387 | $gedcom = $this->handleUpdates($gedcom); |
| 388 | 388 | } else { |
| 389 | 389 | $gedcom = $this->updateRest($gedcom); |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | */ |
| 417 | 417 | public function addSpouse(Request $request, Tree $tree): Response |
| 418 | 418 | { |
| 419 | - $xref = $request->get('xref', ''); |
|
| 419 | + $xref = $request->get('xref', ''); |
|
| 420 | 420 | |
| 421 | 421 | $individual = Individual::getInstance($xref, $tree); |
| 422 | 422 | |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | $indi_gedcom .= $this->addNewFact($request, $tree, $match); |
| 475 | 475 | } |
| 476 | 476 | } |
| 477 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 477 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 478 | 478 | $indi_gedcom = $this->handleUpdates($indi_gedcom); |
| 479 | 479 | } else { |
| 480 | 480 | $indi_gedcom = $this->updateRest($indi_gedcom); |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $fam_gedcom .= $this->addNewFact($request, $tree, $match); |
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | - if ((bool)$request->get('SOUR_FAM')) { |
|
| 489 | + if ((bool) $request->get('SOUR_FAM')) { |
|
| 490 | 490 | $fam_gedcom = $this->handleUpdates($fam_gedcom); |
| 491 | 491 | } else { |
| 492 | 492 | $fam_gedcom = $this->updateRest($fam_gedcom); |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | $gedrec .= $this->addNewFact($request, $tree, $match); |
| 561 | 561 | } |
| 562 | 562 | } |
| 563 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 563 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 564 | 564 | $gedrec = $this->handleUpdates($gedrec); |
| 565 | 565 | } else { |
| 566 | 566 | $gedrec = $this->updateRest($gedrec); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | // Construct from an array (of three gedcom-style strings: "1900", "FEB", "4") |
| 109 | 109 | if (is_array($date)) { |
| 110 | - $this->d = (int)$date[2]; |
|
| 110 | + $this->d = (int) $date[2]; |
|
| 111 | 111 | if (array_key_exists($date[1], static::$MONTH_ABBREV)) { |
| 112 | 112 | $this->m = static::$MONTH_ABBREV[$date[1]]; |
| 113 | 113 | } else { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $jd = $date->calendar->ymdToJd($today[0], $date->m, $date->d == 0 ? $today[2] : $date->d); |
| 155 | 155 | } else { |
| 156 | 156 | // Complete date |
| 157 | - $jd = (int)(($date->maxJD + $date->minJD) / 2); |
|
| 157 | + $jd = (int) (($date->maxJD + $date->minJD) / 2); |
|
| 158 | 158 | } |
| 159 | 159 | list($this->y, $this->m, $this->d) = $this->calendar->jdToYmd($jd); |
| 160 | 160 | // New date has same precision as original date |
@@ -961,7 +961,7 @@ discard block |
||
| 961 | 961 | { |
| 962 | 962 | if ($number < 1) { |
| 963 | 963 | // Cannot convert zero/negative numbers |
| 964 | - return (string)$number; |
|
| 964 | + return (string) $number; |
|
| 965 | 965 | } |
| 966 | 966 | $roman = ''; |
| 967 | 967 | foreach (self::$roman_numerals as $key => $value) { |
@@ -986,7 +986,7 @@ discard block |
||
| 986 | 986 | $num = 0; |
| 987 | 987 | foreach (self::$roman_numerals as $key => $value) { |
| 988 | 988 | if (strpos($roman, $value) === 0) { |
| 989 | - $num += $key; |
|
| 989 | + $num += $key; |
|
| 990 | 990 | $roman = substr($roman, strlen($value)); |
| 991 | 991 | } |
| 992 | 992 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | $calendar_service = new CalendarService(); |
| 70 | 70 | |
| 71 | - $days = (int)$this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); |
|
| 71 | + $days = (int) $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); |
|
| 72 | 72 | $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_STYLE); |
| 73 | 73 | $calendar = $this->getBlockSetting($block_id, 'calendar', self::DEFAULT_CALENDAR); |
| 74 | 74 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | $yahrzeit_date = new Date($yahrzeit_date->format('%@ %A %O %E')); |
| 124 | 124 | |
| 125 | - $yahrzeits[] = (object)[ |
|
| 125 | + $yahrzeits[] = (object) [ |
|
| 126 | 126 | 'individual' => $fact->getParent(), |
| 127 | 127 | 'fact_date' => $fact->getDate(), |
| 128 | 128 | 'fact' => $fact, |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $default_events = implode(',', self::DEFAULT_EVENTS); |
| 119 | 119 | |
| 120 | 120 | $days = $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); |
| 121 | - $filter = (bool)$this->getBlockSetting($block_id, 'filter', self::DEFAULT_FILTER); |
|
| 121 | + $filter = (bool) $this->getBlockSetting($block_id, 'filter', self::DEFAULT_FILTER); |
|
| 122 | 122 | $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_STYLE); |
| 123 | 123 | $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', self::DEFAULT_SORT); |
| 124 | 124 | $events = $this->getBlockSetting($block_id, 'events', $default_events); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $events_filter = implode('|', $event_array); |
| 137 | 137 | |
| 138 | 138 | $startjd = WT_CLIENT_JD + 1; |
| 139 | - $endjd = WT_CLIENT_JD + (int)$days; |
|
| 139 | + $endjd = WT_CLIENT_JD + (int) $days; |
|
| 140 | 140 | |
| 141 | 141 | $facts = $calendar_service->getEventsList($startjd, $endjd, $events_filter, $filter, $sortStyle, $tree); |
| 142 | 142 | |
@@ -294,7 +294,7 @@ |
||
| 294 | 294 | public static function getAll(): array |
| 295 | 295 | { |
| 296 | 296 | if (empty(self::$trees)) { |
| 297 | - $rows = Database::prepare( |
|
| 297 | + $rows = Database::prepare( |
|
| 298 | 298 | "SELECT g.gedcom_id AS tree_id, g.gedcom_name AS tree_name, gs1.setting_value AS tree_title" . |
| 299 | 299 | " FROM `##gedcom` g" . |
| 300 | 300 | " LEFT JOIN `##gedcom_setting` gs1 ON (g.gedcom_id=gs1.gedcom_id AND gs1.setting_name='title')" . |
@@ -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( |