@@ -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 | } |
@@ -34,6 +34,6 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function generate(Individual $individual, Individual $head): string |
| 36 | 36 | { |
| 37 | - return (string)Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); |
|
| 37 | + return (string) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $this->pageh = $tmpw; |
| 146 | 146 | } |
| 147 | 147 | // Store the pagewidth without margins |
| 148 | - $this->noMarginWidth = (int)($this->pagew - $this->leftmargin - $this->rightmargin); |
|
| 148 | + $this->noMarginWidth = (int) ($this->pagew - $this->leftmargin - $this->rightmargin); |
|
| 149 | 149 | // If RTL |
| 150 | 150 | if ($this->rtl) { |
| 151 | 151 | $this->alignRTL = 'right'; |
@@ -727,14 +727,14 @@ discard block |
||
| 727 | 727 | public function textWrap($str, $width): string |
| 728 | 728 | { |
| 729 | 729 | // Calculate the line width |
| 730 | - $lw = (int)($width / ($this->getCurrentStyleHeight() / 2)); |
|
| 730 | + $lw = (int) ($width / ($this->getCurrentStyleHeight() / 2)); |
|
| 731 | 731 | // Wordwrap each line |
| 732 | 732 | $lines = explode("\n", $str); |
| 733 | 733 | // Line Feed counter |
| 734 | 734 | $lfct = count($lines); |
| 735 | 735 | $wraptext = ''; |
| 736 | 736 | foreach ($lines as $line) { |
| 737 | - $wtext = FunctionsRtl::utf8WordWrap($line, $lw, "\n", true); |
|
| 737 | + $wtext = FunctionsRtl::utf8WordWrap($line, $lw, "\n", true); |
|
| 738 | 738 | $wraptext .= $wtext; |
| 739 | 739 | // Add a new line as long as it’s not the last line |
| 740 | 740 | if ($lfct > 1) { |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | private function getPersonalFacts(Individual $individual): array |
| 143 | 143 | { |
| 144 | - $facts = $individual->getFacts(); |
|
| 144 | + $facts = $individual->getFacts(); |
|
| 145 | 145 | foreach ($individual->getSpouseFamilies() as $family) { |
| 146 | 146 | $facts = array_merge($facts, $family->getFacts()); |
| 147 | 147 | // Add birth of children from this family to the facts array |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | 'provider' => 'openstreetmap', |
| 216 | 216 | 'style' => 'mapnik', |
| 217 | 217 | ]; |
| 218 | - self::$map_providers = [ |
|
| 218 | + self::$map_providers = [ |
|
| 219 | 219 | 'openstreetmap' => [ |
| 220 | 220 | 'name' => 'OpenStreetMap', |
| 221 | 221 | 'styles' => ['mapnik' => 'Mapnik'], |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | // Dead people... |
| 124 | 124 | if ($this->tree->getPreference('SHOW_DEAD_PEOPLE') >= $access_level && $this->isDead()) { |
| 125 | 125 | $keep_alive = false; |
| 126 | - $KEEP_ALIVE_YEARS_BIRTH = (int)$this->tree->getPreference('KEEP_ALIVE_YEARS_BIRTH'); |
|
| 126 | + $KEEP_ALIVE_YEARS_BIRTH = (int) $this->tree->getPreference('KEEP_ALIVE_YEARS_BIRTH'); |
|
| 127 | 127 | if ($KEEP_ALIVE_YEARS_BIRTH) { |
| 128 | 128 | preg_match_all('/\n1 (?:' . WT_EVENTS_BIRT . ').*(?:\n[2-9].*)*(?:\n2 DATE (.+))/', $this->gedcom, $matches, PREG_SET_ORDER); |
| 129 | 129 | foreach ($matches as $match) { |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | - $KEEP_ALIVE_YEARS_DEATH = (int)$this->tree->getPreference('KEEP_ALIVE_YEARS_DEATH'); |
|
| 137 | + $KEEP_ALIVE_YEARS_DEATH = (int) $this->tree->getPreference('KEEP_ALIVE_YEARS_DEATH'); |
|
| 138 | 138 | if ($KEEP_ALIVE_YEARS_DEATH) { |
| 139 | 139 | preg_match_all('/\n1 (?:' . WT_EVENTS_DEAT . ').*(?:\n[2-9].*)*(?:\n2 DATE (.+))/', $this->gedcom, $matches, PREG_SET_ORDER); |
| 140 | 140 | foreach ($matches as $match) { |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | // Consider relationship privacy (unless an admin is applying download restrictions) |
| 153 | - $user_path_length = (int)$this->tree->getUserPreference(Auth::user(), 'RELATIONSHIP_PATH_LENGTH'); |
|
| 153 | + $user_path_length = (int) $this->tree->getUserPreference(Auth::user(), 'RELATIONSHIP_PATH_LENGTH'); |
|
| 154 | 154 | $gedcomid = $this->tree->getUserPreference(Auth::user(), 'gedcomid'); |
| 155 | 155 | if ($gedcomid !== '' && $user_path_length > 0) { |
| 156 | 156 | return self::isRelated($this, $user_path_length); |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | */ |
| 323 | 323 | public function isDead(): bool |
| 324 | 324 | { |
| 325 | - $MAX_ALIVE_AGE = (int)$this->tree->getPreference('MAX_ALIVE_AGE'); |
|
| 325 | + $MAX_ALIVE_AGE = (int) $this->tree->getPreference('MAX_ALIVE_AGE'); |
|
| 326 | 326 | |
| 327 | 327 | // "1 DEAT Y" or "1 DEAT/2 DATE" or "1 DEAT/2 PLAC" |
| 328 | 328 | if (preg_match('/\n1 (?:' . WT_EVENTS_DEAT . ')(?: Y|(?:\n[2-9].+)*\n2 (DATE|PLAC) )/', $this->gedcom)) { |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | if ($min && $max) { |
| 712 | 712 | $gregorian_calendar = new GregorianCalendar(); |
| 713 | 713 | |
| 714 | - list($year) = $gregorian_calendar->jdToYmd((int)((max($min) + min($max)) / 2)); |
|
| 714 | + list($year) = $gregorian_calendar->jdToYmd((int) ((max($min) + min($max)) / 2)); |
|
| 715 | 715 | $this->estimated_birth_date = new Date('EST ' . $year); |
| 716 | 716 | } else { |
| 717 | 717 | $this->estimated_birth_date = new Date(''); // always return a date object |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | } |
| 739 | 739 | if ($this->estimated_death_date === null) { |
| 740 | 740 | if ($this->getEstimatedBirthDate()->minimumJulianDay()) { |
| 741 | - $max_alive_age = (int)$this->tree->getPreference('MAX_ALIVE_AGE'); |
|
| 741 | + $max_alive_age = (int) $this->tree->getPreference('MAX_ALIVE_AGE'); |
|
| 742 | 742 | $this->estimated_death_date = $this->getEstimatedBirthDate()->addYears($max_alive_age, 'BEF'); |
| 743 | 743 | } else { |
| 744 | 744 | $this->estimated_death_date = new Date(''); // always return a date object |
@@ -1106,7 +1106,7 @@ discard block |
||
| 1106 | 1106 | if ($display) { |
| 1107 | 1107 | $txt .= ' style="display:' . $display . '"'; |
| 1108 | 1108 | } |
| 1109 | - $txt .= '>'; |
|
| 1109 | + $txt .= '>'; |
|
| 1110 | 1110 | $husb = $fam->getHusband(); |
| 1111 | 1111 | if ($husb) { |
| 1112 | 1112 | // Temporarily reset the 'prefered' display name, as we always |
@@ -1173,7 +1173,7 @@ discard block |
||
| 1173 | 1173 | // Extract the structured name parts - use for "sortable" names and indexes |
| 1174 | 1174 | //////////////////////////////////////////////////////////////////////////// |
| 1175 | 1175 | |
| 1176 | - $sublevel = 1 + (int)$gedcom[0]; |
|
| 1176 | + $sublevel = 1 + (int) $gedcom[0]; |
|
| 1177 | 1177 | $NPFX = preg_match("/\n{$sublevel} NPFX (.+)/", $gedcom, $match) ? $match[1] : ''; |
| 1178 | 1178 | $GIVN = preg_match("/\n{$sublevel} GIVN (.+)/", $gedcom, $match) ? $match[1] : ''; |
| 1179 | 1179 | $SURN = preg_match("/\n{$sublevel} SURN (.+)/", $gedcom, $match) ? $match[1] : ''; |