@@ -263,35 +263,35 @@ discard block |
||
263 | 263 | |
264 | 264 | $args = []; |
265 | 265 | if ($search) { |
266 | - $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
266 | + $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
267 | 267 | $args['search'] = $search; |
268 | 268 | } |
269 | 269 | if ($from) { |
270 | - $sql .= " AND log_time >= :from"; |
|
270 | + $sql .= " AND log_time >= :from"; |
|
271 | 271 | $args['from'] = $from; |
272 | 272 | } |
273 | 273 | if ($to) { |
274 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
274 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
275 | 275 | $args['to'] = $to; |
276 | 276 | } |
277 | 277 | if ($type) { |
278 | - $sql .= " AND log_type = :type"; |
|
278 | + $sql .= " AND log_type = :type"; |
|
279 | 279 | $args['type'] = $type; |
280 | 280 | } |
281 | 281 | if ($text) { |
282 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
282 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
283 | 283 | $args['text'] = $text; |
284 | 284 | } |
285 | 285 | if ($ip) { |
286 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
286 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
287 | 287 | $args['ip'] = $ip; |
288 | 288 | } |
289 | 289 | if ($username) { |
290 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
290 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
291 | 291 | $args['user'] = $username; |
292 | 292 | } |
293 | 293 | if ($gedc) { |
294 | - $sql .= " AND gedcom_name = :gedc"; |
|
294 | + $sql .= " AND gedcom_name = :gedc"; |
|
295 | 295 | $args['gedc'] = $gedc; |
296 | 296 | } |
297 | 297 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | } |
318 | 318 | |
319 | 319 | if ($length) { |
320 | - $sql .= " LIMIT :limit OFFSET :offset"; |
|
320 | + $sql .= " LIMIT :limit OFFSET :offset"; |
|
321 | 321 | $args['limit'] = $length; |
322 | 322 | $args['offset'] = $start; |
323 | 323 | } |
@@ -375,35 +375,35 @@ discard block |
||
375 | 375 | |
376 | 376 | $args = []; |
377 | 377 | if ($search) { |
378 | - $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
378 | + $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
379 | 379 | $args['search'] = $search; |
380 | 380 | } |
381 | 381 | if ($from) { |
382 | - $sql .= " AND log_time >= :from"; |
|
382 | + $sql .= " AND log_time >= :from"; |
|
383 | 383 | $args['from'] = $from; |
384 | 384 | } |
385 | 385 | if ($to) { |
386 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
386 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
387 | 387 | $args['to'] = $to; |
388 | 388 | } |
389 | 389 | if ($type) { |
390 | - $sql .= " AND log_type = :type"; |
|
390 | + $sql .= " AND log_type = :type"; |
|
391 | 391 | $args['type'] = $type; |
392 | 392 | } |
393 | 393 | if ($text) { |
394 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
394 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
395 | 395 | $args['text'] = $text; |
396 | 396 | } |
397 | 397 | if ($ip) { |
398 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
398 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
399 | 399 | $args['ip'] = $ip; |
400 | 400 | } |
401 | 401 | if ($username) { |
402 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
402 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
403 | 403 | $args['user'] = $username; |
404 | 404 | } |
405 | 405 | if ($gedc) { |
406 | - $sql .= " AND gedcom_name = :gedc"; |
|
406 | + $sql .= " AND gedcom_name = :gedc"; |
|
407 | 407 | $args['gedc'] = $gedc; |
408 | 408 | } |
409 | 409 | |
@@ -436,31 +436,31 @@ discard block |
||
436 | 436 | |
437 | 437 | $args = []; |
438 | 438 | if ($from) { |
439 | - $sql .= " AND log_time >= :from"; |
|
439 | + $sql .= " AND log_time >= :from"; |
|
440 | 440 | $args['from'] = $from; |
441 | 441 | } |
442 | 442 | if ($to) { |
443 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
443 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
444 | 444 | $args['to'] = $to; |
445 | 445 | } |
446 | 446 | if ($type) { |
447 | - $sql .= " AND log_type = :type"; |
|
447 | + $sql .= " AND log_type = :type"; |
|
448 | 448 | $args['type'] = $type; |
449 | 449 | } |
450 | 450 | if ($text) { |
451 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
451 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
452 | 452 | $args['text'] = $text; |
453 | 453 | } |
454 | 454 | if ($ip) { |
455 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
455 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
456 | 456 | $args['ip'] = $ip; |
457 | 457 | } |
458 | 458 | if ($username) { |
459 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
459 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
460 | 460 | $args['user'] = $username; |
461 | 461 | } |
462 | 462 | if ($gedc) { |
463 | - $sql .= " AND gedcom_name = :gedc"; |
|
463 | + $sql .= " AND gedcom_name = :gedc"; |
|
464 | 464 | $args['gedc'] = $gedc; |
465 | 465 | } |
466 | 466 |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | { |
61 | 61 | $this->checkModuleIsActive($tree, 'timeline_chart'); |
62 | 62 | |
63 | - $scale = (int)$request->get('scale', self::SCALE_DEFAULT); |
|
63 | + $scale = (int) $request->get('scale', self::SCALE_DEFAULT); |
|
64 | 64 | $scale = min($scale, self::SCALE_MAX); |
65 | 65 | $scale = max($scale, self::SCALE_MIN); |
66 | 66 | |
67 | - $xrefs = (array)$request->get('xrefs', []); |
|
67 | + $xrefs = (array) $request->get('xrefs', []); |
|
68 | 68 | $xrefs = array_unique($xrefs); |
69 | 69 | $xrefs = array_filter($xrefs, function (string $xref) use ($tree): bool { |
70 | 70 | $individual = Individual::getInstance($xref, $tree); |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | |
101 | 101 | $zoom_in_url = route('timeline', [ |
102 | 102 | 'ged' => $tree->getName(), |
103 | - 'scale' => min(self::SCALE_MAX, $scale + (int)($scale * 0.2 + 1)), |
|
103 | + 'scale' => min(self::SCALE_MAX, $scale + (int) ($scale * 0.2 + 1)), |
|
104 | 104 | 'xrefs' => $xrefs, |
105 | 105 | ]); |
106 | 106 | |
107 | 107 | $zoom_out_url = route('timeline', [ |
108 | 108 | 'route' => 'timeline', |
109 | 109 | 'ged' => $tree->getName(), |
110 | - 'scale' => max(self::SCALE_MIN, $scale - (int)($scale * 0.2 + 1)), |
|
110 | + 'scale' => max(self::SCALE_MIN, $scale - (int) ($scale * 0.2 + 1)), |
|
111 | 111 | 'xrefs' => $xrefs, |
112 | 112 | ]); |
113 | 113 | |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | { |
133 | 133 | $this->checkModuleIsActive($tree, 'timeline_chart'); |
134 | 134 | |
135 | - $scale = (int)$request->get('scale', self::SCALE_DEFAULT); |
|
135 | + $scale = (int) $request->get('scale', self::SCALE_DEFAULT); |
|
136 | 136 | $scale = min($scale, self::SCALE_MAX); |
137 | 137 | $scale = max($scale, self::SCALE_MIN); |
138 | 138 | |
139 | - $xrefs = (array)$request->get('xrefs', []); |
|
139 | + $xrefs = (array) $request->get('xrefs', []); |
|
140 | 140 | $xrefs = array_unique($xrefs); |
141 | 141 | |
142 | 142 | /** @var Individual[] $individuals */ |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | return $individual !== null && $individual->canShow(); |
149 | 149 | }); |
150 | 150 | |
151 | - $baseyear = (int)date('Y'); |
|
151 | + $baseyear = (int) date('Y'); |
|
152 | 152 | $topyear = 0; |
153 | 153 | $indifacts = []; |
154 | 154 | $birthyears = []; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $topyear = max($topyear, $date->y); |
184 | 184 | |
185 | 185 | if (!$individual->isDead()) { |
186 | - $topyear = max($topyear, (int)date('Y')); |
|
186 | + $topyear = max($topyear, (int) date('Y')); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | // do not add the same fact twice (prevents marriages from being added multiple times) |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | if ($scale === 0) { |
199 | - $scale = (int)(($topyear - $baseyear) / 20 * count($indifacts) / 4); |
|
199 | + $scale = (int) (($topyear - $baseyear) / 20 * count($indifacts) / 4); |
|
200 | 200 | if ($scale < 6) { |
201 | 201 | $scale = 6; |
202 | 202 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | Log::addAuthenticationLog('Password request was sent to user: ' . $user->getUserName()); |
71 | 71 | |
72 | - $sender = new User((object)[ |
|
72 | + $sender = new User((object) [ |
|
73 | 73 | 'user_id' => null, |
74 | 74 | 'user_name' => '', |
75 | 75 | 'real_name' => $tree->getTitle(), |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $max = strlen($passchars) - 1; |
105 | 105 | |
106 | 106 | for ($i = 0; $i < 8; $i++) { |
107 | - $index = random_int(0, $max); |
|
107 | + $index = random_int(0, $max); |
|
108 | 108 | $password .= $passchars{$index}; |
109 | 109 | } |
110 | 110 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | define('WT_LOCALE', I18N::init('en-US')); |
49 | 49 | |
50 | - $step = (int)$request->get('step', '1'); |
|
50 | + $step = (int) $request->get('step', '1'); |
|
51 | 51 | $errors = $this->serverErrors(); |
52 | 52 | $warnings = $this->serverWarnings(); |
53 | 53 | $data = $this->extractParameters($request); |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | */ |
365 | 365 | private function maxExecutionTime(): int |
366 | 366 | { |
367 | - return (int)ini_get('max_execution_time'); |
|
367 | + return (int) ini_get('max_execution_time'); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | $memory_limit = $memory_limit / 1024 / 1024; |
398 | 398 | } |
399 | 399 | |
400 | - return (int)$memory_limit; |
|
400 | + return (int) $memory_limit; |
|
401 | 401 | } |
402 | 402 | |
403 | 403 | /** |
@@ -454,11 +454,11 @@ discard block |
||
454 | 454 | /* I18N: a program feature */ |
455 | 455 | 'simplexml' => I18N::translate('reporting'), |
456 | 456 | ]; |
457 | - $settings = [ |
|
457 | + $settings = [ |
|
458 | 458 | /* I18N: a program feature */ |
459 | 459 | 'file_uploads' => I18N::translate('file upload capability'), |
460 | 460 | ]; |
461 | - $warnings = []; |
|
461 | + $warnings = []; |
|
462 | 462 | |
463 | 463 | foreach ($extensions as $extension => $features) { |
464 | 464 | if (!extension_loaded($extension)) { |
@@ -55,15 +55,15 @@ discard block |
||
55 | 55 | |
56 | 56 | $this->checkIndividualAccess($individual); |
57 | 57 | |
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 | - $generations = (int)$request->get('generations', $default_generations); |
|
61 | + $generations = (int) $request->get('generations', $default_generations); |
|
62 | 62 | |
63 | 63 | $generations = min($generations, $maximum_generations); |
64 | 64 | $generations = max($generations, self::MINIMUM_GENERATIONS); |
65 | 65 | |
66 | - $show_spouse = (bool)$request->get('show_spouse'); |
|
66 | + $show_spouse = (bool) $request->get('show_spouse'); |
|
67 | 67 | |
68 | 68 | /* I18N: %s is an individual’s name */ |
69 | 69 | $title = I18N::translate('Hourglass chart of %s', $individual->getFullName()); |
@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | |
96 | 96 | $this->checkIndividualAccess($individual); |
97 | 97 | |
98 | - $maximum_generations = (int)$tree->getPreference('MAX_DESCENDANCY_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
99 | - $default_generations = (int)$tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
98 | + $maximum_generations = (int) $tree->getPreference('MAX_DESCENDANCY_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS); |
|
99 | + $default_generations = (int) $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS); |
|
100 | 100 | |
101 | - $generations = (int)$request->get('generations', $default_generations); |
|
101 | + $generations = (int) $request->get('generations', $default_generations); |
|
102 | 102 | $generations = min($generations, $maximum_generations); |
103 | 103 | $generations = max($generations, self::MINIMUM_GENERATIONS); |
104 | 104 | |
105 | - $show_spouse = (bool)$request->get('show_spouse'); |
|
105 | + $show_spouse = (bool) $request->get('show_spouse'); |
|
106 | 106 | |
107 | 107 | ob_start(); |
108 | 108 | $this->printDescendency($individual, 1, $generations, $show_spouse, true); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | return new Response(view('hourglass-chart', [ |
116 | 116 | 'descendants' => $descendants, |
117 | 117 | 'ancestors' => $ancestors, |
118 | - 'bhalfheight' => (int)(Theme::theme()->parameter('chart-box-y') / 2), |
|
118 | + 'bhalfheight' => (int) (Theme::theme()->parameter('chart-box-y') / 2), |
|
119 | 119 | ])); |
120 | 120 | } |
121 | 121 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | $this->checkIndividualAccess($individual); |
136 | 136 | |
137 | - $show_spouse = (bool)$request->get('show_spouse'); |
|
137 | + $show_spouse = (bool) $request->get('show_spouse'); |
|
138 | 138 | |
139 | 139 | ob_start(); |
140 | 140 | $this->printPersonPedigree($individual, 0, 1, $show_spouse); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $xref = $request->get('xref'); |
157 | 157 | $individual = Individual::getInstance($xref, $tree); |
158 | 158 | |
159 | - $show_spouse = (bool)$request->get('show_spouse'); |
|
159 | + $show_spouse = (bool) $request->get('show_spouse'); |
|
160 | 160 | |
161 | 161 | ob_start(); |
162 | 162 | $this->printDescendency($individual, 1, 2, $show_spouse, false); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | echo '<a href="' . e(route('hourglass', [ |
310 | 310 | 'xref' => $spouse->getXref(), |
311 | 311 | 'generations' => $generations, |
312 | - 'show_spouse' => (int)$show_spouse, |
|
312 | + 'show_spouse' => (int) $show_spouse, |
|
313 | 313 | 'ged' => $spouse->getTree()->getName(), |
314 | 314 | ])) . '" class="name1">' . $spouse->getFullName() . '</a>'; |
315 | 315 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | echo '<a href="' . e(route('hourglass', [ |
318 | 318 | 'xref' => $child->getXref(), |
319 | 319 | 'generations' => $generations, |
320 | - 'show_spouse' => (int)$show_spouse, |
|
320 | + 'show_spouse' => (int) $show_spouse, |
|
321 | 321 | 'ged' => $child->getTree()->getName(), |
322 | 322 | ])) . '" class="name1">' . $child->getFullName() . '</a>'; |
323 | 323 | } |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | echo '<a href="' . e(route('hourglass', [ |
333 | 333 | 'xref' => $husb->getXref(), |
334 | 334 | 'generations' => $generations, |
335 | - 'show_spouse' => (int)$show_spouse, |
|
335 | + 'show_spouse' => (int) $show_spouse, |
|
336 | 336 | 'ged' => $husb->getTree()->getName(), |
337 | 337 | ])) . '" class="name1">' . $husb->getFullName() . '</a>'; |
338 | 338 | } |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | echo '<a href="' . e(route('hourglass', [ |
342 | 342 | 'xref' => $wife->getXref(), |
343 | 343 | 'generations' => $generations, |
344 | - 'show_spouse' => (int)$show_spouse, |
|
344 | + 'show_spouse' => (int) $show_spouse, |
|
345 | 345 | 'ged' => $wife->getTree()->getName(), |
346 | 346 | ])) . '" class="name1">' . $wife->getFullName() . '</a>'; |
347 | 347 | } |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | echo '<a href="' . e(route('hourglass', [ |
361 | 361 | 'xref' => $child->getXref(), |
362 | 362 | 'generations' => $generations, |
363 | - 'show_spouse' => (int)$show_spouse, |
|
363 | + 'show_spouse' => (int) $show_spouse, |
|
364 | 364 | 'ged' => $child->getTree()->getName(), |
365 | 365 | ])) . '" class="name1">' . $child->getFullName() . '</a>'; |
366 | 366 | } |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | 'href' => '#', |
424 | 424 | 'data-route' => 'hourglass-add-asc', |
425 | 425 | 'data-xref' => $ARID, |
426 | - 'data-spouses' => (int)$show_spouse, |
|
426 | + 'data-spouses' => (int) $show_spouse, |
|
427 | 427 | 'data-tree' => $family->getHusband()->getTree()->getName(), |
428 | 428 | ]); |
429 | 429 | } |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | 'href' => '#', |
461 | 461 | 'data-route' => 'hourglass-add-asc', |
462 | 462 | 'data-xref' => $ARID, |
463 | - 'data-spouses' => (int)$show_spouse, |
|
463 | + 'data-spouses' => (int) $show_spouse, |
|
464 | 464 | 'data-tree' => $family->getWife()->getTree()->getName(), |
465 | 465 | ]); |
466 | 466 | } |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | { |
53 | 53 | $this->checkModuleIsActive($tree, 'lifespans_chart'); |
54 | 54 | |
55 | - $xrefs = (array)$request->get('xrefs', []); |
|
55 | + $xrefs = (array) $request->get('xrefs', []); |
|
56 | 56 | $addxref = $request->get('addxref', ''); |
57 | - $addfam = (bool)$request->get('addfam', false); |
|
57 | + $addfam = (bool) $request->get('addfam', false); |
|
58 | 58 | $placename = $request->get('placename', ''); |
59 | 59 | $start = $request->get('start', ''); |
60 | 60 | $end = $request->get('end', ''); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $this->checkModuleIsActive($tree, 'lifespans_chart'); |
113 | 113 | |
114 | - $xrefs = (array)$request->get('xrefs', []); |
|
114 | + $xrefs = (array) $request->get('xrefs', []); |
|
115 | 115 | $xrefs = array_unique($xrefs); |
116 | 116 | |
117 | 117 | /** @var Individual[] $individuals */ |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | $subtitle = $request->get('subtitle'); |
132 | 132 | |
133 | 133 | // Round to whole decades |
134 | - $start_year = (int)floor($this->minYear($individuals) / 10) * 10; |
|
135 | - $end_year = (int)ceil($this->maxYear($individuals) / 10) * 10; |
|
134 | + $start_year = (int) floor($this->minYear($individuals) / 10) * 10; |
|
135 | + $end_year = (int) ceil($this->maxYear($individuals) / 10) * 10; |
|
136 | 136 | |
137 | 137 | $lifespans = $this->layoutIndividuals($individuals); |
138 | 138 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | 'U' => new ColorGenerator(120, self::SATURATION, self::LIGHTNESS, self::ALPHA, self::RANGE), |
168 | 168 | ]; |
169 | 169 | |
170 | - $current_year = (int)date('Y'); |
|
170 | + $current_year = (int) date('Y'); |
|
171 | 171 | |
172 | 172 | // Latest year used in each row |
173 | 173 | $rows = []; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | // Fill the row up to the year (leaving a small gap) |
197 | 197 | $rows[$next_row] = $death_year; |
198 | 198 | |
199 | - $lifespans[] = (object)[ |
|
199 | + $lifespans[] = (object) [ |
|
200 | 200 | 'background' => $colors[$individual->getSex()]->getNextColor(), |
201 | 201 | 'birth_year' => $birth_year, |
202 | 202 | 'death_year' => $death_year, |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $year = $this->jdToYear($jd); |
226 | 226 | |
227 | 227 | // Don't show future dates |
228 | - return min($year, (int)date('Y')); |
|
228 | + return min($year, (int) date('Y')); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | ->setPreference('sessiontime', '0'); |
119 | 119 | |
120 | 120 | // Create a dummy user, so we can send messages from the tree. |
121 | - $sender = new User((object)[ |
|
121 | + $sender = new User((object) [ |
|
122 | 122 | 'user_id' => null, |
123 | 123 | 'user_name' => '', |
124 | 124 | 'real_name' => $tree->getTitle(), |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | ); |
138 | 138 | |
139 | 139 | // Tell the genealogy contact about the registration. |
140 | - $webmaster = User::find((int)$tree->getPreference('WEBMASTER_USER_ID')); |
|
140 | + $webmaster = User::find((int) $tree->getPreference('WEBMASTER_USER_ID')); |
|
141 | 141 | |
142 | 142 | if ($webmaster !== null) { |
143 | 143 | I18N::init($webmaster->getPreference('language')); |
@@ -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) { |