@@ -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 | } |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | if (\strlen($match[1]) > \strlen($match[2])) { |
87 | 87 | $match[2] = substr($match[1], 0, \strlen($match[1]) - \strlen($match[2])) . $match[2]; |
88 | 88 | } |
89 | - $ged_date = new Date("FROM {$cal} {$match[1]} TO {$cal} {$match[2]}"); |
|
89 | + $ged_date = new Date("from {$cal} {$match[1]} TO {$cal} {$match[2]}"); |
|
90 | 90 | $view = 'year'; |
91 | 91 | } else { |
92 | 92 | // advanced-year "decade/century wildcard" |
93 | 93 | if (preg_match('/^(\d+)(\?+)$/', $year, $match)) { |
94 | 94 | $y1 = $match[1] . str_replace('?', '0', $match[2]); |
95 | 95 | $y2 = $match[1] . str_replace('?', '9', $match[2]); |
96 | - $ged_date = new Date("FROM {$cal} {$y1} TO {$cal} {$y2}"); |
|
96 | + $ged_date = new Date("from {$cal} {$y1} TO {$cal} {$y2}"); |
|
97 | 97 | $view = 'year'; |
98 | 98 | } else { |
99 | 99 | if ($year < 0) { |
@@ -204,14 +204,14 @@ discard block |
||
204 | 204 | if (\strlen($match[1]) > \strlen($match[2])) { |
205 | 205 | $match[2] = substr($match[1], 0, \strlen($match[1]) - \strlen($match[2])) . $match[2]; |
206 | 206 | } |
207 | - $ged_date = new Date("FROM {$cal} {$match[1]} TO {$cal} {$match[2]}"); |
|
207 | + $ged_date = new Date("from {$cal} {$match[1]} TO {$cal} {$match[2]}"); |
|
208 | 208 | $view = 'year'; |
209 | 209 | } else { |
210 | 210 | // advanced-year "decade/century wildcard" |
211 | 211 | if (preg_match('/^(\d+)(\?+)$/', $year, $match)) { |
212 | 212 | $y1 = $match[1] . str_replace('?', '0', $match[2]); |
213 | 213 | $y2 = $match[1] . str_replace('?', '9', $match[2]); |
214 | - $ged_date = new Date("FROM {$cal} {$y1} TO {$cal} {$y2}"); |
|
214 | + $ged_date = new Date("from {$cal} {$y1} TO {$cal} {$y2}"); |
|
215 | 215 | $view = 'year'; |
216 | 216 | } else { |
217 | 217 | 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 |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $years -= $years % 5; |
43 | 43 | } |
44 | 44 | |
45 | - return (string)$years; |
|
45 | + return (string) $years; |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | } |
@@ -53,6 +53,6 @@ |
||
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | - return (string)$count; |
|
56 | + return (string) $count; |
|
57 | 57 | } |
58 | 58 | } |
@@ -53,6 +53,6 @@ |
||
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | - return (string)$count; |
|
56 | + return (string) $count; |
|
57 | 57 | } |
58 | 58 | } |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | foreach ($person->getChildFamilies() as $cfamily) { |
188 | 188 | foreach ($cfamily->getSpouses() as $parent) { |
189 | 189 | echo FontAwesome::linkIcon('arrow-up', I18N::translate('Start at parents'), ['href' => route('descendants', ['ged' => $parent->getTree()->getName(), |
190 | - 'xref' => $parent->getXref(), |
|
191 | - 'generations' => $generations, |
|
190 | + 'xref' => $parent->getXref(), |
|
191 | + 'generations' => $generations, |
|
192 | 192 | ]), |
193 | 193 | ]); |
194 | 194 | // only show the arrow for one of the parents |
@@ -268,8 +268,8 @@ discard block |
||
268 | 268 | foreach ($spouse->getChildFamilies() as $cfamily) { |
269 | 269 | foreach ($cfamily->getSpouses() as $parent) { |
270 | 270 | echo FontAwesome::linkIcon('arrow-up', I18N::translate('Start at parents'), ['href' => route('descendants', ['ged' => $parent->getTree()->getName(), |
271 | - 'xref' => $parent->getXref(), |
|
272 | - 'generations' => $generations, |
|
271 | + 'xref' => $parent->getXref(), |
|
272 | + 'generations' => $generations, |
|
273 | 273 | ]), |
274 | 274 | ]); |
275 | 275 | // only show the arrow for one of the parents |
@@ -327,8 +327,8 @@ discard block |
||
327 | 327 | FontAwesome::linkIcon('edit', I18N::translate('Edit the name'), [ |
328 | 328 | 'class' => 'btn btn-link', |
329 | 329 | 'href' => route('edit-name', ['xref' => $individual->getXref(), |
330 | - 'fact_id' => $fact->getFactId(), |
|
331 | - 'ged' => $individual->getTree()->getName(), |
|
330 | + 'fact_id' => $fact->getFactId(), |
|
331 | + 'ged' => $individual->getTree()->getName(), |
|
332 | 332 | ]), |
333 | 333 | ]); |
334 | 334 | } else { |
@@ -381,8 +381,8 @@ discard block |
||
381 | 381 | $edit_links = FontAwesome::linkIcon('edit', I18N::translate('Edit the gender'), [ |
382 | 382 | 'class' => 'btn btn-link', |
383 | 383 | 'href' => route('edit-fact', ['xref' => $individual->getXref(), |
384 | - 'fact_id' => $fact->getFactId(), |
|
385 | - 'ged' => $individual->getTree()->getName(), |
|
384 | + 'fact_id' => $fact->getFactId(), |
|
385 | + 'ged' => $individual->getTree()->getName(), |
|
386 | 386 | ]), |
387 | 387 | ]); |
388 | 388 | } else { |
@@ -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' => '', |