@@ -190,7 +190,7 @@ |
||
| 190 | 190 | */ |
| 191 | 191 | public function getShortName() |
| 192 | 192 | { |
| 193 | - $SHOW_PEDIGREE_PLACES = (int)$this->tree->getPreference('SHOW_PEDIGREE_PLACES'); |
|
| 193 | + $SHOW_PEDIGREE_PLACES = (int) $this->tree->getPreference('SHOW_PEDIGREE_PLACES'); |
|
| 194 | 194 | |
| 195 | 195 | if ($SHOW_PEDIGREE_PLACES >= \count($this->gedcom_place)) { |
| 196 | 196 | // A short place name - no need to abbreviate |
@@ -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>'; |
@@ -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 | } |