@@ -62,9 +62,9 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $this->checkIndividualAccess($individual); |
| 64 | 64 | |
| 65 | - $chart_style = (int)$request->get('chart_style', self::DEFAULT_STYLE); |
|
| 66 | - $fan_width = (int)$request->get('fan_width', self::DEFAULT_WIDTH); |
|
| 67 | - $generations = (int)$request->get('generations', self::DEFAULT_GENERATIONS); |
|
| 65 | + $chart_style = (int) $request->get('chart_style', self::DEFAULT_STYLE); |
|
| 66 | + $fan_width = (int) $request->get('fan_width', self::DEFAULT_WIDTH); |
|
| 67 | + $generations = (int) $request->get('generations', self::DEFAULT_GENERATIONS); |
|
| 68 | 68 | |
| 69 | 69 | $fan_width = min($fan_width, self::MAXIMUM_WIDTH); |
| 70 | 70 | $fan_width = max($fan_width, self::MINIMUM_WIDTH); |
@@ -106,9 +106,9 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | $this->checkIndividualAccess($individual); |
| 108 | 108 | |
| 109 | - $chart_style = (int)$request->get('chart_style', self::DEFAULT_STYLE); |
|
| 110 | - $fan_width = (int)$request->get('fan_width', self::DEFAULT_WIDTH); |
|
| 111 | - $generations = (int)$request->get('generations', self::DEFAULT_GENERATIONS); |
|
| 109 | + $chart_style = (int) $request->get('chart_style', self::DEFAULT_STYLE); |
|
| 110 | + $fan_width = (int) $request->get('fan_width', self::DEFAULT_WIDTH); |
|
| 111 | + $generations = (int) $request->get('generations', self::DEFAULT_GENERATIONS); |
|
| 112 | 112 | |
| 113 | 113 | $fan_width = min($fan_width, self::MAXIMUM_WIDTH); |
| 114 | 114 | $fan_width = max($fan_width, self::MINIMUM_WIDTH); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $scale = $fanw / 640; |
| 138 | 138 | |
| 139 | 139 | // Create the image |
| 140 | - $image = imagecreate((int)$fanw, (int)$fanh); |
|
| 140 | + $image = imagecreate((int) $fanw, (int) $fanh); |
|
| 141 | 141 | |
| 142 | 142 | // Create colors |
| 143 | 143 | $transparent = imagecolorallocate($image, 0, 0, 0); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | ]; |
| 155 | 155 | |
| 156 | 156 | |
| 157 | - imagefilledrectangle($image, 0, 0, (int)$fanw, (int)$fanh, $transparent); |
|
| 157 | + imagefilledrectangle($image, 0, 0, (int) $fanw, (int) $fanh, $transparent); |
|
| 158 | 158 | |
| 159 | 159 | $fandeg = 90 * $chart_style; |
| 160 | 160 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | // clean current generation area |
| 170 | 170 | $deg2 = 360 + ($fandeg - 180) / 2; |
| 171 | 171 | $deg1 = $deg2 - $fandeg; |
| 172 | - imagefilledarc($image, (int)$cx, (int)$cy, (int)$rx, (int)$rx, (int)$deg1, (int)$deg2, $backgrounds['U'], IMG_ARC_PIE); |
|
| 172 | + imagefilledarc($image, (int) $cx, (int) $cy, (int) $rx, (int) $rx, (int) $deg1, (int) $deg2, $backgrounds['U'], IMG_ARC_PIE); |
|
| 173 | 173 | $rx -= 3; |
| 174 | 174 | |
| 175 | 175 | // calculate new angle |
@@ -199,15 +199,15 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | $background = $backgrounds[$person->getSex()]; |
| 201 | 201 | |
| 202 | - imagefilledarc($image, (int)$cx, (int)$cy, (int)$rx, (int)$rx, (int)$deg1, (int)$deg2, $background, IMG_ARC_PIE); |
|
| 202 | + imagefilledarc($image, (int) $cx, (int) $cy, (int) $rx, (int) $rx, (int) $deg1, (int) $deg2, $background, IMG_ARC_PIE); |
|
| 203 | 203 | |
| 204 | 204 | // split and center text by lines |
| 205 | - $wmax = (int)($angle * 7 / 7 * $scale); |
|
| 205 | + $wmax = (int) ($angle * 7 / 7 * $scale); |
|
| 206 | 206 | $wmax = min($wmax, 35 * $scale); |
| 207 | 207 | if ($gen == 0) { |
| 208 | 208 | $wmax = min($wmax, 17 * $scale); |
| 209 | 209 | } |
| 210 | - $text = $this->splitAlignText($text, (int)$wmax); |
|
| 210 | + $text = $this->splitAlignText($text, (int) $wmax); |
|
| 211 | 211 | |
| 212 | 212 | // text angle |
| 213 | 213 | $tangle = 270 - ($deg1 + $angle / 2); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | } |
| 377 | 377 | $line .= "$word"; |
| 378 | 378 | } else { |
| 379 | - $p = max(0, (int)(($maxlen - $len) / 2)); |
|
| 379 | + $p = max(0, (int) (($maxlen - $len) / 2)); |
|
| 380 | 380 | if (!empty($line)) { |
| 381 | 381 | $line = str_repeat(' ', $p) . $line; // center alignment using spaces |
| 382 | 382 | $text .= $line . "\n"; |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | if (in_array(ord($line{0}), $RTLOrd)) { |
| 392 | 392 | $len /= 2; |
| 393 | 393 | } |
| 394 | - $p = max(0, (int)(($maxlen - $len) / 2)); |
|
| 394 | + $p = max(0, (int) (($maxlen - $len) / 2)); |
|
| 395 | 395 | $line = str_repeat(' ', $p) . $line; // center alignment using spaces |
| 396 | 396 | $text .= $line; |
| 397 | 397 | } |
@@ -411,9 +411,9 @@ discard block |
||
| 411 | 411 | { |
| 412 | 412 | return imagecolorallocate( |
| 413 | 413 | $image, |
| 414 | - (int)hexdec(substr($css_color, 0, 2)), |
|
| 415 | - (int)hexdec(substr($css_color, 2, 2)), |
|
| 416 | - (int)hexdec(substr($css_color, 4, 2)) |
|
| 414 | + (int) hexdec(substr($css_color, 0, 2)), |
|
| 415 | + (int) hexdec(substr($css_color, 2, 2)), |
|
| 416 | + (int) hexdec(substr($css_color, 4, 2)) |
|
| 417 | 417 | ); |
| 418 | 418 | } |
| 419 | 419 | |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | $z_axis = $this->axisAll(); |
| 577 | 577 | // The stats query doesn't have an "all" function, so query M/F/U separately |
| 578 | 578 | foreach (['M', 'F', 'U'] as $sex) { |
| 579 | - $rows = $stats->statsMarrAgeQuery(false, $sex); |
|
| 579 | + $rows = $stats->statsMarrAgeQuery(false, $sex); |
|
| 580 | 580 | $indi = []; |
| 581 | 581 | foreach ($rows as $row) { |
| 582 | 582 | if (!in_array($row->d_gid, $indi)) { |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | case self::Z_AXIS_SEX: |
| 590 | 590 | $z_axis = $this->axisSexes(); |
| 591 | 591 | foreach (array_keys($z_axis) as $sex) { |
| 592 | - $rows = $stats->statsMarrAgeQuery(false, $sex); |
|
| 592 | + $rows = $stats->statsMarrAgeQuery(false, $sex); |
|
| 593 | 593 | $indi = []; |
| 594 | 594 | foreach ($rows as $row) { |
| 595 | 595 | if (!in_array($row->d_gid, $indi)) { |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | // The stats query doesn't have an "all" function, so query M/F/U separately |
| 606 | 606 | foreach (['M', 'F', 'U'] as $sex) { |
| 607 | 607 | $prev_boundary = 0; |
| 608 | - $indi = []; |
|
| 608 | + $indi = []; |
|
| 609 | 609 | foreach (array_keys($z_axis) as $boundary) { |
| 610 | 610 | $rows = $stats->statsMarrAgeQuery(false, $sex, $prev_boundary, $boundary); |
| 611 | 611 | foreach ($rows as $row) { |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $breadcrumbs[] = I18N::translate('Add'); |
| 107 | 107 | } else { |
| 108 | 108 | $breadcrumbs[] = I18N::translate('Edit'); |
| 109 | - $title .= ' — ' . I18N::translate('Edit'); |
|
| 109 | + $title .= ' — ' . I18N::translate('Edit'); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | return $this->viewResponse('admin/location-edit', [ |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | public function exportLocations(Request $request): Response |
| 242 | 242 | { |
| 243 | - $parent_id = (int)$request->get('parent_id'); |
|
| 243 | + $parent_id = (int) $request->get('parent_id'); |
|
| 244 | 244 | $format = $request->get('format'); |
| 245 | 245 | $maxlevel = (int) Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne(); |
| 246 | 246 | $startfqpn = []; |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | */ |
| 299 | 299 | public function importLocations(Request $request): Response |
| 300 | 300 | { |
| 301 | - $parent_id = (int) $request->get('parent_id'); |
|
| 301 | + $parent_id = (int) $request->get('parent_id'); |
|
| 302 | 302 | |
| 303 | 303 | $files = array_merge( |
| 304 | 304 | glob(WT_DATA_DIR . 'places/*.csv'), |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | if (is_file($filename)) { |
| 354 | - $string = file_get_contents($filename); |
|
| 354 | + $string = file_get_contents($filename); |
|
| 355 | 355 | |
| 356 | 356 | // Check the filetype |
| 357 | 357 | if (stripos($string, 'FeatureCollection') !== false) { |
@@ -401,10 +401,10 @@ discard block |
||
| 401 | 401 | usort( |
| 402 | 402 | $places, |
| 403 | 403 | function (array $a, array $b) { |
| 404 | - if ((int)$a['pl_level'] === (int)$b['pl_level']) { |
|
| 404 | + if ((int) $a['pl_level'] === (int) $b['pl_level']) { |
|
| 405 | 405 | return I18N::strcasecmp($a['fqpn'], $b['fqpn']); |
| 406 | 406 | } else { |
| 407 | - return (int)$a['pl_level'] - (int)$b['pl_level']; |
|
| 407 | + return (int) $a['pl_level'] - (int) $b['pl_level']; |
|
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | ); |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | "INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place)" . |
| 522 | 522 | " VALUES (:id, :parent, :level, :place)" |
| 523 | 523 | ); |
| 524 | - $checkRecordQry = Database::prepare( |
|
| 524 | + $checkRecordQry = Database::prepare( |
|
| 525 | 525 | "SELECT pl1.pl_id" . |
| 526 | 526 | " FROM `##placelocation` AS pl1" . |
| 527 | 527 | " LEFT JOIN `##placelocation` AS pl2 ON (pl1.pl_parent_id = pl2.pl_id)" . |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $user_list[$tmp_user->getUserName()] = $tmp_user->getUserName(); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - $action = $request->get('action'); |
|
| 168 | + $action = $request->get('action'); |
|
| 169 | 169 | |
| 170 | 170 | // @TODO This ought to be a POST action |
| 171 | 171 | if ($action === 'delete') { |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public function changesLogData(Request $request): Response |
| 233 | 233 | { |
| 234 | - list($select, , $where, $args1) = $this->changesQuery($request); |
|
| 234 | + list($select,, $where, $args1) = $this->changesQuery($request); |
|
| 235 | 235 | list($order_by, $limit, $args2) = $this->dataTablesPagination($request); |
| 236 | 236 | |
| 237 | 237 | $rows = Database::prepare( |
@@ -239,8 +239,8 @@ discard block |
||
| 239 | 239 | )->execute(array_merge($args1, $args2))->fetchAll(); |
| 240 | 240 | |
| 241 | 241 | // Total filtered/unfiltered rows |
| 242 | - $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
| 243 | - $recordsTotal = (int)Database::prepare("SELECT COUNT(*) FROM `##change`")->fetchOne(); |
|
| 242 | + $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
| 243 | + $recordsTotal = (int) Database::prepare("SELECT COUNT(*) FROM `##change`")->fetchOne(); |
|
| 244 | 244 | |
| 245 | 245 | $data = []; |
| 246 | 246 | $algorithm = new MyersDiff(); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | |
| 292 | 292 | // See http://www.datatables.net/usage/server-side |
| 293 | 293 | return new JsonResponse([ |
| 294 | - 'draw' => (int)$request->get('draw'), |
|
| 294 | + 'draw' => (int) $request->get('draw'), |
|
| 295 | 295 | 'recordsTotal' => $recordsTotal, |
| 296 | 296 | 'recordsFiltered' => $recordsFiltered, |
| 297 | 297 | 'data' => $data, |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | */ |
| 308 | 308 | public function changesLogDownload(Request $request): Response |
| 309 | 309 | { |
| 310 | - list($select, , $where, $args) = $this->changesQuery($request); |
|
| 310 | + list($select,, $where, $args) = $this->changesQuery($request); |
|
| 311 | 311 | |
| 312 | 312 | $rows = Database::prepare($select . $where)->execute($args)->fetchAll(); |
| 313 | 313 | |
@@ -449,8 +449,8 @@ discard block |
||
| 449 | 449 | 'RESN', |
| 450 | 450 | ]; |
| 451 | 451 | |
| 452 | - $start = (int)$request->get('start', 0); |
|
| 453 | - $length = (int)$request->get('length', 20); |
|
| 452 | + $start = (int) $request->get('start', 0); |
|
| 453 | + $length = (int) $request->get('length', 20); |
|
| 454 | 454 | $search = $request->get('search', []); |
| 455 | 455 | $search = $search['value'] ?? ''; |
| 456 | 456 | |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | $args = []; |
| 471 | 471 | |
| 472 | 472 | if ($search !== '') { |
| 473 | - $where .= " AND (multimedia_file_refn LIKE CONCAT('%', :search1, '%') OR multimedia_file_refn LIKE CONCAT('%', :search2, '%'))"; |
|
| 473 | + $where .= " AND (multimedia_file_refn LIKE CONCAT('%', :search1, '%') OR multimedia_file_refn LIKE CONCAT('%', :search2, '%'))"; |
|
| 474 | 474 | $args['search1'] = $search; |
| 475 | 475 | $args['search2'] = $search; |
| 476 | 476 | } |
@@ -489,8 +489,8 @@ discard block |
||
| 489 | 489 | )->fetchAll(); |
| 490 | 490 | |
| 491 | 491 | // Total filtered/unfiltered rows |
| 492 | - $recordsFiltered = (int)Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
| 493 | - $recordsTotal = (int)Database::prepare($select2)->fetchOne(); |
|
| 492 | + $recordsFiltered = (int) Database::prepare("SELECT FOUND_ROWS()")->fetchOne(); |
|
| 493 | + $recordsTotal = (int) Database::prepare($select2)->fetchOne(); |
|
| 494 | 494 | |
| 495 | 495 | // Turn each row from the query into a row for the table |
| 496 | 496 | $data = array_map(function (stdClass $datum) use ($ignore_facts) { |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | }, $data); |
| 533 | 533 | |
| 534 | 534 | return new JsonResponse([ |
| 535 | - 'draw' => (int)$request->get('draw'), |
|
| 535 | + 'draw' => (int) $request->get('draw'), |
|
| 536 | 536 | 'recordsTotal' => $recordsTotal, |
| 537 | 537 | 'recordsFiltered' => $recordsFiltered, |
| 538 | 538 | 'data' => $data, |
@@ -621,8 +621,8 @@ discard block |
||
| 621 | 621 | */ |
| 622 | 622 | public function webtrees1ThumbnailsData(Request $request): JsonResponse |
| 623 | 623 | { |
| 624 | - $start = (int)$request->get('start', 0); |
|
| 625 | - $length = (int)$request->get('length', 20); |
|
| 624 | + $start = (int) $request->get('start', 0); |
|
| 625 | + $length = (int) $request->get('length', 20); |
|
| 626 | 626 | $search = $request->get('search', []); |
| 627 | 627 | $search = $search['value'] ?? ''; |
| 628 | 628 | |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | $data = array_map(function (string $thumbnail) { |
| 654 | 654 | $original = $this->findOriginalFileFromThumbnail($thumbnail); |
| 655 | 655 | |
| 656 | - $original_url = route('unused-media-thumbnail', [ |
|
| 656 | + $original_url = route('unused-media-thumbnail', [ |
|
| 657 | 657 | 'folder' => dirname($original), |
| 658 | 658 | 'file' => basename($original), |
| 659 | 659 | 'w' => 100, |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | }, $thumbnails); |
| 696 | 696 | |
| 697 | 697 | return new JsonResponse([ |
| 698 | - 'draw' => (int)$request->get('draw'), |
|
| 698 | + 'draw' => (int) $request->get('draw'), |
|
| 699 | 699 | 'recordsTotal' => $recordsTotal, |
| 700 | 700 | 'recordsFiltered' => $recordsFiltered, |
| 701 | 701 | 'data' => $data, |
@@ -1021,7 +1021,7 @@ discard block |
||
| 1021 | 1021 | */ |
| 1022 | 1022 | public function treePrivacyUpdate(Request $request, Tree $tree): RedirectResponse |
| 1023 | 1023 | { |
| 1024 | - foreach ((array)$request->get('delete') as $default_resn_id) { |
|
| 1024 | + foreach ((array) $request->get('delete') as $default_resn_id) { |
|
| 1025 | 1025 | Database::prepare( |
| 1026 | 1026 | "DELETE FROM `##default_resn` WHERE default_resn_id = :default_resn_id" |
| 1027 | 1027 | )->execute([ |
@@ -1029,13 +1029,13 @@ discard block |
||
| 1029 | 1029 | ]); |
| 1030 | 1030 | } |
| 1031 | 1031 | |
| 1032 | - $xrefs = (array)$request->get('xref'); |
|
| 1033 | - $tag_types = (array)$request->get('tag_type'); |
|
| 1034 | - $resns = (array)$request->get('resn'); |
|
| 1032 | + $xrefs = (array) $request->get('xref'); |
|
| 1033 | + $tag_types = (array) $request->get('tag_type'); |
|
| 1034 | + $resns = (array) $request->get('resn'); |
|
| 1035 | 1035 | |
| 1036 | 1036 | foreach ($xrefs as $n => $xref) { |
| 1037 | - $tag_type = (string)$tag_types[$n]; |
|
| 1038 | - $resn = (string)$resns[$n]; |
|
| 1037 | + $tag_type = (string) $tag_types[$n]; |
|
| 1038 | + $resn = (string) $resns[$n]; |
|
| 1039 | 1039 | |
| 1040 | 1040 | if ($tag_type !== '' || $xref !== '') { |
| 1041 | 1041 | // Delete any existing data |
@@ -1081,10 +1081,10 @@ discard block |
||
| 1081 | 1081 | FlashMessages::addMessage(I18N::translate('The preferences for the family tree “%s” have been updated.', e($tree->getTitle()), 'success')); |
| 1082 | 1082 | |
| 1083 | 1083 | // Coming soon... |
| 1084 | - if ((bool)$request->get('all_trees')) { |
|
| 1084 | + if ((bool) $request->get('all_trees')) { |
|
| 1085 | 1085 | FlashMessages::addMessage(I18N::translate('The preferences for all family trees have been updated.', e($tree->getTitle())), 'success'); |
| 1086 | 1086 | } |
| 1087 | - if ((bool)$request->get('new_trees')) { |
|
| 1087 | + if ((bool) $request->get('new_trees')) { |
|
| 1088 | 1088 | FlashMessages::addMessage(I18N::translate('The preferences for new family trees have been updated.', e($tree->getTitle())), 'success'); |
| 1089 | 1089 | } |
| 1090 | 1090 | |
@@ -1107,7 +1107,7 @@ discard block |
||
| 1107 | 1107 | foreach ($modules as $module) { |
| 1108 | 1108 | foreach (Tree::getAll() as $tree) { |
| 1109 | 1109 | $key = 'access-' . $module->getName() . '-' . $tree->getTreeId(); |
| 1110 | - $access_level = (int)$request->get($key, $module->defaultAccessLevel()); |
|
| 1110 | + $access_level = (int) $request->get($key, $module->defaultAccessLevel()); |
|
| 1111 | 1111 | |
| 1112 | 1112 | Database::prepare("REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (:module_name, :tree_id, :component, :access_level)")->execute([ |
| 1113 | 1113 | 'module_name' => $module->getName(), |
@@ -1134,7 +1134,7 @@ discard block |
||
| 1134 | 1134 | $module_status = Database::prepare("SELECT module_name, status FROM `##module`")->fetchAssoc(); |
| 1135 | 1135 | |
| 1136 | 1136 | foreach ($modules as $module) { |
| 1137 | - $new_status = (bool)$request->get('status-' . $module->getName()) ? 'enabled' : 'disabled'; |
|
| 1137 | + $new_status = (bool) $request->get('status-' . $module->getName()) ? 'enabled' : 'disabled'; |
|
| 1138 | 1138 | $old_status = $module_status[$module->getName()]; |
| 1139 | 1139 | |
| 1140 | 1140 | if ($new_status !== $old_status) { |
@@ -1197,36 +1197,36 @@ discard block |
||
| 1197 | 1197 | $where = ' WHERE 1'; |
| 1198 | 1198 | $args = []; |
| 1199 | 1199 | if ($search !== '') { |
| 1200 | - $where .= " AND (old_gedcom LIKE CONCAT('%', :search_1, '%') OR new_gedcom LIKE CONCAT('%', :search_2, '%'))"; |
|
| 1200 | + $where .= " AND (old_gedcom LIKE CONCAT('%', :search_1, '%') OR new_gedcom LIKE CONCAT('%', :search_2, '%'))"; |
|
| 1201 | 1201 | $args['search_1'] = $search; |
| 1202 | 1202 | $args['search_2'] = $search; |
| 1203 | 1203 | } |
| 1204 | 1204 | if ($from !== '') { |
| 1205 | - $where .= " AND change_time >= :from"; |
|
| 1205 | + $where .= " AND change_time >= :from"; |
|
| 1206 | 1206 | $args['from'] = $from; |
| 1207 | 1207 | } |
| 1208 | 1208 | if ($to !== '') { |
| 1209 | - $where .= ' AND change_time < TIMESTAMPADD(DAY, 1 , :to)'; // before end of the day |
|
| 1209 | + $where .= ' AND change_time < TIMESTAMPADD(DAY, 1 , :to)'; // before end of the day |
|
| 1210 | 1210 | $args['to'] = $to; |
| 1211 | 1211 | } |
| 1212 | 1212 | if ($type !== '') { |
| 1213 | - $where .= ' AND status = :status'; |
|
| 1213 | + $where .= ' AND status = :status'; |
|
| 1214 | 1214 | $args['status'] = $type; |
| 1215 | 1215 | } |
| 1216 | 1216 | if ($oldged !== '') { |
| 1217 | - $where .= " AND old_gedcom LIKE CONCAT('%', :old_ged, '%')"; |
|
| 1217 | + $where .= " AND old_gedcom LIKE CONCAT('%', :old_ged, '%')"; |
|
| 1218 | 1218 | $args['old_ged'] = $oldged; |
| 1219 | 1219 | } |
| 1220 | 1220 | if ($newged !== '') { |
| 1221 | - $where .= " AND new_gedcom LIKE CONCAT('%', :new_ged, '%')"; |
|
| 1221 | + $where .= " AND new_gedcom LIKE CONCAT('%', :new_ged, '%')"; |
|
| 1222 | 1222 | $args['new_ged'] = $newged; |
| 1223 | 1223 | } |
| 1224 | 1224 | if ($xref !== '') { |
| 1225 | - $where .= " AND xref = :xref"; |
|
| 1225 | + $where .= " AND xref = :xref"; |
|
| 1226 | 1226 | $args['xref'] = $xref; |
| 1227 | 1227 | } |
| 1228 | 1228 | if ($username !== '') { |
| 1229 | - $where .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
| 1229 | + $where .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
| 1230 | 1230 | $args['user'] = $username; |
| 1231 | 1231 | } |
| 1232 | 1232 | if ($ged !== '') { |
@@ -1277,8 +1277,8 @@ discard block |
||
| 1277 | 1277 | */ |
| 1278 | 1278 | private function dataTablesPagination(Request $request): array |
| 1279 | 1279 | { |
| 1280 | - $start = (int)$request->get('start', '0'); |
|
| 1281 | - $length = (int)$request->get('length', '0'); |
|
| 1280 | + $start = (int) $request->get('start', '0'); |
|
| 1281 | + $length = (int) $request->get('length', '0'); |
|
| 1282 | 1282 | $order = $request->get('order', []); |
| 1283 | 1283 | $args = []; |
| 1284 | 1284 | |
@@ -1429,7 +1429,7 @@ discard block |
||
| 1429 | 1429 | } |
| 1430 | 1430 | |
| 1431 | 1431 | // The maximum difference is 255 (black versus white). |
| 1432 | - return 100 - (int)($max_difference * 100 / 255); |
|
| 1432 | + return 100 - (int) ($max_difference * 100 / 255); |
|
| 1433 | 1433 | } |
| 1434 | 1434 | |
| 1435 | 1435 | /** |
@@ -1460,7 +1460,7 @@ discard block |
||
| 1460 | 1460 | $pixels[$x] = []; |
| 1461 | 1461 | for ($y = 0; $y < $size; ++$y) { |
| 1462 | 1462 | $pixel = $image->pickColor($x, $y); |
| 1463 | - $pixels[$x][$y] = (int)(($pixel[0] + $pixel[1] + $pixel[2]) / 3); |
|
| 1463 | + $pixels[$x][$y] = (int) (($pixel[0] + $pixel[1] + $pixel[2]) / 3); |
|
| 1464 | 1464 | } |
| 1465 | 1465 | } |
| 1466 | 1466 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | class PedigreeMapModule extends AbstractModule implements ModuleChartInterface |
| 37 | 37 | { |
| 38 | - const LINE_COLORS = [ |
|
| 38 | + const LINE_COLORS = [ |
|
| 39 | 39 | '#FF0000', |
| 40 | 40 | // Red |
| 41 | 41 | '#00FF00', |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $color = self::LINE_COLORS[log($id, 2) % $color_count]; |
| 141 | 141 | $icon['color'] = $color; //make icon color the same as the line |
| 142 | 142 | $sosa_points[$id] = $event->getLatLonJSArray(); |
| 143 | - $sosa_parent = (int)floor($id / 2); |
|
| 143 | + $sosa_parent = (int) floor($id / 2); |
|
| 144 | 144 | if (array_key_exists($sosa_parent, $sosa_points)) { |
| 145 | 145 | // Would like to use a GeometryCollection to hold LineStrings |
| 146 | 146 | // rather than generate polylines but the MarkerCluster library |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | 'icon' => $icon, |
| 169 | 169 | 'tooltip' => $event->toolTip(), |
| 170 | 170 | 'summary' => view('modules/pedigree-map/event-sidebar', $event->shortSummary('pedigree', $id)), |
| 171 | - 'zoom' => (int)$event->getZoom(), |
|
| 171 | + 'zoom' => (int) $event->getZoom(), |
|
| 172 | 172 | ], |
| 173 | 173 | ]; |
| 174 | 174 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | { |
| 189 | 189 | $xref = $request->get('reference'); |
| 190 | 190 | $individual = Individual::getInstance($xref, $tree); |
| 191 | - $generations = (int)$request->get( |
|
| 191 | + $generations = (int) $request->get( |
|
| 192 | 192 | 'generations', |
| 193 | 193 | $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS') |
| 194 | 194 | ); |
@@ -241,14 +241,14 @@ discard block |
||
| 241 | 241 | function ($item) { |
| 242 | 242 | return preg_replace('/[^a-z\d]/i', '', strtolower($item)); |
| 243 | 243 | }, |
| 244 | - (array)$provider->styles |
|
| 244 | + (array) $provider->styles |
|
| 245 | 245 | ); |
| 246 | 246 | |
| 247 | - $key = preg_replace('/[^a-z\d]/i', '', strtolower((string)$provider->name)); |
|
| 247 | + $key = preg_replace('/[^a-z\d]/i', '', strtolower((string) $provider->name)); |
|
| 248 | 248 | |
| 249 | 249 | self::$map_providers[$key] = [ |
| 250 | - 'name' => (string)$provider->name, |
|
| 251 | - 'styles' => array_combine($style_keys, (array)$provider->styles), |
|
| 250 | + 'name' => (string) $provider->name, |
|
| 251 | + 'styles' => array_combine($style_keys, (array) $provider->styles), |
|
| 252 | 252 | ]; |
| 253 | 253 | } |
| 254 | 254 | } catch (Exception $ex) { |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | 'provider' => 'openstreetmap', |
| 258 | 258 | 'style' => 'mapnik', |
| 259 | 259 | ]; |
| 260 | - self::$map_providers = [ |
|
| 260 | + self::$map_providers = [ |
|
| 261 | 261 | 'openstreetmap' => [ |
| 262 | 262 | 'name' => 'OpenStreetMap', |
| 263 | 263 | 'styles' => ['mapnik' => 'Mapnik'], |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | throw new IndividualAccessDeniedException(); |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | - return (object)[ |
|
| 321 | + return (object) [ |
|
| 322 | 322 | 'name' => 'modules/pedigree-map/pedigree-map-page', |
| 323 | 323 | 'data' => [ |
| 324 | 324 | 'module' => $this->getName(), |
@@ -163,11 +163,11 @@ discard block |
||
| 163 | 163 | $query = $request->get('query', ''); |
| 164 | 164 | |
| 165 | 165 | // What type of records to search? |
| 166 | - $search_individuals = (bool)$request->get('search_individuals'); |
|
| 167 | - $search_families = (bool)$request->get('search_families'); |
|
| 168 | - $search_repositories = (bool)$request->get('search_repositories'); |
|
| 169 | - $search_sources = (bool)$request->get('search_sources'); |
|
| 170 | - $search_notes = (bool)$request->get('search_notes'); |
|
| 166 | + $search_individuals = (bool) $request->get('search_individuals'); |
|
| 167 | + $search_families = (bool) $request->get('search_families'); |
|
| 168 | + $search_repositories = (bool) $request->get('search_repositories'); |
|
| 169 | + $search_sources = (bool) $request->get('search_sources'); |
|
| 170 | + $search_notes = (bool) $request->get('search_notes'); |
|
| 171 | 171 | |
| 172 | 172 | // Default to individuals only |
| 173 | 173 | if (!$search_individuals && !$search_families && !$search_repositories && !$search_sources && !$search_notes) { |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $all_trees = [$tree]; |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - $search_tree_names = (array)$request->get('search_trees', []); |
|
| 187 | + $search_tree_names = (array) $request->get('search_trees', []); |
|
| 188 | 188 | |
| 189 | 189 | $search_trees = array_filter($all_trees, function (Tree $tree) use ($search_tree_names): bool { |
| 190 | 190 | return in_array($tree->getName(), $search_tree_names); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $all_trees = [$tree]; |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | - $search_tree_names = (array)$request->get('search_trees', []); |
|
| 293 | + $search_tree_names = (array) $request->get('search_trees', []); |
|
| 294 | 294 | |
| 295 | 295 | $search_trees = array_filter($all_trees, function (Tree $tree) use ($search_tree_names): bool { |
| 296 | 296 | return in_array($tree->getName(), $search_tree_names); |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | |
| 641 | 641 | foreach ($search_terms as $n => $q) { |
| 642 | 642 | $queryregex[] = preg_quote(I18N::strtoupper($q), '/'); |
| 643 | - $sql .= " AND f_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 643 | + $sql .= " AND f_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 644 | 644 | $args['collate_' . $n] = I18N::collation(); |
| 645 | 645 | $args['query_' . $n] = Database::escapeLike($q); |
| 646 | 646 | } |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | */ |
| 689 | 689 | private function searchFamilyNames(array $search_terms, array $search_trees): array |
| 690 | 690 | { |
| 691 | - $sql = |
|
| 691 | + $sql = |
|
| 692 | 692 | "SELECT DISTINCT f_id AS xref, f_file AS gedcom_id, f_gedcom AS gedcom" . |
| 693 | 693 | " FROM `##families`" . |
| 694 | 694 | " LEFT JOIN `##name` husb ON f_husb = husb.n_id AND f_file = husb.n_file" . |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | $args = []; |
| 698 | 698 | |
| 699 | 699 | foreach ($search_terms as $n => $q) { |
| 700 | - $sql .= " AND (husb.n_full COLLATE :husb_collate_" . $n . " LIKE CONCAT('%', :husb_query_" . $n . ", '%') OR wife.n_full COLLATE :wife_collate_" . $n . " LIKE CONCAT('%', :wife_query_" . $n . ", '%'))"; |
|
| 700 | + $sql .= " AND (husb.n_full COLLATE :husb_collate_" . $n . " LIKE CONCAT('%', :husb_query_" . $n . ", '%') OR wife.n_full COLLATE :wife_collate_" . $n . " LIKE CONCAT('%', :wife_query_" . $n . ", '%'))"; |
|
| 701 | 701 | $args['husb_collate_' . $n] = I18N::collation(); |
| 702 | 702 | $args['husb_query_' . $n] = Database::escapeLike($q); |
| 703 | 703 | $args['wife_collate_' . $n] = I18N::collation(); |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | |
| 750 | 750 | foreach ($search_terms as $n => $q) { |
| 751 | 751 | $queryregex[] = preg_quote(I18N::strtoupper($q), '/'); |
| 752 | - $sql .= " AND i_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 752 | + $sql .= " AND i_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 753 | 753 | $args['collate_' . $n] = I18N::collation(); |
| 754 | 754 | $args['query_' . $n] = Database::escapeLike($q); |
| 755 | 755 | } |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | } |
| 897 | 897 | |
| 898 | 898 | // Add the where clause |
| 899 | - $sql .= " WHERE ind.i_file=?"; |
|
| 899 | + $sql .= " WHERE ind.i_file=?"; |
|
| 900 | 900 | $bind[] = $tree->getTreeId(); |
| 901 | 901 | |
| 902 | 902 | foreach ($fields as $field_name => $field_value) { |
@@ -907,15 +907,15 @@ discard block |
||
| 907 | 907 | case 'GIVN': |
| 908 | 908 | switch ($modifiers[$field_name]) { |
| 909 | 909 | case 'EXACT': |
| 910 | - $sql .= " AND i_n.n_givn=?"; |
|
| 910 | + $sql .= " AND i_n.n_givn=?"; |
|
| 911 | 911 | $bind[] = $field_value; |
| 912 | 912 | break; |
| 913 | 913 | case 'BEGINS': |
| 914 | - $sql .= " AND i_n.n_givn LIKE CONCAT(?, '%')"; |
|
| 914 | + $sql .= " AND i_n.n_givn LIKE CONCAT(?, '%')"; |
|
| 915 | 915 | $bind[] = $field_value; |
| 916 | 916 | break; |
| 917 | 917 | case 'CONTAINS': |
| 918 | - $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 918 | + $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 919 | 919 | $bind[] = $field_value; |
| 920 | 920 | break; |
| 921 | 921 | case 'SDX_STD': |
@@ -929,7 +929,7 @@ discard block |
||
| 929 | 929 | $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
| 930 | 930 | } else { |
| 931 | 931 | // No phonetic content? Use a substring match |
| 932 | - $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 932 | + $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 933 | 933 | $bind[] = $field_value; |
| 934 | 934 | } |
| 935 | 935 | break; |
@@ -945,7 +945,7 @@ discard block |
||
| 945 | 945 | $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
| 946 | 946 | } else { |
| 947 | 947 | // No phonetic content? Use a substring match |
| 948 | - $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 948 | + $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 949 | 949 | $bind[] = $field_value; |
| 950 | 950 | } |
| 951 | 951 | break; |
@@ -954,15 +954,15 @@ discard block |
||
| 954 | 954 | case 'SURN': |
| 955 | 955 | switch ($modifiers[$field_name]) { |
| 956 | 956 | case 'EXACT': |
| 957 | - $sql .= " AND i_n.n_surname=?"; |
|
| 957 | + $sql .= " AND i_n.n_surname=?"; |
|
| 958 | 958 | $bind[] = $field_value; |
| 959 | 959 | break; |
| 960 | 960 | case 'BEGINS': |
| 961 | - $sql .= " AND i_n.n_surname LIKE CONCAT(?, '%')"; |
|
| 961 | + $sql .= " AND i_n.n_surname LIKE CONCAT(?, '%')"; |
|
| 962 | 962 | $bind[] = $field_value; |
| 963 | 963 | break; |
| 964 | 964 | case 'CONTAINS': |
| 965 | - $sql .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')"; |
|
| 965 | + $sql .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')"; |
|
| 966 | 966 | $bind[] = $field_value; |
| 967 | 967 | break; |
| 968 | 968 | case 'SDX_STD': |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | $sql .= " AND (" . implode(' OR ', $sdx) . ")"; |
| 977 | 977 | } else { |
| 978 | 978 | // No phonetic content? Use a substring match |
| 979 | - $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')"; |
|
| 979 | + $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')"; |
|
| 980 | 980 | $bind[] = $field_value; |
| 981 | 981 | } |
| 982 | 982 | break; |
@@ -993,7 +993,7 @@ discard block |
||
| 993 | 993 | break; |
| 994 | 994 | } else { |
| 995 | 995 | // No phonetic content? Use a substring match |
| 996 | - $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')"; |
|
| 996 | + $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')"; |
|
| 997 | 997 | $bind[] = $field_value; |
| 998 | 998 | } |
| 999 | 999 | } |
@@ -1002,7 +1002,7 @@ discard block |
||
| 1002 | 1002 | case '_MARNM': |
| 1003 | 1003 | case '_HEB': |
| 1004 | 1004 | case '_AKA': |
| 1005 | - $sql .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')"; |
|
| 1005 | + $sql .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')"; |
|
| 1006 | 1006 | $bind[] = $parts[1]; |
| 1007 | 1007 | $bind[] = $field_value; |
| 1008 | 1008 | break; |
@@ -1012,7 +1012,7 @@ discard block |
||
| 1012 | 1012 | $date = new Date($field_value); |
| 1013 | 1013 | if ($date->isOK()) { |
| 1014 | 1014 | $delta = 365 * ($modifiers[$field_name] ?? 0); |
| 1015 | - $sql .= " AND i_d.d_fact=? AND i_d.d_julianday1>=? AND i_d.d_julianday2<=?"; |
|
| 1015 | + $sql .= " AND i_d.d_fact=? AND i_d.d_julianday1>=? AND i_d.d_julianday2<=?"; |
|
| 1016 | 1016 | $bind[] = $parts[0]; |
| 1017 | 1017 | $bind[] = $date->minimumJulianDay() - $delta; |
| 1018 | 1018 | $bind[] = $date->maximumJulianDay() + $delta; |
@@ -1022,7 +1022,7 @@ discard block |
||
| 1022 | 1022 | $date = new Date($field_value); |
| 1023 | 1023 | if ($date->isOK()) { |
| 1024 | 1024 | $delta = 365 * $modifiers[$field_name]; |
| 1025 | - $sql .= " AND f_d.d_fact=? AND f_d.d_julianday1>=? AND f_d.d_julianday2<=?"; |
|
| 1025 | + $sql .= " AND f_d.d_fact=? AND f_d.d_julianday1>=? AND f_d.d_julianday2<=?"; |
|
| 1026 | 1026 | $bind[] = $parts[1]; |
| 1027 | 1027 | $bind[] = $date->minimumJulianDay() - $delta; |
| 1028 | 1028 | $bind[] = $date->maximumJulianDay() + $delta; |
@@ -1030,12 +1030,12 @@ discard block |
||
| 1030 | 1030 | } elseif ($parts[1] === 'PLAC') { |
| 1031 | 1031 | // *:PLAC |
| 1032 | 1032 | // SQL can only link a place to a person/family, not to an event. |
| 1033 | - $sql .= " AND i_p.place LIKE CONCAT('%', ?, '%')"; |
|
| 1033 | + $sql .= " AND i_p.place LIKE CONCAT('%', ?, '%')"; |
|
| 1034 | 1034 | $bind[] = $field_value; |
| 1035 | 1035 | } elseif ($parts[0] === 'FAMS' && $parts[2] === 'PLAC') { |
| 1036 | 1036 | // FAMS:*:PLAC |
| 1037 | 1037 | // SQL can only link a place to a person/family, not to an event. |
| 1038 | - $sql .= " AND f_p.place LIKE CONCAT('%', ?, '%')"; |
|
| 1038 | + $sql .= " AND f_p.place LIKE CONCAT('%', ?, '%')"; |
|
| 1039 | 1039 | $bind[] = $field_value; |
| 1040 | 1040 | } elseif ($parts[0] === 'FAMC' && $parts[2] === 'NAME') { |
| 1041 | 1041 | $table = $parts[1] === 'HUSB' ? 'f_n' : 'm_n'; |
@@ -1044,15 +1044,15 @@ discard block |
||
| 1044 | 1044 | case 'GIVN': |
| 1045 | 1045 | switch ($modifiers[$field_name]) { |
| 1046 | 1046 | case 'EXACT': |
| 1047 | - $sql .= " AND {$table}.n_givn=?"; |
|
| 1047 | + $sql .= " AND {$table}.n_givn=?"; |
|
| 1048 | 1048 | $bind[] = $field_value; |
| 1049 | 1049 | break; |
| 1050 | 1050 | case 'BEGINS': |
| 1051 | - $sql .= " AND {$table}.n_givn LIKE CONCAT(?, '%')"; |
|
| 1051 | + $sql .= " AND {$table}.n_givn LIKE CONCAT(?, '%')"; |
|
| 1052 | 1052 | $bind[] = $field_value; |
| 1053 | 1053 | break; |
| 1054 | 1054 | case 'CONTAINS': |
| 1055 | - $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 1055 | + $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 1056 | 1056 | $bind[] = $field_value; |
| 1057 | 1057 | break; |
| 1058 | 1058 | case 'SDX_STD': |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
| 1067 | 1067 | } else { |
| 1068 | 1068 | // No phonetic content? Use a substring match |
| 1069 | - $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 1069 | + $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 1070 | 1070 | $bind[] = $field_value; |
| 1071 | 1071 | } |
| 1072 | 1072 | break; |
@@ -1083,7 +1083,7 @@ discard block |
||
| 1083 | 1083 | break; |
| 1084 | 1084 | } else { |
| 1085 | 1085 | // No phonetic content? Use a substring match |
| 1086 | - $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 1086 | + $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')"; |
|
| 1087 | 1087 | $bind[] = $field_value; |
| 1088 | 1088 | } |
| 1089 | 1089 | } |
@@ -1091,15 +1091,15 @@ discard block |
||
| 1091 | 1091 | case 'SURN': |
| 1092 | 1092 | switch ($modifiers[$field_name]) { |
| 1093 | 1093 | case 'EXACT': |
| 1094 | - $sql .= " AND {$table}.n_surname=?"; |
|
| 1094 | + $sql .= " AND {$table}.n_surname=?"; |
|
| 1095 | 1095 | $bind[] = $field_value; |
| 1096 | 1096 | break; |
| 1097 | 1097 | case 'BEGINS': |
| 1098 | - $sql .= " AND {$table}.n_surname LIKE CONCAT(?, '%')"; |
|
| 1098 | + $sql .= " AND {$table}.n_surname LIKE CONCAT(?, '%')"; |
|
| 1099 | 1099 | $bind[] = $field_value; |
| 1100 | 1100 | break; |
| 1101 | 1101 | case 'CONTAINS': |
| 1102 | - $sql .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')"; |
|
| 1102 | + $sql .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')"; |
|
| 1103 | 1103 | $bind[] = $field_value; |
| 1104 | 1104 | break; |
| 1105 | 1105 | case 'SDX_STD': |
@@ -1113,7 +1113,7 @@ discard block |
||
| 1113 | 1113 | $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
| 1114 | 1114 | } else { |
| 1115 | 1115 | // No phonetic content? Use a substring match |
| 1116 | - $sql .= " AND {$table}.n_surn LIKE CONCAT('%', ?, '%')"; |
|
| 1116 | + $sql .= " AND {$table}.n_surn LIKE CONCAT('%', ?, '%')"; |
|
| 1117 | 1117 | $bind[] = $field_value; |
| 1118 | 1118 | } |
| 1119 | 1119 | break; |
@@ -1129,7 +1129,7 @@ discard block |
||
| 1129 | 1129 | $sql .= ' AND (' . implode(' OR ', $sdx) . ')'; |
| 1130 | 1130 | } else { |
| 1131 | 1131 | // No phonetic content? Use a substring match |
| 1132 | - $sql .= " AND {$table}.n_surn LIKE CONCAT('%', ?, '%')"; |
|
| 1132 | + $sql .= " AND {$table}.n_surn LIKE CONCAT('%', ?, '%')"; |
|
| 1133 | 1133 | $bind[] = $field_value; |
| 1134 | 1134 | } |
| 1135 | 1135 | break; |
@@ -1138,17 +1138,17 @@ discard block |
||
| 1138 | 1138 | } |
| 1139 | 1139 | } elseif ($parts[0] === 'FAMS') { |
| 1140 | 1140 | // e.g. searches for occupation, religion, note, etc. |
| 1141 | - $sql .= " AND fam.f_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)"; |
|
| 1141 | + $sql .= " AND fam.f_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)"; |
|
| 1142 | 1142 | $bind[] = $parts[1]; |
| 1143 | 1143 | $bind[] = $field_value; |
| 1144 | 1144 | } elseif ($parts[1] === 'TYPE') { |
| 1145 | 1145 | // e.g. FACT:TYPE or EVEN:TYPE |
| 1146 | - $sql .= " AND ind.i_gedcom REGEXP CONCAT('\n1 ', ?, '.*(\n[2-9] .*)*\n2 TYPE .*', ?)"; |
|
| 1146 | + $sql .= " AND ind.i_gedcom REGEXP CONCAT('\n1 ', ?, '.*(\n[2-9] .*)*\n2 TYPE .*', ?)"; |
|
| 1147 | 1147 | $bind[] = $parts[0]; |
| 1148 | 1148 | $bind[] = $field_value; |
| 1149 | 1149 | } else { |
| 1150 | 1150 | // e.g. searches for occupation, religion, note, etc. |
| 1151 | - $sql .= " AND ind.i_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)"; |
|
| 1151 | + $sql .= " AND ind.i_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)"; |
|
| 1152 | 1152 | $bind[] = $parts[0]; |
| 1153 | 1153 | $bind[] = $field_value; |
| 1154 | 1154 | } |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | $sql .= ")"; |
| 1228 | 1228 | |
| 1229 | 1229 | if ($givn_sdx !== '') { |
| 1230 | - $sql .= " AND ("; |
|
| 1230 | + $sql .= " AND ("; |
|
| 1231 | 1231 | $givn_sdx = explode(':', $givn_sdx); |
| 1232 | 1232 | foreach ($givn_sdx as $n => $sdx) { |
| 1233 | 1233 | $sql .= $n > 0 ? " OR " : ""; |
@@ -1245,7 +1245,7 @@ discard block |
||
| 1245 | 1245 | } |
| 1246 | 1246 | |
| 1247 | 1247 | if ($surn_sdx !== '') { |
| 1248 | - $sql .= " AND ("; |
|
| 1248 | + $sql .= " AND ("; |
|
| 1249 | 1249 | $surn_sdx = explode(':', $surn_sdx); |
| 1250 | 1250 | foreach ($surn_sdx as $n => $sdx) { |
| 1251 | 1251 | $sql .= $n ? " OR " : ""; |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | 1265 | if ($plac_sdx !== '') { |
| 1266 | - $sql .= " AND ("; |
|
| 1266 | + $sql .= " AND ("; |
|
| 1267 | 1267 | $plac_sdx = explode(':', $plac_sdx); |
| 1268 | 1268 | foreach ($plac_sdx as $n => $sdx) { |
| 1269 | 1269 | $sql .= $n ? " OR " : ""; |
@@ -1310,7 +1310,7 @@ discard block |
||
| 1310 | 1310 | |
| 1311 | 1311 | foreach ($search_terms as $n => $q) { |
| 1312 | 1312 | $queryregex[] = preg_quote(I18N::strtoupper($q), '/'); |
| 1313 | - $sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 1313 | + $sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 1314 | 1314 | $args['collate_' . $n] = I18N::collation(); |
| 1315 | 1315 | $args['query_' . $n] = Database::escapeLike($q); |
| 1316 | 1316 | } |
@@ -1366,7 +1366,7 @@ discard block |
||
| 1366 | 1366 | |
| 1367 | 1367 | foreach ($search_terms as $n => $q) { |
| 1368 | 1368 | $queryregex[] = preg_quote(I18N::strtoupper($q), '/'); |
| 1369 | - $sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 1369 | + $sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 1370 | 1370 | $args['collate_' . $n] = I18N::collation(); |
| 1371 | 1371 | $args['query_' . $n] = Database::escapeLike($q); |
| 1372 | 1372 | } |
@@ -1422,7 +1422,7 @@ discard block |
||
| 1422 | 1422 | |
| 1423 | 1423 | foreach ($search_terms as $n => $q) { |
| 1424 | 1424 | $queryregex[] = preg_quote(I18N::strtoupper($q), '/'); |
| 1425 | - $sql .= " AND s_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 1425 | + $sql .= " AND s_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
| 1426 | 1426 | $args['collate_' . $n] = I18N::collation(); |
| 1427 | 1427 | $args['query_' . $n] = Database::escapeLike($q); |
| 1428 | 1428 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $input['control'] = FunctionsEdit::formControlSource($tree, $source, $attributes + ['required' => 'true']); |
| 116 | 116 | break; |
| 117 | 117 | case 'DATE': |
| 118 | - $attributes += [ |
|
| 118 | + $attributes += [ |
|
| 119 | 119 | 'type' => 'text', |
| 120 | 120 | 'value' => $input['default'], |
| 121 | 121 | ]; |
@@ -129,16 +129,16 @@ discard block |
||
| 129 | 129 | default: |
| 130 | 130 | switch ($input['type']) { |
| 131 | 131 | case 'text': |
| 132 | - $attributes += [ |
|
| 132 | + $attributes += [ |
|
| 133 | 133 | 'type' => 'text', |
| 134 | 134 | 'value' => $input['default'], |
| 135 | 135 | ]; |
| 136 | 136 | $input['control'] = '<input ' . Html::attributes($attributes) . '>'; |
| 137 | 137 | break; |
| 138 | 138 | case 'checkbox': |
| 139 | - $attributes += [ |
|
| 139 | + $attributes += [ |
|
| 140 | 140 | 'type' => 'checkbox', |
| 141 | - 'checked' => (bool)$input['default'], |
|
| 141 | + 'checked' => (bool) $input['default'], |
|
| 142 | 142 | ]; |
| 143 | 143 | $input['control'] = '<input ' . Html::attributes($attributes) . '>'; |
| 144 | 144 | break; |
@@ -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 | |