@@ -43,7 +43,7 @@ |
||
43 | 43 | '<u>', |
44 | 44 | '</u>', |
45 | 45 | ], $temptext); |
46 | - $match = []; |
|
46 | + $match = []; |
|
47 | 47 | // Indicates if the cell background must be painted (1) or transparent (0) |
48 | 48 | if ($this->fill == 1) { |
49 | 49 | if (!empty($this->bgcolor)) { |
@@ -60,7 +60,7 @@ |
||
60 | 60 | |
61 | 61 | // Create a dummy user, so we can send messages from the tree. |
62 | 62 | $sender = new User( |
63 | - (object)[ |
|
63 | + (object) [ |
|
64 | 64 | 'user_id' => null, |
65 | 65 | 'user_name' => '', |
66 | 66 | 'real_name' => $tree->getTitle(), |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | $this->checkIndividualAccess($individual); |
65 | 65 | |
66 | 66 | $minimum_generations = 2; |
67 | - $maximum_generations = (int)$tree->getPreference('MAX_PEDIGREE_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
68 | - $default_generations = (int)$tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
67 | + $maximum_generations = (int) $tree->getPreference('MAX_PEDIGREE_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
68 | + $default_generations = (int) $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
69 | 69 | |
70 | - $show_cousins = (bool)$request->get('show_cousins', self::DEFAULT_COUSINS); |
|
71 | - $chart_style = (int)$request->get('chart_style', self::DEFAULT_STYLE); |
|
72 | - $generations = (int)$request->get('generations', $default_generations); |
|
70 | + $show_cousins = (bool) $request->get('show_cousins', self::DEFAULT_COUSINS); |
|
71 | + $chart_style = (int) $request->get('chart_style', self::DEFAULT_STYLE); |
|
72 | + $generations = (int) $request->get('generations', $default_generations); |
|
73 | 73 | |
74 | 74 | $generations = min($generations, $maximum_generations); |
75 | 75 | $generations = max($generations, $minimum_generations); |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | $this->checkIndividualAccess($individual); |
113 | 113 | |
114 | 114 | $minimum_generations = 2; |
115 | - $maximum_generations = (int)$tree->getPreference('MAX_PEDIGREE_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
116 | - $default_generations = (int)$tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
115 | + $maximum_generations = (int) $tree->getPreference('MAX_PEDIGREE_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
116 | + $default_generations = (int) $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
117 | 117 | |
118 | - $show_cousins = (bool)$request->get('show_cousins', self::DEFAULT_COUSINS); |
|
119 | - $chart_style = (int)$request->get('chart_style', self::DEFAULT_STYLE); |
|
120 | - $generations = (int)$request->get('generations', $default_generations); |
|
118 | + $show_cousins = (bool) $request->get('show_cousins', self::DEFAULT_COUSINS); |
|
119 | + $chart_style = (int) $request->get('chart_style', self::DEFAULT_STYLE); |
|
120 | + $generations = (int) $request->get('generations', $default_generations); |
|
121 | 121 | |
122 | 122 | $generations = min($generations, $maximum_generations); |
123 | 123 | $generations = max($generations, $minimum_generations); |
@@ -94,8 +94,8 @@ discard block |
||
94 | 94 | |
95 | 95 | $this->checkIndividualAccess($individual); |
96 | 96 | |
97 | - $orientation = (int)$request->get('orientation', self::LANDSCAPE); |
|
98 | - $generations = (int)$request->get('generations', self::DEFAULT_GENERATIONS); |
|
97 | + $orientation = (int) $request->get('orientation', self::LANDSCAPE); |
|
98 | + $generations = (int) $request->get('generations', self::DEFAULT_GENERATIONS); |
|
99 | 99 | |
100 | 100 | $generations = min(self::MAX_GENERATIONS, $generations); |
101 | 101 | $generations = max(self::MIN_GENERATIONS, $generations); |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | |
134 | 134 | $this->checkIndividualAccess($individual); |
135 | 135 | |
136 | - $this->orientation = (int)$request->get('orientation'); |
|
137 | - $this->generations = (int)$request->get('generations'); |
|
136 | + $this->orientation = (int) $request->get('orientation'); |
|
137 | + $this->generations = (int) $request->get('generations'); |
|
138 | 138 | $bxspacing = Theme::theme()->parameter('chart-spacing-x'); |
139 | 139 | $byspacing = Theme::theme()->parameter('chart-spacing-y'); |
140 | 140 | $curgen = 1; // -- track which generation the algorithm is currently working on |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | }, array_values($this->sosaStradonitzAncestors($individual, $this->generations))); |
160 | 160 | |
161 | 161 | //check earliest generation for any ancestors |
162 | - for ($i = (int)($this->treesize / 2); $i < $this->treesize; $i++) { |
|
162 | + for ($i = (int) ($this->treesize / 2); $i < $this->treesize; $i++) { |
|
163 | 163 | $this->chartHasAncestors = $this->chartHasAncestors || ($this->nodes[$i]['indi'] && $this->nodes[$i]['indi']->getChildFamilies()); |
164 | 164 | } |
165 | 165 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | for ($i = ($this->treesize - 1); $i >= 0; $i--) { |
195 | 195 | |
196 | 196 | // -- check to see if we have moved to the next generation |
197 | - if ($i < (int)($this->treesize / pow(2, $curgen))) { |
|
197 | + if ($i < (int) ($this->treesize / pow(2, $curgen))) { |
|
198 | 198 | $curgen++; |
199 | 199 | } |
200 | 200 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } else { |
226 | 226 | $yoffset = $yoffset + (($boxspacing / 2) * ($curgen - 1)); |
227 | 227 | } |
228 | - $parent = (int)(($i - 1) / 2); |
|
228 | + $parent = (int) (($i - 1) / 2); |
|
229 | 229 | $pgen = $curgen; |
230 | 230 | while ($parent > 0) { |
231 | 231 | if ($parent % 2 == 0) { |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $yoffset = $yoffset + (($boxspacing / 2) * $temp); |
246 | 246 | } |
247 | 247 | } |
248 | - $parent = (int)(($parent - 1) / 2); |
|
248 | + $parent = (int) (($parent - 1) / 2); |
|
249 | 249 | } |
250 | 250 | if ($curgen > 3) { |
251 | 251 | $temp = 0; |
@@ -281,8 +281,8 @@ discard block |
||
281 | 281 | } |
282 | 282 | break; |
283 | 283 | } |
284 | - $this->nodes[$i]['x'] = (int)$xoffset; |
|
285 | - $this->nodes[$i]['y'] = (int)$yoffset; |
|
284 | + $this->nodes[$i]['x'] = (int) $xoffset; |
|
285 | + $this->nodes[$i]['y'] = (int) $yoffset; |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | // find the minimum x & y offsets and deduct that number from |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | $canvas_width = $max_xoffset + $bxspacing + Theme::theme()->parameter('chart-box-x') + $addoffset['x']; |
312 | 312 | $canvas_height = $max_yoffset + $byspacing + Theme::theme()->parameter('chart-box-y') + $addoffset['y']; |
313 | 313 | $posn = I18N::direction() === 'rtl' ? 'right' : 'left'; |
314 | - $last_gen_start = (int)floor($this->treesize / 2); |
|
314 | + $last_gen_start = (int) floor($this->treesize / 2); |
|
315 | 315 | if ($this->orientation === self::OLDEST_AT_TOP || $this->orientation === self::OLDEST_AT_BOTTOM) { |
316 | 316 | $flex_direction = ' flex-column'; |
317 | 317 | } else { |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | $html = sprintf('<div id="childarrow"><a href="#" class="menuselect %s"></a><div id="childbox-pedigree">', $this->arrows->menu); |
361 | 361 | |
362 | 362 | foreach ($families as $family) { |
363 | - $html .= '<span class="name1">' . I18N::translate('Family') . '</span>'; |
|
363 | + $html .= '<span class="name1">' . I18N::translate('Family') . '</span>'; |
|
364 | 364 | $spouse = $family->getSpouse($this->root); |
365 | 365 | if ($spouse) { |
366 | 366 | $html .= '<a class="name1" href="' . e(route('pedigree', [ |
@@ -421,9 +421,9 @@ discard block |
||
421 | 421 | $html = ''; |
422 | 422 | if ($this->chartHasAncestors) { |
423 | 423 | if ($this->nodes[$index]['indi'] && $this->nodes[$index]['indi']->getChildFamilies()) { |
424 | - $html .= '<div class="ancestorarrow">'; |
|
424 | + $html .= '<div class="ancestorarrow">'; |
|
425 | 425 | $rootParentId = 1; |
426 | - if ($index > (int)($this->treesize / 2) + (int)($this->treesize / 4)) { |
|
426 | + if ($index > (int) ($this->treesize / 2) + (int) ($this->treesize / 4)) { |
|
427 | 427 | $rootParentId++; |
428 | 428 | } |
429 | 429 | $html .= '<a class="' . $this->arrows->prevGen . '" href="' . e(route('pedigree', [ |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | private function generationOptions(Tree $tree): array |
451 | 451 | { |
452 | 452 | // @TODO - do we need this config setting, given that we cannot show more than 8 generations? |
453 | - $max_generations = min(self::MAX_GENERATIONS, (int)$tree->getPreference('MAX_PEDIGREE_GENERATIONS')); |
|
453 | + $max_generations = min(self::MAX_GENERATIONS, (int) $tree->getPreference('MAX_PEDIGREE_GENERATIONS')); |
|
454 | 454 | |
455 | 455 | return FunctionsEdit::numericOptions(range(self::MIN_GENERATIONS, $max_generations)); |
456 | 456 | } |
@@ -336,7 +336,7 @@ |
||
336 | 336 | $INDEX_DIRECTORY = $config['INDEX_DIRECTORY']; |
337 | 337 | $DBNAME = $config['DBNAME']; |
338 | 338 | $TBLPREFIX = $config['TBLPREFIX']; |
339 | - $PGV_SCHEMA_VERSION = (int)($config['PGV_SCHEMA_VERSION'] ?? '0'); |
|
339 | + $PGV_SCHEMA_VERSION = (int) ($config['PGV_SCHEMA_VERSION'] ?? '0'); |
|
340 | 340 | |
341 | 341 | // Delete the existing user accounts, and any information associated with it |
342 | 342 | Database::exec("UPDATE `##log` SET user_id=NULL"); |
@@ -55,16 +55,16 @@ discard block |
||
55 | 55 | $this->checkIndividualAccess($individual); |
56 | 56 | |
57 | 57 | $minimum_generations = 2; |
58 | - $maximum_generations = (int)$tree->getPreference('MAX_DESCENDANCY_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
59 | - $default_generations = (int)$tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
58 | + $maximum_generations = (int) $tree->getPreference('MAX_DESCENDANCY_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
59 | + $default_generations = (int) $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
60 | 60 | |
61 | - $show_spouse = (bool)$request->get('show_spouse'); |
|
62 | - $generations = (int)$request->get('generations', $default_generations); |
|
61 | + $show_spouse = (bool) $request->get('show_spouse'); |
|
62 | + $generations = (int) $request->get('generations', $default_generations); |
|
63 | 63 | $generations = min($generations, $maximum_generations); |
64 | 64 | $generations = max($generations, $minimum_generations); |
65 | 65 | |
66 | 66 | // Generations of ancestors/descendants in each mini-tree. |
67 | - $book_size = (int)$request->get('book_size', 2); |
|
67 | + $book_size = (int) $request->get('book_size', 2); |
|
68 | 68 | $book_size = min($book_size, 5); |
69 | 69 | $book_size = max($book_size, 2); |
70 | 70 | |
@@ -101,20 +101,20 @@ discard block |
||
101 | 101 | $this->checkIndividualAccess($individual); |
102 | 102 | |
103 | 103 | $minimum_generations = 2; |
104 | - $maximum_generations = (int)$tree->getPreference('MAX_PEDIGREE_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
105 | - $default_generations = (int)$tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
104 | + $maximum_generations = (int) $tree->getPreference('MAX_PEDIGREE_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
105 | + $default_generations = (int) $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
106 | 106 | |
107 | - $book_size = (int)$request->get('book_size', 2); |
|
108 | - $show_spouse = (bool)$request->get('show_spouse'); |
|
107 | + $book_size = (int) $request->get('book_size', 2); |
|
108 | + $show_spouse = (bool) $request->get('show_spouse'); |
|
109 | 109 | |
110 | - $generations = (int)$request->get('generations', $default_generations); |
|
110 | + $generations = (int) $request->get('generations', $default_generations); |
|
111 | 111 | $generations = min($generations, $maximum_generations); |
112 | 112 | $generations = max($generations, $minimum_generations); |
113 | 113 | $descendants = $this->descendants($individual, $generations, []); |
114 | 114 | |
115 | 115 | // @TODO - this is just a wrapper around the old code. |
116 | 116 | ob_start(); |
117 | - $this->box = (object)[ |
|
117 | + $this->box = (object) [ |
|
118 | 118 | 'width' => Theme::theme()->parameter('chart-box-x'), |
119 | 119 | 'height' => Theme::theme()->parameter('chart-box-y'), |
120 | 120 | ]; |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | echo '<table cellspacing="0" cellpadding="0" border="0" >'; |
174 | 174 | foreach ($children as $i => $child) { |
175 | 175 | echo '<tr><td>'; |
176 | - $kids = $this->printDescendency($child, $generation + 1); |
|
176 | + $kids = $this->printDescendency($child, $generation + 1); |
|
177 | 177 | $numkids += $kids; |
178 | 178 | echo '</td>'; |
179 | 179 | // Print the lines |
@@ -512,7 +512,7 @@ |
||
512 | 512 | private function maxUploadFilesize(): string |
513 | 513 | { |
514 | 514 | $bytes = UploadedFile::getMaxFilesize(); |
515 | - $kb = (int)($bytes / 1024); |
|
515 | + $kb = (int) ($bytes / 1024); |
|
516 | 516 | |
517 | 517 | return I18N::translate('%s KB', I18N::number($kb)); |
518 | 518 | } |
@@ -528,7 +528,7 @@ |
||
528 | 528 | $html = ''; |
529 | 529 | |
530 | 530 | foreach ($list as $id => $facts) { |
531 | - $tmp = GedcomRecord::getInstance($id, $tree); |
|
531 | + $tmp = GedcomRecord::getInstance($id, $tree); |
|
532 | 532 | $html .= $tag1 . '<a href="' . e($tmp->url()) . '">' . $tmp->getFullName() . '</a> '; |
533 | 533 | $html .= '<div class="indent">' . $facts . '</div>' . $tag2; |
534 | 534 | } |
@@ -72,14 +72,14 @@ discard block |
||
72 | 72 | if (strlen($match[1]) > strlen($match[2])) { |
73 | 73 | $match[2] = substr($match[1], 0, strlen($match[1]) - strlen($match[2])) . $match[2]; |
74 | 74 | } |
75 | - $ged_date = new Date("FROM {$cal} {$match[1]} TO {$cal} {$match[2]}"); |
|
75 | + $ged_date = new Date("from {$cal} {$match[1]} TO {$cal} {$match[2]}"); |
|
76 | 76 | $view = 'year'; |
77 | 77 | } else { |
78 | 78 | // advanced-year "decade/century wildcard" |
79 | 79 | if (preg_match('/^(\d+)(\?+)$/', $year, $match)) { |
80 | 80 | $y1 = $match[1] . str_replace('?', '0', $match[2]); |
81 | 81 | $y2 = $match[1] . str_replace('?', '9', $match[2]); |
82 | - $ged_date = new Date("FROM {$cal} {$y1} TO {$cal} {$y2}"); |
|
82 | + $ged_date = new Date("from {$cal} {$y1} TO {$cal} {$y2}"); |
|
83 | 83 | $view = 'year'; |
84 | 84 | } else { |
85 | 85 | if ($year < 0) { |
@@ -191,14 +191,14 @@ discard block |
||
191 | 191 | if (strlen($match[1]) > strlen($match[2])) { |
192 | 192 | $match[2] = substr($match[1], 0, strlen($match[1]) - strlen($match[2])) . $match[2]; |
193 | 193 | } |
194 | - $ged_date = new Date("FROM {$cal} {$match[1]} TO {$cal} {$match[2]}"); |
|
194 | + $ged_date = new Date("from {$cal} {$match[1]} TO {$cal} {$match[2]}"); |
|
195 | 195 | $view = 'year'; |
196 | 196 | } else { |
197 | 197 | // advanced-year "decade/century wildcard" |
198 | 198 | if (preg_match('/^(\d+)(\?+)$/', $year, $match)) { |
199 | 199 | $y1 = $match[1] . str_replace('?', '0', $match[2]); |
200 | 200 | $y2 = $match[1] . str_replace('?', '9', $match[2]); |
201 | - $ged_date = new Date("FROM {$cal} {$y1} TO {$cal} {$y2}"); |
|
201 | + $ged_date = new Date("from {$cal} {$y1} TO {$cal} {$y2}"); |
|
202 | 202 | $view = 'year'; |
203 | 203 | } else { |
204 | 204 | if ($year < 0) { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function delete(Request $request): Response |
43 | 43 | { |
44 | - $user_id = (int)$request->get('user_id'); |
|
44 | + $user_id = (int) $request->get('user_id'); |
|
45 | 45 | |
46 | 46 | $user = User::find($user_id); |
47 | 47 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function masquerade(Request $request): Response |
82 | 82 | { |
83 | - $user_id = (int)$request->get('user_id'); |
|
83 | + $user_id = (int) $request->get('user_id'); |
|
84 | 84 | |
85 | 85 | $user = User::find($user_id); |
86 | 86 |