@@ -235,7 +235,7 @@ |
||
235 | 235 | if ($access_level === null) { |
236 | 236 | return $this->defaultAccessLevel(); |
237 | 237 | } else { |
238 | - return (int)$access_level; |
|
238 | + return (int) $access_level; |
|
239 | 239 | } |
240 | 240 | } |
241 | 241 |
@@ -153,7 +153,7 @@ |
||
153 | 153 | 'user_id' => Auth::id(), |
154 | 154 | ])->fetchOneRow(); |
155 | 155 | } else { |
156 | - $row = (object)[ |
|
156 | + $row = (object) [ |
|
157 | 157 | 'body' => '', |
158 | 158 | 'subject' => '', |
159 | 159 | ]; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | 'generations' => 3, |
85 | 85 | 'layout' => PedigreeChartController::PORTRAIT, |
86 | 86 | ]); |
87 | - $content = view('modules/charts/chart', [ |
|
87 | + $content = view('modules/charts/chart', [ |
|
88 | 88 | 'block_id' => $block_id, |
89 | 89 | 'chart_url' => $chart_url, |
90 | 90 | ]); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | 'generations' => 2, |
98 | 98 | 'chart_style' => 0, |
99 | 99 | ]); |
100 | - $content = view('modules/charts/chart', [ |
|
100 | + $content = view('modules/charts/chart', [ |
|
101 | 101 | 'block_id' => $block_id, |
102 | 102 | 'chart_url' => $chart_url, |
103 | 103 | ]); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | 'generations' => 2, |
111 | 111 | 'layout' => PedigreeChartController::PORTRAIT, |
112 | 112 | ]); |
113 | - $content = view('modules/charts/chart', [ |
|
113 | + $content = view('modules/charts/chart', [ |
|
114 | 114 | 'block_id' => $block_id, |
115 | 115 | 'chart_url' => $chart_url, |
116 | 116 | ]); |
@@ -83,7 +83,7 @@ |
||
83 | 83 | extract($cfg, EXTR_OVERWRITE); |
84 | 84 | |
85 | 85 | if ($show_common_surnames) { |
86 | - $surnames = FunctionsDb::getTopSurnames($tree->getTreeId(), 0, (int)$number_of_surnames); |
|
86 | + $surnames = FunctionsDb::getTopSurnames($tree->getTreeId(), 0, (int) $number_of_surnames); |
|
87 | 87 | |
88 | 88 | $all_surnames = []; |
89 | 89 | foreach (array_keys($surnames) as $surname) { |
@@ -161,7 +161,7 @@ |
||
161 | 161 | 'tree_id' => $tree->getTreeId(), |
162 | 162 | ])->fetchOneRow(); |
163 | 163 | } else { |
164 | - $row = (object)[ |
|
164 | + $row = (object) [ |
|
165 | 165 | 'body' => '', |
166 | 166 | 'subject' => '', |
167 | 167 | ]; |
@@ -165,7 +165,7 @@ |
||
165 | 165 | $f1 = preg_match("/\d LATI (.*)/", $gedcom, $match1); |
166 | 166 | $f2 = preg_match("/\d LONG (.*)/", $gedcom, $match2); |
167 | 167 | if ($f1 && $f2) { |
168 | - $coords = (object)[ |
|
168 | + $coords = (object) [ |
|
169 | 169 | 'latitude' => $match1[1], |
170 | 170 | 'longitude' => $match2[1], |
171 | 171 | ]; |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | public static function plural(/* var_args */) |
652 | 652 | { |
653 | 653 | $args = func_get_args(); |
654 | - $args[0] = self::$translator->translatePlural($args[0], $args[1], (int)$args[2]); |
|
654 | + $args[0] = self::$translator->translatePlural($args[0], $args[1], (int) $args[2]); |
|
655 | 655 | unset($args[1], $args[2]); |
656 | 656 | |
657 | 657 | return self::substitutePlaceholders($args); |
@@ -860,23 +860,23 @@ discard block |
||
860 | 860 | $year = 365 * $day; |
861 | 861 | |
862 | 862 | if ($seconds > $year) { |
863 | - $years = (int)($seconds / $year); |
|
863 | + $years = (int) ($seconds / $year); |
|
864 | 864 | |
865 | 865 | return self::plural('%s year ago', '%s years ago', $years, self::number($years)); |
866 | 866 | } elseif ($seconds > $month) { |
867 | - $months = (int)($seconds / $month); |
|
867 | + $months = (int) ($seconds / $month); |
|
868 | 868 | |
869 | 869 | return self::plural('%s month ago', '%s months ago', $months, self::number($months)); |
870 | 870 | } elseif ($seconds > $day) { |
871 | - $days = (int)($seconds / $day); |
|
871 | + $days = (int) ($seconds / $day); |
|
872 | 872 | |
873 | 873 | return self::plural('%s day ago', '%s days ago', $days, self::number($days)); |
874 | 874 | } elseif ($seconds > $hour) { |
875 | - $hours = (int)($seconds / $hour); |
|
875 | + $hours = (int) ($seconds / $hour); |
|
876 | 876 | |
877 | 877 | return self::plural('%s hour ago', '%s hours ago', $hours, self::number($hours)); |
878 | 878 | } elseif ($seconds > $minute) { |
879 | - $minutes = (int)($seconds / $minute); |
|
879 | + $minutes = (int) ($seconds / $minute); |
|
880 | 880 | |
881 | 881 | return self::plural('%s minute ago', '%s minutes ago', $minutes, self::number($minutes)); |
882 | 882 | } else { |
@@ -83,12 +83,12 @@ discard block |
||
83 | 83 | foreach ($rows as $row) { |
84 | 84 | if ($row->xref !== null) { |
85 | 85 | if ($row->tag_type !== null) { |
86 | - $this->individual_fact_privacy[$row->xref][$row->tag_type] = (int)$row->resn; |
|
86 | + $this->individual_fact_privacy[$row->xref][$row->tag_type] = (int) $row->resn; |
|
87 | 87 | } else { |
88 | - $this->individual_privacy[$row->xref] = (int)$row->resn; |
|
88 | + $this->individual_privacy[$row->xref] = (int) $row->resn; |
|
89 | 89 | } |
90 | 90 | } else { |
91 | - $this->fact_privacy[$row->tag_type] = (int)$row->resn; |
|
91 | + $this->fact_privacy[$row->tag_type] = (int) $row->resn; |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | } |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | Auth::id(), |
317 | 317 | ])->fetchAll(); |
318 | 318 | foreach ($rows as $row) { |
319 | - self::$trees[$row->tree_name] = new self((int)$row->tree_id, $row->tree_name, $row->tree_title); |
|
319 | + self::$trees[$row->tree_name] = new self((int) $row->tree_id, $row->tree_name, $row->tree_title); |
|
320 | 320 | } |
321 | 321 | } |
322 | 322 | |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | */ |
500 | 500 | public function hasPendingEdit() |
501 | 501 | { |
502 | - return (bool)Database::prepare( |
|
502 | + return (bool) Database::prepare( |
|
503 | 503 | "SELECT 1 FROM `##change` WHERE status = 'pending' AND gedcom_id = :tree_id" |
504 | 504 | )->execute([ |
505 | 505 | 'tree_id' => $this->tree_id, |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | "UPDATE `##site_setting` SET setting_value = LAST_INSERT_ID(setting_value + :increment) WHERE setting_name = 'next_xref'" |
673 | 673 | ); |
674 | 674 | $statement->execute([ |
675 | - 'increment' => (int)$increment, |
|
675 | + 'increment' => (int) $increment, |
|
676 | 676 | ]); |
677 | 677 | |
678 | 678 | if ($statement->rowCount() === 0) { |
@@ -83,8 +83,7 @@ discard block |
||
83 | 83 | // Create the underlying PDO object |
84 | 84 | self::$pdo = new PDO( |
85 | 85 | (substr($config['dbhost'], 0, 1) === '/' ? |
86 | - "mysql:unix_socket={$config['dbhost']};dbname={$config['dbname']}" : |
|
87 | - "mysql:host={$config['dbhost']};dbname={$config['dbname']};port={$config['dbport']}" |
|
86 | + "mysql:unix_socket={$config['dbhost']};dbname={$config['dbname']}" : "mysql:host={$config['dbhost']};dbname={$config['dbname']};port={$config['dbport']}" |
|
88 | 87 | ), |
89 | 88 | $config['dbuser'], $config['dbpass'], |
90 | 89 | [ |
@@ -221,7 +220,7 @@ discard block |
||
221 | 220 | public static function updateSchema($namespace, $schema_name, $target_version) |
222 | 221 | { |
223 | 222 | try { |
224 | - $current_version = (int)Site::getPreference($schema_name); |
|
223 | + $current_version = (int) Site::getPreference($schema_name); |
|
225 | 224 | } catch (PDOException $ex) { |
226 | 225 | DebugBar::addThrowable($ex); |
227 | 226 | |
@@ -238,7 +237,7 @@ discard block |
||
238 | 237 | $migration = new $class; |
239 | 238 | $migration->upgrade(); |
240 | 239 | $current_version++; |
241 | - Site::setPreference($schema_name, (string)$current_version); |
|
240 | + Site::setPreference($schema_name, (string) $current_version); |
|
242 | 241 | $updates_applied = true; |
243 | 242 | } |
244 | 243 |