@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | public function reorderChildrenAction(Request $request, Tree $tree): Response |
| 63 | 63 | { |
| 64 | 64 | $xref = $request->get('xref'); |
| 65 | - $order = (array)$request->get('order', []); |
|
| 65 | + $order = (array) $request->get('order', []); |
|
| 66 | 66 | $family = Family::getInstance($xref, $tree); |
| 67 | 67 | |
| 68 | 68 | $this->checkFamilyAccess($family, true); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $this->checkFamilyAccess($family, true); |
| 139 | 139 | |
| 140 | 140 | $PEDI = $request->get('PEDI', ''); |
| 141 | - $keep_chan = (bool)$request->get('keep_chan'); |
|
| 141 | + $keep_chan = (bool) $request->get('keep_chan'); |
|
| 142 | 142 | |
| 143 | 143 | $this->glevels = $request->get('glevels', []); |
| 144 | 144 | $this->tag = $request->get('tag', []); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | $gedrec .= "\n" . GedcomCodePedi::createNewFamcPedi($PEDI, $xref); |
| 158 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 158 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 159 | 159 | $gedrec = $this->handleUpdates($gedrec); |
| 160 | 160 | } else { |
| 161 | 161 | $gedrec = $this->updateRest($gedrec); |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 256 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 257 | 257 | $gedrec = $this->handleUpdates($gedrec); |
| 258 | 258 | } else { |
| 259 | 259 | $gedrec = $this->updateRest($gedrec); |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | $famrec .= $this->addNewFact($request, $tree, $match); |
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | - if ((bool)$request->get('SOUR_FAM')) { |
|
| 276 | + if ((bool) $request->get('SOUR_FAM')) { |
|
| 277 | 277 | $famrec = $this->handleUpdates($famrec); |
| 278 | 278 | } else { |
| 279 | 279 | $famrec = $this->updateRest($famrec); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function treePageBlockEdit(Request $request, Tree $tree, User $user): Response |
| 49 | 49 | { |
| 50 | - $block_id = (int)$request->get('block_id'); |
|
| 50 | + $block_id = (int) $request->get('block_id'); |
|
| 51 | 51 | $block = $this->treeBlock($request, $user); |
| 52 | 52 | $title = $block->getTitle() . ' — ' . I18N::translate('Preferences'); |
| 53 | 53 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | private function treeBlock(Request $request, User $user): ModuleBlockInterface |
| 91 | 91 | { |
| 92 | - $block_id = (int)$request->get('block_id'); |
|
| 92 | + $block_id = (int) $request->get('block_id'); |
|
| 93 | 93 | |
| 94 | 94 | $block_info = Database::prepare( |
| 95 | 95 | "SELECT module_Name, user_id FROM `##block` WHERE block_id = :block_id" |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function userPageBlockEdit(Request $request, Tree $tree, User $user): Response |
| 127 | 127 | { |
| 128 | - $block_id = (int)$request->get('block_id'); |
|
| 128 | + $block_id = (int) $request->get('block_id'); |
|
| 129 | 129 | $block = $this->userBlock($request, $user); |
| 130 | 130 | $title = $block->getTitle() . ' — ' . I18N::translate('Preferences'); |
| 131 | 131 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | private function userBlock(Request $request, User $user): ModuleBlockInterface |
| 169 | 169 | { |
| 170 | - $block_id = (int)$request->get('block_id'); |
|
| 170 | + $block_id = (int) $request->get('block_id'); |
|
| 171 | 171 | |
| 172 | 172 | $block_info = Database::prepare( |
| 173 | 173 | "SELECT module_Name, user_id FROM `##block` WHERE block_id = :block_id" |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | throw new NotFoundHttpException($block_info->module_name . ' is not a block'); |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - $block_owner_id = (int)$block_info->user_id; |
|
| 188 | + $block_owner_id = (int) $block_info->user_id; |
|
| 189 | 189 | |
| 190 | 190 | if ($block_owner_id !== $user->getUserId() && !Auth::isAdmin()) { |
| 191 | 191 | throw new AccessDeniedHttpException('You are not allowed to edit this block'); |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public function treePageBlock(Request $request, Tree $tree): Response |
| 233 | 233 | { |
| 234 | - $block_id = (int)$request->get('block_id'); |
|
| 234 | + $block_id = (int) $request->get('block_id'); |
|
| 235 | 235 | |
| 236 | 236 | $block = Database::prepare( |
| 237 | 237 | "SELECT * FROM `##block` WHERE block_id = :block_id AND gedcom_id = :tree_id AND user_id IS NULL" |
@@ -297,8 +297,8 @@ discard block |
||
| 297 | 297 | */ |
| 298 | 298 | public function treePageDefaultUpdate(Request $request): RedirectResponse |
| 299 | 299 | { |
| 300 | - $main_blocks = (array)$request->get('main'); |
|
| 301 | - $side_blocks = (array)$request->get('side'); |
|
| 300 | + $main_blocks = (array) $request->get('main'); |
|
| 301 | + $side_blocks = (array) $request->get('side'); |
|
| 302 | 302 | |
| 303 | 303 | $this->updateTreeBlocks(-1, $main_blocks, $side_blocks); |
| 304 | 304 | |
@@ -342,14 +342,14 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | public function treePageUpdate(Request $request, Tree $tree): RedirectResponse |
| 344 | 344 | { |
| 345 | - $defaults = (bool)$request->get('defaults'); |
|
| 345 | + $defaults = (bool) $request->get('defaults'); |
|
| 346 | 346 | |
| 347 | 347 | if ($defaults) { |
| 348 | 348 | $main_blocks = $this->getBlocksForTreePage(-1, AUth::PRIV_NONE, 'main'); |
| 349 | 349 | $side_blocks = $this->getBlocksForTreePage(-1, Auth::PRIV_NONE, 'side'); |
| 350 | 350 | } else { |
| 351 | - $main_blocks = (array)$request->get('main'); |
|
| 352 | - $side_blocks = (array)$request->get('side'); |
|
| 351 | + $main_blocks = (array) $request->get('main'); |
|
| 352 | + $side_blocks = (array) $request->get('side'); |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | $this->updateTreeBlocks($tree->getTreeId(), $main_blocks, $side_blocks); |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | */ |
| 397 | 397 | public function userPageBlock(Request $request, Tree $tree, User $user): Response |
| 398 | 398 | { |
| 399 | - $block_id = (int)$request->get('block_id'); |
|
| 399 | + $block_id = (int) $request->get('block_id'); |
|
| 400 | 400 | |
| 401 | 401 | $block = Database::prepare( |
| 402 | 402 | "SELECT * FROM `##block` WHERE block_id = :block_id AND gedcom_id IS NULL AND user_id = :user_id" |
@@ -461,8 +461,8 @@ discard block |
||
| 461 | 461 | */ |
| 462 | 462 | public function userPageDefaultUpdate(Request $request): RedirectResponse |
| 463 | 463 | { |
| 464 | - $main_blocks = (array)$request->get('main'); |
|
| 465 | - $side_blocks = (array)$request->get('side'); |
|
| 464 | + $main_blocks = (array) $request->get('main'); |
|
| 465 | + $side_blocks = (array) $request->get('side'); |
|
| 466 | 466 | |
| 467 | 467 | $this->updateUserBlocks(-1, $main_blocks, $side_blocks); |
| 468 | 468 | |
@@ -508,14 +508,14 @@ discard block |
||
| 508 | 508 | */ |
| 509 | 509 | public function userPageUpdate(Request $request, Tree $tree, User $user): RedirectResponse |
| 510 | 510 | { |
| 511 | - $defaults = (bool)$request->get('defaults'); |
|
| 511 | + $defaults = (bool) $request->get('defaults'); |
|
| 512 | 512 | |
| 513 | 513 | if ($defaults) { |
| 514 | 514 | $main_blocks = $this->getBlocksForUserPage(-1, -1, AUth::PRIV_NONE, 'main'); |
| 515 | 515 | $side_blocks = $this->getBlocksForUserPage(-1, -1, Auth::PRIV_NONE, 'side'); |
| 516 | 516 | } else { |
| 517 | - $main_blocks = (array)$request->get('main'); |
|
| 518 | - $side_blocks = (array)$request->get('side'); |
|
| 517 | + $main_blocks = (array) $request->get('main'); |
|
| 518 | + $side_blocks = (array) $request->get('side'); |
|
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | $this->updateUserBlocks($user->getUserId(), $main_blocks, $side_blocks); |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | */ |
| 533 | 533 | public function userPageUserEdit(Request $request): Response |
| 534 | 534 | { |
| 535 | - $user_id = (int)$request->get('user_id'); |
|
| 535 | + $user_id = (int) $request->get('user_id'); |
|
| 536 | 536 | $user = User::find($user_id); |
| 537 | 537 | $main_blocks = $this->getBlocksForUserPage(-1, $user_id, Auth::PRIV_NONE, 'main'); |
| 538 | 538 | $side_blocks = $this->getBlocksForUserPage(-1, $user_id, Auth::PRIV_NONE, 'side'); |
@@ -561,9 +561,9 @@ discard block |
||
| 561 | 561 | */ |
| 562 | 562 | public function userPageUserUpdate(Request $request): RedirectResponse |
| 563 | 563 | { |
| 564 | - $user_id = (int)$request->get('user_id'); |
|
| 565 | - $main_blocks = (array)$request->get('main'); |
|
| 566 | - $side_blocks = (array)$request->get('side'); |
|
| 564 | + $user_id = (int) $request->get('user_id'); |
|
| 565 | + $main_blocks = (array) $request->get('main'); |
|
| 566 | + $side_blocks = (array) $request->get('side'); |
|
| 567 | 567 | |
| 568 | 568 | $this->updateUserBlocks($user_id, $main_blocks, $side_blocks); |
| 569 | 569 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | public function reorderMediaAction(Request $request, Tree $tree): Response |
| 63 | 63 | { |
| 64 | 64 | $xref = $request->get('xref'); |
| 65 | - $order = (array)$request->get('order', []); |
|
| 65 | + $order = (array) $request->get('order', []); |
|
| 66 | 66 | $individual = Individual::getInstance($xref, $tree); |
| 67 | 67 | |
| 68 | 68 | $this->checkIndividualAccess($individual, true); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | public function reorderNamesAction(Request $request, Tree $tree): Response |
| 124 | 124 | { |
| 125 | 125 | $xref = $request->get('xref'); |
| 126 | - $order = (array)$request->get('order', []); |
|
| 126 | + $order = (array) $request->get('order', []); |
|
| 127 | 127 | $individual = Individual::getInstance($xref, $tree); |
| 128 | 128 | |
| 129 | 129 | $this->checkIndividualAccess($individual, true); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | public function reorderSpousesAction(Request $request, Tree $tree): Response |
| 185 | 185 | { |
| 186 | 186 | $xref = $request->get('xref'); |
| 187 | - $order = (array)$request->get('order', []); |
|
| 187 | + $order = (array) $request->get('order', []); |
|
| 188 | 188 | $individual = Individual::getInstance($xref, $tree); |
| 189 | 189 | |
| 190 | 190 | $this->checkIndividualAccess($individual, true); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | $gedcom .= $this->addNewFact($request, $tree, $match); |
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 294 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 295 | 295 | $gedcom = $this->handleUpdates($gedcom); |
| 296 | 296 | } else { |
| 297 | 297 | $gedcom = $this->updateRest($gedcom); |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | $gedcom .= $this->addNewFact($request, $tree, $match); |
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 386 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 387 | 387 | $gedcom = $this->handleUpdates($gedcom); |
| 388 | 388 | } else { |
| 389 | 389 | $gedcom = $this->updateRest($gedcom); |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | */ |
| 417 | 417 | public function addSpouse(Request $request, Tree $tree): Response |
| 418 | 418 | { |
| 419 | - $xref = $request->get('xref', ''); |
|
| 419 | + $xref = $request->get('xref', ''); |
|
| 420 | 420 | |
| 421 | 421 | $individual = Individual::getInstance($xref, $tree); |
| 422 | 422 | |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | $indi_gedcom .= $this->addNewFact($request, $tree, $match); |
| 475 | 475 | } |
| 476 | 476 | } |
| 477 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 477 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 478 | 478 | $indi_gedcom = $this->handleUpdates($indi_gedcom); |
| 479 | 479 | } else { |
| 480 | 480 | $indi_gedcom = $this->updateRest($indi_gedcom); |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $fam_gedcom .= $this->addNewFact($request, $tree, $match); |
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | - if ((bool)$request->get('SOUR_FAM')) { |
|
| 489 | + if ((bool) $request->get('SOUR_FAM')) { |
|
| 490 | 490 | $fam_gedcom = $this->handleUpdates($fam_gedcom); |
| 491 | 491 | } else { |
| 492 | 492 | $fam_gedcom = $this->updateRest($fam_gedcom); |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | $gedrec .= $this->addNewFact($request, $tree, $match); |
| 561 | 561 | } |
| 562 | 562 | } |
| 563 | - if ((bool)$request->get('SOUR_INDI')) { |
|
| 563 | + if ((bool) $request->get('SOUR_INDI')) { |
|
| 564 | 564 | $gedrec = $this->handleUpdates($gedrec); |
| 565 | 565 | } else { |
| 566 | 566 | $gedrec = $this->updateRest($gedrec); |
@@ -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 | } |
@@ -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' => '', |
@@ -440,7 +440,7 @@ |
||
| 440 | 440 | */ |
| 441 | 441 | private function significant(Individual $individual): stdClass |
| 442 | 442 | { |
| 443 | - $significant = (object)[ |
|
| 443 | + $significant = (object) [ |
|
| 444 | 444 | 'family' => null, |
| 445 | 445 | 'individual' => $individual, |
| 446 | 446 | '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, |
@@ -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'], |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function cleanup(Request $request): Response |
| 51 | 51 | { |
| 52 | - $months = (int)$request->get('months', 6); |
|
| 52 | + $months = (int) $request->get('months', 6); |
|
| 53 | 53 | |
| 54 | 54 | $inactive_threshold = time() - $months * 30 * self::SECONDS_PER_DAY; |
| 55 | 55 | $unverified_threshold = time() - 7 * self::SECONDS_PER_DAY; |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | $inactive_users = array_filter($users, function (User $user) use ($inactive_threshold): bool { |
| 60 | 60 | if ($user->getPreference('sessiontime') === '0') { |
| 61 | - $datelogin = (int)$user->getPreference('reg_timestamp'); |
|
| 61 | + $datelogin = (int) $user->getPreference('reg_timestamp'); |
|
| 62 | 62 | } else { |
| 63 | - $datelogin = (int)$user->getPreference('sessiontime'); |
|
| 63 | + $datelogin = (int) $user->getPreference('sessiontime'); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | return $datelogin < $inactive_threshold && $user->getPreference('verified'); |
@@ -68,9 +68,9 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | $unverified_users = array_filter($users, function (User $user) use ($unverified_threshold): bool { |
| 70 | 70 | if ($user->getPreference('sessiontime') === '0') { |
| 71 | - $datelogin = (int)$user->getPreference('reg_timestamp'); |
|
| 71 | + $datelogin = (int) $user->getPreference('reg_timestamp'); |
|
| 72 | 72 | } else { |
| 73 | - $datelogin = (int)$user->getPreference('sessiontime'); |
|
| 73 | + $datelogin = (int) $user->getPreference('sessiontime'); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | return $datelogin < $unverified_threshold && !$user->getPreference('verified'); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | public function cleanupAction(Request $request): RedirectResponse |
| 98 | 98 | { |
| 99 | 99 | foreach (User::all() as $user) { |
| 100 | - if ((bool)$request->get('del_' . $user->getUserId())) { |
|
| 100 | + if ((bool) $request->get('del_' . $user->getUserId())) { |
|
| 101 | 101 | Log::addAuthenticationLog('Deleted user: ' . $user->getUserName()); |
| 102 | 102 | $user->delete(); |
| 103 | 103 | |
@@ -144,10 +144,10 @@ discard block |
||
| 144 | 144 | public function data(Request $request, User $user): JsonResponse |
| 145 | 145 | { |
| 146 | 146 | $search = $request->get('search')['value']; |
| 147 | - $start = (int)$request->get('start'); |
|
| 148 | - $length = (int)$request->get('length'); |
|
| 147 | + $start = (int) $request->get('start'); |
|
| 148 | + $length = (int) $request->get('length'); |
|
| 149 | 149 | $order = $request->get('order', []); |
| 150 | - $draw = (int)$request->get('draw'); |
|
| 150 | + $draw = (int) $request->get('draw'); |
|
| 151 | 151 | |
| 152 | 152 | $sql_select = |
| 153 | 153 | "SELECT SQL_CALC_FOUND_ROWS u.user_id, user_name, real_name, email, us1.setting_value AS language, us2.setting_value AS registered_at, us3.setting_value AS active_at, us4.setting_value AS verified, us5.setting_value AS verified_by_admin" . |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $args = []; |
| 163 | 163 | |
| 164 | 164 | if ($search) { |
| 165 | - $sql_select .= " AND (user_name LIKE CONCAT('%', :search_1, '%') OR real_name LIKE CONCAT('%', :search_2, '%') OR email LIKE CONCAT('%', :search_3, '%'))"; |
|
| 165 | + $sql_select .= " AND (user_name LIKE CONCAT('%', :search_1, '%') OR real_name LIKE CONCAT('%', :search_2, '%') OR email LIKE CONCAT('%', :search_3, '%'))"; |
|
| 166 | 166 | $args['search_1'] = $search; |
| 167 | 167 | $args['search_2'] = $search; |
| 168 | 168 | $args['search_3'] = $search; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | if ($length) { |
| 193 | 193 | $user->setPreference('admin_users_page_size', $length); |
| 194 | - $sql_select .= " LIMIT :limit OFFSET :offset"; |
|
| 194 | + $sql_select .= " LIMIT :limit OFFSET :offset"; |
|
| 195 | 195 | $args['limit'] = $length; |
| 196 | 196 | $args['offset'] = $start; |
| 197 | 197 | } |
@@ -199,8 +199,8 @@ discard block |
||
| 199 | 199 | $rows = Database::prepare($sql_select)->execute($args)->fetchAll(); |
| 200 | 200 | |
| 201 | 201 | // Total filtered/unfiltered rows |
| 202 | - $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
| 203 | - $recordsTotal = (int)Database::prepare("SELECT COUNT(*) FROM `##user` WHERE user_id > 0")->fetchOne(); |
|
| 202 | + $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
| 203 | + $recordsTotal = (int) Database::prepare("SELECT COUNT(*) FROM `##user` WHERE user_id > 0")->fetchOne(); |
|
| 204 | 204 | |
| 205 | 205 | $installed_languages = []; |
| 206 | 206 | foreach (I18N::installedLocales() as $installed_locale) { |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | */ |
| 287 | 287 | public function edit(Request $request): Response |
| 288 | 288 | { |
| 289 | - $user_id = (int)$request->get('user_id'); |
|
| 289 | + $user_id = (int) $request->get('user_id'); |
|
| 290 | 290 | $user = User::find($user_id); |
| 291 | 291 | |
| 292 | 292 | if ($user === null) { |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | */ |
| 370 | 370 | public function update(Request $request, User $user): RedirectResponse |
| 371 | 371 | { |
| 372 | - $user_id = (int)$request->get('user_id'); |
|
| 372 | + $user_id = (int) $request->get('user_id'); |
|
| 373 | 373 | $username = $request->get('username'); |
| 374 | 374 | $real_name = $request->get('real_name'); |
| 375 | 375 | $email = $request->get('email'); |
@@ -379,11 +379,11 @@ discard block |
||
| 379 | 379 | $timezone = $request->get('timezone'); |
| 380 | 380 | $contact_method = $request->get('contact_method'); |
| 381 | 381 | $comment = $request->get('comment'); |
| 382 | - $auto_accept = (bool)$request->get('auto_accept'); |
|
| 383 | - $canadmin = (bool)$request->get('canadmin'); |
|
| 384 | - $visible_online = (bool)$request->get('visible_online'); |
|
| 385 | - $verified = (bool)$request->get('verified'); |
|
| 386 | - $approved = (bool)$request->get('approved'); |
|
| 382 | + $auto_accept = (bool) $request->get('auto_accept'); |
|
| 383 | + $canadmin = (bool) $request->get('canadmin'); |
|
| 384 | + $visible_online = (bool) $request->get('visible_online'); |
|
| 385 | + $verified = (bool) $request->get('verified'); |
|
| 386 | + $approved = (bool) $request->get('approved'); |
|
| 387 | 387 | |
| 388 | 388 | $edit_user = User::find($user_id); |
| 389 | 389 | |
@@ -400,10 +400,10 @@ discard block |
||
| 400 | 400 | ->setPreference('TIMEZONE', $timezone) |
| 401 | 401 | ->setPreference('contactmethod', $contact_method) |
| 402 | 402 | ->setPreference('comment', $comment) |
| 403 | - ->setPreference('auto_accept', (string)$auto_accept) |
|
| 404 | - ->setPreference('visibleonline', (string)$visible_online) |
|
| 405 | - ->setPreference('verified', (string)$verified) |
|
| 406 | - ->setPreference('verified_by_admin', (string)$approved); |
|
| 403 | + ->setPreference('auto_accept', (string) $auto_accept) |
|
| 404 | + ->setPreference('visibleonline', (string) $visible_online) |
|
| 405 | + ->setPreference('verified', (string) $verified) |
|
| 406 | + ->setPreference('verified_by_admin', (string) $approved); |
|
| 407 | 407 | |
| 408 | 408 | if ($pass1 !== '') { |
| 409 | 409 | $edit_user->setPassword($pass1); |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | foreach (Tree::getAll() as $tree) { |
| 418 | - $path_length = (int)$request->get('RELATIONSHIP_PATH_LENGTH' . $tree->getTreeId()); |
|
| 418 | + $path_length = (int) $request->get('RELATIONSHIP_PATH_LENGTH' . $tree->getTreeId()); |
|
| 419 | 419 | $gedcom_id = $request->get('gedcomid' . $tree->getTreeId(), ''); |
| 420 | 420 | $can_edit = $request->get('canedit' . $tree->getTreeId(), ''); |
| 421 | 421 | |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | |
| 427 | 427 | $tree->setUserPreference($edit_user, 'gedcomid', $gedcom_id); |
| 428 | 428 | $tree->setUserPreference($edit_user, 'canedit', $can_edit); |
| 429 | - $tree->setUserPreference($edit_user, 'RELATIONSHIP_PATH_LENGTH', (string)$path_length); |
|
| 429 | + $tree->setUserPreference($edit_user, 'RELATIONSHIP_PATH_LENGTH', (string) $path_length); |
|
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | $url = route('admin-users'); |