@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | /** |
| 4 | 4 | * webtrees: online genealogy |
| 5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | public function postDeleteFavoriteAction(Request $request, Tree $tree, User $user): RedirectResponse |
| 204 | 204 | { |
| 205 | - $favorite_id = (int)$request->get('favorite_id'); |
|
| 205 | + $favorite_id = (int) $request->get('favorite_id'); |
|
| 206 | 206 | |
| 207 | 207 | if (Auth::check()) { |
| 208 | 208 | Database::prepare( |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | /** |
| 4 | 4 | * webtrees: online genealogy |
| 5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | // Only show this block for certain languages |
| 119 | 119 | $languages = $this->getBlockSetting($block_id, 'languages', ''); |
| 120 | 120 | if ($languages === '' || in_array(WT_LOCALE, explode(',', $languages))) { |
| 121 | - $stories[] = (object)[ |
|
| 121 | + $stories[] = (object) [ |
|
| 122 | 122 | 'block_id' => $block_id, |
| 123 | 123 | 'title' => $this->getBlockSetting($block_id, 'title'), |
| 124 | 124 | 'story_body' => $this->getBlockSetting($block_id, 'story_body'), |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | { |
| 214 | 214 | $this->layout = 'layouts/administration'; |
| 215 | 215 | |
| 216 | - $block_id = (int)$request->get('block_id'); |
|
| 216 | + $block_id = (int) $request->get('block_id'); |
|
| 217 | 217 | |
| 218 | 218 | if ($block_id === 0) { |
| 219 | 219 | // Creating a new story |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | public function postAdminEditAction(Request $request, Tree $tree): RedirectResponse |
| 260 | 260 | { |
| 261 | - $block_id = (int)$request->get('block_id'); |
|
| 261 | + $block_id = (int) $request->get('block_id'); |
|
| 262 | 262 | $xref = $request->get('xref', ''); |
| 263 | 263 | $story_body = $request->get('story_body', ''); |
| 264 | 264 | $story_title = $request->get('story_title', ''); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | public function postAdminDeleteAction(Request $request, Tree $tree): Response |
| 306 | 306 | { |
| 307 | - $block_id = (int)$request->get('block_id'); |
|
| 307 | + $block_id = (int) $request->get('block_id'); |
|
| 308 | 308 | |
| 309 | 309 | Database::prepare( |
| 310 | 310 | "DELETE FROM `##block_setting` WHERE block_id = :block_id" |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | /** |
| 4 | 4 | * webtrees: online genealogy |
| 5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | 'tree_id' => $tree->getTreeId(), |
| 173 | 173 | ])->fetchOneRow(); |
| 174 | 174 | } else { |
| 175 | - $row = (object)[ |
|
| 175 | + $row = (object) [ |
|
| 176 | 176 | 'body' => '', |
| 177 | 177 | 'subject' => '', |
| 178 | 178 | ]; |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | /** |
| 4 | 4 | * webtrees: online genealogy |
| 5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | 'user_id' => Auth::id(), |
| 167 | 167 | ])->fetchOneRow(); |
| 168 | 168 | } else { |
| 169 | - $row = (object)[ |
|
| 169 | + $row = (object) [ |
|
| 170 | 170 | 'body' => '', |
| 171 | 171 | 'subject' => '', |
| 172 | 172 | ]; |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | /** |
| 4 | 4 | * webtrees: online genealogy |
| 5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | public function postAdminAction(Request $request): RedirectResponse |
| 112 | 112 | { |
| 113 | 113 | foreach (Tree::getAll() as $tree) { |
| 114 | - $include_in_sitemap = (bool)$request->get('sitemap' . $tree->getTreeId()); |
|
| 115 | - $tree->setPreference('include_in_sitemap', (string)$include_in_sitemap); |
|
| 114 | + $include_in_sitemap = (bool) $request->get('sitemap' . $tree->getTreeId()); |
|
| 115 | + $tree->setPreference('include_in_sitemap', (string) $include_in_sitemap); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | FlashMessages::addMessage(I18N::translate('The preferences for the module “%s” have been updated.', $this->getTitle()), 'success'); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function getIndexAction(Request $request): Response |
| 129 | 129 | { |
| 130 | - $timestamp = (int)$this->getPreference('sitemap.timestamp'); |
|
| 130 | + $timestamp = (int) $this->getPreference('sitemap.timestamp'); |
|
| 131 | 131 | |
| 132 | 132 | if ($timestamp > WT_TIMESTAMP - self::CACHE_LIFE) { |
| 133 | 133 | $content = $this->getPreference('sitemap.xml'); |
@@ -184,12 +184,12 @@ discard block |
||
| 184 | 184 | throw new NotFoundHttpException('Bad sitemap file'); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - $timestamp = (int)$this->getPreference('sitemap-' . $file . '.timestamp'); |
|
| 187 | + $timestamp = (int) $this->getPreference('sitemap-' . $file . '.timestamp'); |
|
| 188 | 188 | |
| 189 | 189 | if ($timestamp > WT_TIMESTAMP - self::CACHE_LIFE) { |
| 190 | 190 | $content = $this->getPreference('sitemap-' . $file . '.xml'); |
| 191 | 191 | } else { |
| 192 | - $tree = Tree::findById((int)$match[1]); |
|
| 192 | + $tree = Tree::findById((int) $match[1]); |
|
| 193 | 193 | |
| 194 | 194 | if ($tree === null) { |
| 195 | 195 | throw new NotFoundHttpException('No such tree'); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | /** |
| 4 | 4 | * webtrees: online genealogy |
| 5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | public function postAdminDeleteAction(Request $request, Tree $tree): RedirectResponse |
| 158 | 158 | { |
| 159 | - $block_id = (int)$request->get('block_id'); |
|
| 159 | + $block_id = (int) $request->get('block_id'); |
|
| 160 | 160 | |
| 161 | 161 | Database::prepare( |
| 162 | 162 | "DELETE FROM `##block_setting` WHERE block_id = :block_id" |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | public function postAdminMoveDownAction(Request $request, Tree $tree): RedirectResponse |
| 186 | 186 | { |
| 187 | - $block_id = (int)$request->get('block_id'); |
|
| 187 | + $block_id = (int) $request->get('block_id'); |
|
| 188 | 188 | |
| 189 | 189 | $block_order = Database::prepare( |
| 190 | 190 | "SELECT block_order FROM `##block` WHERE block_id = :block_id" |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | */ |
| 238 | 238 | public function postAdminMoveUpAction(Request $request, Tree $tree): RedirectResponse |
| 239 | 239 | { |
| 240 | - $block_id = (int)$request->get('block_id'); |
|
| 240 | + $block_id = (int) $request->get('block_id'); |
|
| 241 | 241 | |
| 242 | 242 | $block_order = Database::prepare( |
| 243 | 243 | "SELECT block_order FROM `##block` WHERE block_id = :block_id" |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | { |
| 293 | 293 | $this->layout = 'layouts/administration'; |
| 294 | 294 | |
| 295 | - $block_id = (int)$request->get('block_id'); |
|
| 295 | + $block_id = (int) $request->get('block_id'); |
|
| 296 | 296 | |
| 297 | 297 | if ($block_id === 0) { |
| 298 | 298 | // Creating a new faq |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | )->execute([ |
| 304 | 304 | 'module_name' => $this->getName(), |
| 305 | 305 | ])->fetchOne(); |
| 306 | - $languages = []; |
|
| 306 | + $languages = []; |
|
| 307 | 307 | |
| 308 | 308 | $title = I18N::translate('Add an FAQ'); |
| 309 | 309 | } else { |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | */ |
| 341 | 341 | public function postAdminEditAction(Request $request, Tree $tree): RedirectResponse |
| 342 | 342 | { |
| 343 | - $block_id = (int)$request->get('block_id'); |
|
| 343 | + $block_id = (int) $request->get('block_id'); |
|
| 344 | 344 | $faqbody = $request->get('faqbody', ''); |
| 345 | 345 | $header = $request->get('header', ''); |
| 346 | 346 | $languages = $request->get('languages', []); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | /** |
| 4 | 4 | * webtrees: online genealogy |
| 5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | { |
| 282 | 282 | $nchi = count($this->getChildren()); |
| 283 | 283 | foreach ($this->getFacts('NCHI') as $fact) { |
| 284 | - $nchi = max($nchi, (int)$fact->getValue()); |
|
| 284 | + $nchi = max($nchi, (int) $fact->getValue()); |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | return $nchi; |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | /** |
| 4 | 4 | * webtrees: online genealogy |
| 5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -837,23 +837,23 @@ discard block |
||
| 837 | 837 | $year = 365 * $day; |
| 838 | 838 | |
| 839 | 839 | if ($seconds > $year) { |
| 840 | - $years = (int)($seconds / $year); |
|
| 840 | + $years = (int) ($seconds / $year); |
|
| 841 | 841 | |
| 842 | 842 | return self::plural('%s year ago', '%s years ago', $years, self::number($years)); |
| 843 | 843 | } elseif ($seconds > $month) { |
| 844 | - $months = (int)($seconds / $month); |
|
| 844 | + $months = (int) ($seconds / $month); |
|
| 845 | 845 | |
| 846 | 846 | return self::plural('%s month ago', '%s months ago', $months, self::number($months)); |
| 847 | 847 | } elseif ($seconds > $day) { |
| 848 | - $days = (int)($seconds / $day); |
|
| 848 | + $days = (int) ($seconds / $day); |
|
| 849 | 849 | |
| 850 | 850 | return self::plural('%s day ago', '%s days ago', $days, self::number($days)); |
| 851 | 851 | } elseif ($seconds > $hour) { |
| 852 | - $hours = (int)($seconds / $hour); |
|
| 852 | + $hours = (int) ($seconds / $hour); |
|
| 853 | 853 | |
| 854 | 854 | return self::plural('%s hour ago', '%s hours ago', $hours, self::number($hours)); |
| 855 | 855 | } elseif ($seconds > $minute) { |
| 856 | - $minutes = (int)($seconds / $minute); |
|
| 856 | + $minutes = (int) ($seconds / $minute); |
|
| 857 | 857 | |
| 858 | 858 | return self::plural('%s minute ago', '%s minutes ago', $minutes, self::number($minutes)); |
| 859 | 859 | } else { |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | /** |
| 4 | 4 | * webtrees: online genealogy |
| 5 | 5 | * Copyright (C) 2018 webtrees development team |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | 'type' => 'radio', |
| 102 | 102 | 'name' => $name, |
| 103 | 103 | 'value' => $value, |
| 104 | - 'checked' => (string)$value === (string)$selected, |
|
| 104 | + 'checked' => (string) $value === (string) $selected, |
|
| 105 | 105 | ] + $attributes); |
| 106 | 106 | |
| 107 | 107 | $html .= |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | foreach ($options as $value => $option) { |
| 131 | 131 | $option_attributes = self::attributes([ |
| 132 | 132 | 'value' => $value, |
| 133 | - 'selected' => (string)$value === (string)$selected, |
|
| 133 | + 'selected' => (string) $value === (string) $selected, |
|
| 134 | 134 | ]); |
| 135 | 135 | |
| 136 | 136 | $html .= '<option ' . $option_attributes . '>' . e($option) . '</option>'; |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | foreach ($options as $value => $option) { |
| 163 | 163 | $option_attributes = self::attributes([ |
| 164 | 164 | 'value' => $value, |
| 165 | - 'selected' => in_array((string)$value, $selected), |
|
| 165 | + 'selected' => in_array((string) $value, $selected), |
|
| 166 | 166 | ]); |
| 167 | 167 | |
| 168 | 168 | $html .= '<option ' . $option_attributes . '>' . e($option) . '</option>'; |