@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | if ($islink) { |
| 527 | 527 | $value = trim($value, '@'); |
| 528 | 528 | } else { |
| 529 | - $value = (string)substr($tag, \strlen($fact) + 3); |
|
| 529 | + $value = (string) substr($tag, \strlen($fact) + 3); |
|
| 530 | 530 | } |
| 531 | 531 | if ($fact === 'REPO' || $fact === 'SOUR' || $fact === 'OBJE' || $fact === 'FAMC') { |
| 532 | 532 | $islink = true; |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | $html .= '<p class="small text-muted">' . I18N::translate('Use this image for charts and on the individual’s page.') . '</p>'; |
| 812 | 812 | } elseif ($fact === 'TYPE' && $level === '3') { |
| 813 | 813 | //-- Build the selector for the Media 'TYPE' Fact |
| 814 | - $html .= '<select name="text[]"><option selected value="" ></option>'; |
|
| 814 | + $html .= '<select name="text[]"><option selected value="" ></option>'; |
|
| 815 | 815 | $selectedValue = strtolower($value); |
| 816 | 816 | if (!array_key_exists($selectedValue, GedcomTag::getFileFormTypes())) { |
| 817 | 817 | $html .= '<option selected value="' . e($value) . '" >' . e($value) . '</option>'; |
@@ -176,14 +176,14 @@ discard block |
||
| 176 | 176 | case '_BIRT_CHIL': |
| 177 | 177 | $children[$fact->getParent()->getXref()] = true; |
| 178 | 178 | /* I18N: Abbreviation for "number %s" */ |
| 179 | - $label .= '<br>' . I18N::translate('#%s', \count($children)); |
|
| 179 | + $label .= '<br>' . I18N::translate('#%s', \count($children)); |
|
| 180 | 180 | break; |
| 181 | 181 | case '_BIRT_GCHI': |
| 182 | 182 | case '_BIRT_GCH1': |
| 183 | 183 | case '_BIRT_GCH2': |
| 184 | 184 | $grandchildren[$fact->getParent()->getXref()] = true; |
| 185 | 185 | /* I18N: Abbreviation for "number %s" */ |
| 186 | - $label .= '<br>' . I18N::translate('#%s', \count($grandchildren)); |
|
| 186 | + $label .= '<br>' . I18N::translate('#%s', \count($grandchildren)); |
|
| 187 | 187 | break; |
| 188 | 188 | } |
| 189 | 189 | |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | for ($j = 0; $j < $ct; $j++) { |
| 578 | 578 | if (strpos($match[$j][1], '@') === false) { |
| 579 | 579 | $source = e($match[$j][1] . preg_replace('/\n\d CONT ?/', "\n", $match[$j][2])); |
| 580 | - $data .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $tree) . '</span></div>'; |
|
| 580 | + $data .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $tree) . '</span></div>'; |
|
| 581 | 581 | } |
| 582 | 582 | } |
| 583 | 583 | // Find source for each fact |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | } |
| 596 | 596 | $srec = substr($factrec, $spos1, $spos2 - $spos1); |
| 597 | 597 | $lt = preg_match_all("/$nlevel \w+/", $srec, $matches); |
| 598 | - $data .= '<div class="fact_SOUR">'; |
|
| 598 | + $data .= '<div class="fact_SOUR">'; |
|
| 599 | 599 | $elementID = Uuid::uuid4()->toString(); |
| 600 | 600 | if ($tree->getPreference('EXPAND_SOURCES')) { |
| 601 | 601 | $plusminus = 'icon-minus'; |
@@ -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 | } |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | $count_logged_in = \count($logged_in); |
| 68 | - $content .= '<div class="logged_in_count">'; |
|
| 68 | + $content .= '<div class="logged_in_count">'; |
|
| 69 | 69 | if ($anonymous) { |
| 70 | 70 | $content .= I18N::plural('%s anonymous signed-in user', '%s anonymous signed-in users', $anonymous, I18N::number($anonymous)); |
| 71 | 71 | if ($count_logged_in) { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | // Only show this block for certain languages |
| 118 | 118 | $languages = $this->getBlockSetting($block_id, 'languages', ''); |
| 119 | 119 | if ($languages === '' || \in_array(WT_LOCALE, explode(',', $languages))) { |
| 120 | - $stories[] = (object)[ |
|
| 120 | + $stories[] = (object) [ |
|
| 121 | 121 | 'block_id' => $block_id, |
| 122 | 122 | 'title' => $this->getBlockSetting($block_id, 'title'), |
| 123 | 123 | 'story_body' => $this->getBlockSetting($block_id, 'story_body'), |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | { |
| 213 | 213 | $this->layout = 'layouts/administration'; |
| 214 | 214 | |
| 215 | - $block_id = (int)$request->get('block_id'); |
|
| 215 | + $block_id = (int) $request->get('block_id'); |
|
| 216 | 216 | |
| 217 | 217 | if ($block_id === 0) { |
| 218 | 218 | // Creating a new story |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | public function postAdminEditAction(Request $request, Tree $tree): RedirectResponse |
| 259 | 259 | { |
| 260 | - $block_id = (int)$request->get('block_id'); |
|
| 260 | + $block_id = (int) $request->get('block_id'); |
|
| 261 | 261 | $xref = $request->get('xref', ''); |
| 262 | 262 | $story_body = $request->get('story_body', ''); |
| 263 | 263 | $story_title = $request->get('story_title', ''); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | */ |
| 304 | 304 | public function postAdminDeleteAction(Request $request, Tree $tree): Response |
| 305 | 305 | { |
| 306 | - $block_id = (int)$request->get('block_id'); |
|
| 306 | + $block_id = (int) $request->get('block_id'); |
|
| 307 | 307 | |
| 308 | 308 | Database::prepare( |
| 309 | 309 | "DELETE FROM `##block_setting` WHERE block_id = :block_id" |
@@ -280,7 +280,7 @@ |
||
| 280 | 280 | { |
| 281 | 281 | $nchi = \count($this->getChildren()); |
| 282 | 282 | foreach ($this->getFacts('NCHI') as $fact) { |
| 283 | - $nchi = max($nchi, (int)$fact->getValue()); |
|
| 283 | + $nchi = max($nchi, (int) $fact->getValue()); |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | return $nchi; |
@@ -160,8 +160,8 @@ |
||
| 160 | 160 | $html = ''; |
| 161 | 161 | foreach ($options as $value => $option) { |
| 162 | 162 | $option_attributes = self::attributes([ |
| 163 | - 'value' => $value, |
|
| 164 | - 'selected' => \in_array((string)$value, $selected), |
|
| 163 | + 'value' => $value, |
|
| 164 | + 'selected' => \in_array((string)$value, $selected), |
|
| 165 | 165 | ]); |
| 166 | 166 | |
| 167 | 167 | $html .= '<option ' . $option_attributes . '>' . e($option) . '</option>'; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | 'type' => 'radio', |
| 101 | 101 | 'name' => $name, |
| 102 | 102 | 'value' => $value, |
| 103 | - 'checked' => (string)$value === (string)$selected, |
|
| 103 | + 'checked' => (string) $value === (string) $selected, |
|
| 104 | 104 | ] + $attributes); |
| 105 | 105 | |
| 106 | 106 | $html .= |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | foreach ($options as $value => $option) { |
| 130 | 130 | $option_attributes = self::attributes([ |
| 131 | 131 | 'value' => $value, |
| 132 | - 'selected' => (string)$value === (string)$selected, |
|
| 132 | + 'selected' => (string) $value === (string) $selected, |
|
| 133 | 133 | ]); |
| 134 | 134 | |
| 135 | 135 | $html .= '<option ' . $option_attributes . '>' . e($option) . '</option>'; |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | foreach ($options as $value => $option) { |
| 162 | 162 | $option_attributes = self::attributes([ |
| 163 | 163 | 'value' => $value, |
| 164 | - 'selected' => \in_array((string)$value, $selected), |
|
| 164 | + 'selected' => \in_array((string) $value, $selected), |
|
| 165 | 165 | ]); |
| 166 | 166 | |
| 167 | 167 | $html .= '<option ' . $option_attributes . '>' . e($option) . '</option>'; |
@@ -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 | } |