Completed
Pull Request — master (#1850)
by Rico
07:44
created
app/Functions/FunctionsPrintFacts.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
             case '_BIRT_CHIL':
177 177
                 $children[$fact->getParent()->getXref()] = true;
178 178
                 /* I18N: Abbreviation for "number %s" */
179
-                $label                                   .= '<br>' . I18N::translate('#%s', count($children));
179
+                $label .= '<br>' . I18N::translate('#%s', count($children));
180 180
                 break;
181 181
             case '_BIRT_GCHI':
182 182
             case '_BIRT_GCH1':
183 183
             case '_BIRT_GCH2':
184 184
                 $grandchildren[$fact->getParent()->getXref()] = true;
185 185
                 /* I18N: Abbreviation for "number %s" */
186
-                $label                                        .= '<br>' . I18N::translate('#%s', count($grandchildren));
186
+                $label .= '<br>' . I18N::translate('#%s', count($grandchildren));
187 187
                 break;
188 188
         }
189 189
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
         for ($j = 0; $j < $ct; $j++) {
578 578
             if (strpos($match[$j][1], '@') === false) {
579 579
                 $source = e($match[$j][1] . preg_replace('/\n\d CONT ?/', "\n", $match[$j][2]));
580
-                $data   .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $tree) . '</span></div>';
580
+                $data .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $tree) . '</span></div>';
581 581
             }
582 582
         }
583 583
         // Find source for each fact
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
                     }
596 596
                     $srec      = substr($factrec, $spos1, $spos2 - $spos1);
597 597
                     $lt        = preg_match_all("/$nlevel \w+/", $srec, $matches);
598
-                    $data      .= '<div class="fact_SOUR">';
598
+                    $data .= '<div class="fact_SOUR">';
599 599
                     $elementID = Uuid::uuid4()->toString();
600 600
                     if ($tree->getPreference('EXPAND_SOURCES')) {
601 601
                         $plusminus = 'icon-minus';
Please login to merge, or discard this patch.
app/Module/BatchUpdate/BatchUpdateSearchReplacePlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@
 block discarded – undo
175 175
             'words'     => I18N::translate('Match the exact text, unless it occurs in the middle of a word.'),
176 176
             'wildcards' => I18N::translate('Use a “?” to match a single character, use “*” to match zero or more characters.'),
177 177
             /* I18N: http://en.wikipedia.org/wiki/Regular_expression */
178
-            'regex'     => I18N::translate('Regular expressions are an advanced pattern matching technique.') . '<br>' .  I18N::translate('See %s for more information.', '<a href="http://php.net/manual/regexp.reference.php">php.net/manual/regexp.reference.php</a>'),
178
+            'regex'     => I18N::translate('Regular expressions are an advanced pattern matching technique.') . '<br>' . I18N::translate('See %s for more information.', '<a href="http://php.net/manual/regexp.reference.php">php.net/manual/regexp.reference.php</a>'),
179 179
         ];
180 180
 
181 181
         return
Please login to merge, or discard this patch.
app/Http/Controllers/LifespansChartController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/RegisterController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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'));
Please login to merge, or discard this patch.
app/Http/Controllers/FanChartController.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Http/Controllers/StatisticsChartController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
app/Stats.php 1 patch
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     private function getTags($text)
158 158
     {
159 159
         // Extract all tags from the provided text
160
-        preg_match_all('/#([^#]+)(?=#)/', (string)$text, $match);
160
+        preg_match_all('/#([^#]+)(?=#)/', (string) $text, $match);
161 161
         $tags       = $match[1];
162 162
         $c          = count($tags);
163 163
         $new_tags   = []; // tag to replace
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
      */
397 397
     private function totalIndividualsQuery()
398 398
     {
399
-        return (int)Database::prepare(
399
+        return (int) Database::prepare(
400 400
             "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id"
401 401
         )->execute([
402 402
             'tree_id' => $this->tree->getTreeId(),
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
      */
421 421
     private function totalIndisWithSourcesQuery()
422 422
     {
423
-        return (int)Database::prepare(
423
+        return (int) Database::prepare(
424 424
             "SELECT COUNT(DISTINCT i_id)" .
425 425
             " FROM `##individuals` JOIN `##link` ON i_id = l_from AND i_file = l_file" .
426 426
             " WHERE l_file = :tree_id AND l_type = 'SOUR'"
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
      */
504 504
     private function totalFamiliesQuery()
505 505
     {
506
-        return (int)Database::prepare(
506
+        return (int) Database::prepare(
507 507
             "SELECT COUNT(*) FROM `##families` WHERE f_file = :tree_id"
508 508
         )->execute([
509 509
             'tree_id' => $this->tree->getTreeId(),
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
      */
528 528
     private function totalFamsWithSourcesQuery()
529 529
     {
530
-        return (int)Database::prepare(
530
+        return (int) Database::prepare(
531 531
             "SELECT COUNT(DISTINCT f_id)" .
532 532
             " FROM `##families` JOIN `##link` ON f_id = l_from AND f_file = l_file" .
533 533
             " WHERE l_file = :tree_id AND l_type = 'SOUR'"
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
      */
611 611
     private function totalSourcesQuery()
612 612
     {
613
-        return (int)Database::prepare(
613
+        return (int) Database::prepare(
614 614
             "SELECT COUNT(*) FROM `##sources` WHERE s_file = :tree_id"
615 615
         )->execute([
616 616
             'tree_id' => $this->tree->getTreeId(),
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
      */
645 645
     private function totalNotesQuery()
646 646
     {
647
-        return (int)Database::prepare(
647
+        return (int) Database::prepare(
648 648
             "SELECT COUNT(*) FROM `##other` WHERE o_type='NOTE' AND o_file = :tree_id"
649 649
         )->execute([
650 650
             'tree_id' => $this->tree->getTreeId(),
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
      */
679 679
     private function totalRepositoriesQuery()
680 680
     {
681
-        return (int)Database::prepare(
681
+        return (int) Database::prepare(
682 682
             "SELECT COUNT(*) FROM `##other` WHERE o_type='REPO' AND o_file = :tree_id"
683 683
         )->execute([
684 684
             'tree_id' => $this->tree->getTreeId(),
@@ -787,11 +787,11 @@  discard block
 block discarded – undo
787 787
                 }
788 788
             }
789 789
             if ($types) {
790
-                $sql  .= ' AND d_fact IN (' . implode(', ', array_fill(0, count($types), '?')) . ')';
790
+                $sql .= ' AND d_fact IN (' . implode(', ', array_fill(0, count($types), '?')) . ')';
791 791
                 $vars = array_merge($vars, $types);
792 792
             }
793 793
         }
794
-        $sql  .= ' AND d_fact NOT IN (' . implode(', ', array_fill(0, count($no_types), '?')) . ')';
794
+        $sql .= ' AND d_fact NOT IN (' . implode(', ', array_fill(0, count($no_types), '?')) . ')';
795 795
         $vars = array_merge($vars, $no_types);
796 796
 
797 797
         return I18N::number(Database::prepare($sql)->execute($vars)->fetchOne());
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
      */
902 902
     private function totalSexMalesQuery()
903 903
     {
904
-        return (int)Database::prepare(
904
+        return (int) Database::prepare(
905 905
             "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_sex = 'M'"
906 906
         )->execute([
907 907
             'tree_id' => $this->tree->getTreeId(),
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
      */
936 936
     private function totalSexFemalesQuery()
937 937
     {
938
-        return (int)Database::prepare(
938
+        return (int) Database::prepare(
939 939
             "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_sex = 'F'"
940 940
         )->execute([
941 941
             'tree_id' => $this->tree->getTreeId(),
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
      */
970 970
     private function totalSexUnknownQuery()
971 971
     {
972
-        return (int)Database::prepare(
972
+        return (int) Database::prepare(
973 973
             "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_sex = 'U'"
974 974
         )->execute([
975 975
             'tree_id' => $this->tree->getTreeId(),
@@ -1041,12 +1041,12 @@  discard block
 block discarded – undo
1041 1041
         if ($tot == 0) {
1042 1042
             return '';
1043 1043
         } elseif ($tot_u > 0) {
1044
-            $chd         = $this->arrayToExtendedEncoding([
1044
+            $chd = $this->arrayToExtendedEncoding([
1045 1045
                 4095 * $tot_u / $tot,
1046 1046
                 4095 * $tot_f / $tot,
1047 1047
                 4095 * $tot_m / $tot,
1048 1048
             ]);
1049
-            $chl         =
1049
+            $chl =
1050 1050
                 I18N::translateContext('unknown people', 'Unknown') . ' - ' . $per_u . '|' .
1051 1051
                 I18N::translate('Females') . ' - ' . $per_f . '|' .
1052 1052
                 I18N::translate('Males') . ' - ' . $per_m;
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 
1058 1058
             return "<img src=\"https://chart.googleapis.com/chart?cht=p3&amp;chd=e:{$chd}&amp;chs={$size}&amp;chco={$color_unknown},{$color_female},{$color_male}&amp;chf=bg,s,ffffff00&amp;chl={$chl}\" width=\"{$sizes[0]}\" height=\"{$sizes[1]}\" alt=\"" . $chart_title . '" title="' . $chart_title . '" />';
1059 1059
         } else {
1060
-            $chd         = $this->arrayToExtendedEncoding([
1060
+            $chd = $this->arrayToExtendedEncoding([
1061 1061
                 4095 * $tot_f / $tot,
1062 1062
                 4095 * $tot_m / $tot,
1063 1063
             ]);
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
      */
1084 1084
     private function totalLivingQuery()
1085 1085
     {
1086
-        return (int)Database::prepare(
1086
+        return (int) Database::prepare(
1087 1087
             "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_gedcom NOT REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'"
1088 1088
         )->execute([
1089 1089
             'tree_id' => $this->tree->getTreeId(),
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
      */
1118 1118
     private function totalDeceasedQuery()
1119 1119
     {
1120
-        return (int)Database::prepare(
1120
+        return (int) Database::prepare(
1121 1121
             "SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id AND i_gedcom REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'"
1122 1122
         )->execute([
1123 1123
             'tree_id' => $this->tree->getTreeId(),
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
         if ($tot == 0) {
1183 1183
             return '';
1184 1184
         } else {
1185
-            $chd         = $this->arrayToExtendedEncoding([
1185
+            $chd = $this->arrayToExtendedEncoding([
1186 1186
                 4095 * $tot_l / $tot,
1187 1187
                 4095 * $tot_d / $tot,
1188 1188
             ]);
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
     public function totalUsers($params = [])
1207 1207
     {
1208 1208
         if (isset($params[0])) {
1209
-            $total = count(User::all()) + (int)$params[0];
1209
+            $total = count(User::all()) + (int) $params[0];
1210 1210
         } else {
1211 1211
             $total = count(User::all());
1212 1212
         }
@@ -1253,18 +1253,18 @@  discard block
 block discarded – undo
1253 1253
             if ($type == 'unknown') {
1254 1254
                 // There has to be a better way then this :(
1255 1255
                 foreach ($this->media_types as $t) {
1256
-                    $sql    .= " AND (m_gedcom NOT LIKE ? AND m_gedcom NOT LIKE ?)";
1256
+                    $sql .= " AND (m_gedcom NOT LIKE ? AND m_gedcom NOT LIKE ?)";
1257 1257
                     $vars[] = "%3 TYPE {$t}%";
1258 1258
                     $vars[] = "%1 _TYPE {$t}%";
1259 1259
                 }
1260 1260
             } else {
1261
-                $sql    .= " AND (m_gedcom LIKE ? OR m_gedcom LIKE ?)";
1261
+                $sql .= " AND (m_gedcom LIKE ? OR m_gedcom LIKE ?)";
1262 1262
                 $vars[] = "%3 TYPE {$type}%";
1263 1263
                 $vars[] = "%1 _TYPE {$type}%";
1264 1264
             }
1265 1265
         }
1266 1266
 
1267
-        return (int)Database::prepare($sql)->execute($vars)->fetchOne();
1267
+        return (int) Database::prepare($sql)->execute($vars)->fetchOne();
1268 1268
     }
1269 1269
 
1270 1270
     /**
@@ -1725,7 +1725,7 @@  discard block
 block discarded – undo
1725 1725
     private function totalPlacesQuery()
1726 1726
     {
1727 1727
         return
1728
-            (int)Database::prepare("SELECT COUNT(*) FROM `##places` WHERE p_file=?")
1728
+            (int) Database::prepare("SELECT COUNT(*) FROM `##places` WHERE p_file=?")
1729 1729
                 ->execute([$this->tree->getTreeId()])
1730 1730
                 ->fetchOne();
1731 1731
     }
@@ -1895,7 +1895,7 @@  discard block
 block discarded – undo
1895 1895
         $chart_url .= '&amp;chs=' . $WT_STATS_MAP_X . 'x' . $WT_STATS_MAP_Y;
1896 1896
         $chart_url .= '&amp;chld=' . implode('', array_keys($surn_countries)) . '&amp;chd=s:';
1897 1897
         foreach ($surn_countries as $count) {
1898
-            $chart_url .= substr(self::GOOGLE_CHART_ENCODING, (int)($count / max($surn_countries) * 61), 1);
1898
+            $chart_url .= substr(self::GOOGLE_CHART_ENCODING, (int) ($count / max($surn_countries) * 61), 1);
1899 1899
         }
1900 1900
         $chart = '<div id="google_charts" class="center">';
1901 1901
         $chart .= '<p>' . $chart_title . '</p>';
@@ -1937,9 +1937,9 @@  discard block
 block discarded – undo
1937 1937
             $country = trim($place->country);
1938 1938
             if (array_key_exists($country, $country_names)) {
1939 1939
                 if (!isset($all_db_countries[$country_names[$country]][$country])) {
1940
-                    $all_db_countries[$country_names[$country]][$country] = (int)$place->tot;
1940
+                    $all_db_countries[$country_names[$country]][$country] = (int) $place->tot;
1941 1941
                 } else {
1942
-                    $all_db_countries[$country_names[$country]][$country] += (int)$place->tot;
1942
+                    $all_db_countries[$country_names[$country]][$country] += (int) $place->tot;
1943 1943
                 }
1944 1944
             }
1945 1945
         }
@@ -2116,7 +2116,7 @@  discard block
 block discarded – undo
2116 2116
             $centuries = '';
2117 2117
             $counts    = [];
2118 2118
             foreach ($rows as $values) {
2119
-                $counts[]  = round(100 * $values->total / $tot, 0);
2119
+                $counts[] = round(100 * $values->total / $tot, 0);
2120 2120
                 $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|';
2121 2121
             }
2122 2122
             $chd = $this->arrayToExtendedEncoding($counts);
@@ -2210,7 +2210,7 @@  discard block
 block discarded – undo
2210 2210
             $centuries = '';
2211 2211
             $counts    = [];
2212 2212
             foreach ($rows as $values) {
2213
-                $counts[]  = round(100 * $values->total / $tot, 0);
2213
+                $counts[] = round(100 * $values->total / $tot, 0);
2214 2214
                 $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|';
2215 2215
             }
2216 2216
             $chd = $this->arrayToExtendedEncoding($counts);
@@ -2460,7 +2460,7 @@  discard block
 block discarded – undo
2460 2460
                 }
2461 2461
                 break;
2462 2462
             case 'age':
2463
-                $result = I18N::number((int)($row->age / 365.25));
2463
+                $result = I18N::number((int) ($row->age / 365.25));
2464 2464
                 break;
2465 2465
             case 'name':
2466 2466
                 $result = '<a href="' . e($person->url()) . '">' . $person->getFullName() . '</a>';
@@ -2489,7 +2489,7 @@  discard block
 block discarded – undo
2489 2489
             $sex_search = '';
2490 2490
         }
2491 2491
         if (isset($params[0])) {
2492
-            $total = (int)$params[0];
2492
+            $total = (int) $params[0];
2493 2493
         } else {
2494 2494
             $total = 10;
2495 2495
         }
@@ -2523,10 +2523,10 @@  discard block
 block discarded – undo
2523 2523
         foreach ($rows as $row) {
2524 2524
             $person = Individual::getInstance($row->deathdate, $this->tree);
2525 2525
             $age    = $row->age;
2526
-            if ((int)($age / 365.25) > 0) {
2527
-                $age = (int)($age / 365.25) . 'y';
2528
-            } elseif ((int)($age / 30.4375) > 0) {
2529
-                $age = (int)($age / 30.4375) . 'm';
2526
+            if ((int) ($age / 365.25) > 0) {
2527
+                $age = (int) ($age / 365.25) . 'y';
2528
+            } elseif ((int) ($age / 30.4375) > 0) {
2529
+                $age = (int) ($age / 30.4375) . 'm';
2530 2530
             } else {
2531 2531
                 $age = $age . 'd';
2532 2532
             }
@@ -2588,11 +2588,11 @@  discard block
 block discarded – undo
2588 2588
             $sex_search = '';
2589 2589
         }
2590 2590
         if (isset($params[0])) {
2591
-            $total = (int)$params[0];
2591
+            $total = (int) $params[0];
2592 2592
         } else {
2593 2593
             $total = 10;
2594 2594
         }
2595
-        $rows  = $this->runSql(
2595
+        $rows = $this->runSql(
2596 2596
             "SELECT" .
2597 2597
             " birth.d_gid AS id," .
2598 2598
             " MIN(birth.d_julianday1) AS age" .
@@ -2615,10 +2615,10 @@  discard block
 block discarded – undo
2615 2615
         foreach ($rows as $row) {
2616 2616
             $person = Individual::getInstance($row->id, $this->tree);
2617 2617
             $age    = (WT_CLIENT_JD - $row->age);
2618
-            if ((int)($age / 365.25) > 0) {
2619
-                $age = (int)($age / 365.25) . 'y';
2620
-            } elseif ((int)($age / 30.4375) > 0) {
2621
-                $age = (int)($age / 30.4375) . 'm';
2618
+            if ((int) ($age / 365.25) > 0) {
2619
+                $age = (int) ($age / 365.25) . 'y';
2620
+            } elseif ((int) ($age / 30.4375) > 0) {
2621
+                $age = (int) ($age / 30.4375) . 'm';
2622 2622
             } else {
2623 2623
                 $age = $age . 'd';
2624 2624
             }
@@ -2695,10 +2695,10 @@  discard block
 block discarded – undo
2695 2695
 
2696 2696
         $age = $rows[0]->age;
2697 2697
         if ($show_years) {
2698
-            if ((int)($age / 365.25) > 0) {
2699
-                $age = (int)($age / 365.25) . 'y';
2700
-            } elseif ((int)($age / 30.4375) > 0) {
2701
-                $age = (int)($age / 30.4375) . 'm';
2698
+            if ((int) ($age / 365.25) > 0) {
2699
+                $age = (int) ($age / 365.25) . 'y';
2700
+            } elseif ((int) ($age / 30.4375) > 0) {
2701
+                $age = (int) ($age / 30.4375) . 'm';
2702 2702
             } elseif (!empty($age)) {
2703 2703
                 $age = $age . 'd';
2704 2704
             }
@@ -2768,7 +2768,7 @@  discard block
 block discarded – undo
2768 2768
                 if ($sizes[0] < 980) {
2769 2769
                     $sizes[0] += 50;
2770 2770
                 }
2771
-                $chxl    .= $this->centuryName($century) . '|';
2771
+                $chxl .= $this->centuryName($century) . '|';
2772 2772
                 $average = 0;
2773 2773
                 if (isset($values['F'])) {
2774 2774
                     $countsf .= $values['F'] . ',';
@@ -2810,7 +2810,7 @@  discard block
 block discarded – undo
2810 2810
                 while ($offset = strpos($title, ' ', $offset + 1)) {
2811 2811
                     $counter[] = $offset;
2812 2812
                 }
2813
-                $half = (int)(count($counter) / 2);
2813
+                $half = (int) (count($counter) / 2);
2814 2814
                 $chtt = substr_replace($title, '|', $counter[$half], 1);
2815 2815
             }
2816 2816
 
@@ -3386,16 +3386,16 @@  discard block
 block discarded – undo
3386 3386
             case 'age':
3387 3387
                 $age = $row->age;
3388 3388
                 if ($show_years) {
3389
-                    if ((int)($age / 365.25) > 0) {
3390
-                        $age = (int)($age / 365.25) . 'y';
3391
-                    } elseif ((int)($age / 30.4375) > 0) {
3392
-                        $age = (int)($age / 30.4375) . 'm';
3389
+                    if ((int) ($age / 365.25) > 0) {
3390
+                        $age = (int) ($age / 365.25) . 'y';
3391
+                    } elseif ((int) ($age / 30.4375) > 0) {
3392
+                        $age = (int) ($age / 30.4375) . 'm';
3393 3393
                     } else {
3394 3394
                         $age = $age . 'd';
3395 3395
                     }
3396 3396
                     $result = FunctionsDate::getAgeAtEvent($age);
3397 3397
                 } else {
3398
-                    $result = I18N::number((int)($age / 365.25));
3398
+                    $result = I18N::number((int) ($age / 365.25));
3399 3399
                 }
3400 3400
                 break;
3401 3401
         }
@@ -3415,7 +3415,7 @@  discard block
 block discarded – undo
3415 3415
     private function ageOfMarriageQuery($type = 'list', $age_dir = 'ASC', $params = [])
3416 3416
     {
3417 3417
         if (isset($params[0])) {
3418
-            $total = (int)$params[0];
3418
+            $total = (int) $params[0];
3419 3419
         } else {
3420 3420
             $total = 10;
3421 3421
         }
@@ -3501,10 +3501,10 @@  discard block
 block discarded – undo
3501 3501
             if ($type === 'name') {
3502 3502
                 return $family->formatList();
3503 3503
             }
3504
-            if ((int)($age / 365.25) > 0) {
3505
-                $age = (int)($age / 365.25) . 'y';
3506
-            } elseif ((int)($age / 30.4375) > 0) {
3507
-                $age = (int)($age / 30.4375) . 'm';
3504
+            if ((int) ($age / 365.25) > 0) {
3505
+                $age = (int) ($age / 365.25) . 'y';
3506
+            } elseif ((int) ($age / 30.4375) > 0) {
3507
+                $age = (int) ($age / 30.4375) . 'm';
3508 3508
             } else {
3509 3509
                 $age = $age . 'd';
3510 3510
             }
@@ -3566,7 +3566,7 @@  discard block
 block discarded – undo
3566 3566
     private function ageBetweenSpousesQuery($type = 'list', $age_dir = 'DESC', $params = [])
3567 3567
     {
3568 3568
         if (isset($params[0])) {
3569
-            $total = (int)$params[0];
3569
+            $total = (int) $params[0];
3570 3570
         } else {
3571 3571
             $total = 10;
3572 3572
         }
@@ -3611,10 +3611,10 @@  discard block
 block discarded – undo
3611 3611
                 break;
3612 3612
             }
3613 3613
             $age = $fam->age;
3614
-            if ((int)($age / 365.25) > 0) {
3615
-                $age = (int)($age / 365.25) . 'y';
3616
-            } elseif ((int)($age / 30.4375) > 0) {
3617
-                $age = (int)($age / 30.4375) . 'm';
3614
+            if ((int) ($age / 365.25) > 0) {
3615
+                $age = (int) ($age / 365.25) . 'y';
3616
+            } elseif ((int) ($age / 30.4375) > 0) {
3617
+                $age = (int) ($age / 30.4375) . 'm';
3618 3618
             } else {
3619 3619
                 $age = $age . 'd';
3620 3620
             }
@@ -3702,16 +3702,16 @@  discard block
 block discarded – undo
3702 3702
             case 'age':
3703 3703
                 $age = $row->age;
3704 3704
                 if ($show_years) {
3705
-                    if ((int)($age / 365.25) > 0) {
3706
-                        $age = (int)($age / 365.25) . 'y';
3707
-                    } elseif ((int)($age / 30.4375) > 0) {
3708
-                        $age = (int)($age / 30.4375) . 'm';
3705
+                    if ((int) ($age / 365.25) > 0) {
3706
+                        $age = (int) ($age / 365.25) . 'y';
3707
+                    } elseif ((int) ($age / 30.4375) > 0) {
3708
+                        $age = (int) ($age / 30.4375) . 'm';
3709 3709
                     } else {
3710 3710
                         $age = $age . 'd';
3711 3711
                     }
3712 3712
                     $result = FunctionsDate::getAgeAtEvent($age);
3713 3713
                 } else {
3714
-                    $result = (int)($age / 365.25);
3714
+                    $result = (int) ($age / 365.25);
3715 3715
                 }
3716 3716
                 break;
3717 3717
         }
@@ -3797,7 +3797,7 @@  discard block
 block discarded – undo
3797 3797
             $sizes = explode('x', $size);
3798 3798
             $tot   = 0;
3799 3799
             foreach ($rows as $values) {
3800
-                $tot += (int)$values->total;
3800
+                $tot += (int) $values->total;
3801 3801
             }
3802 3802
             // Beware divide by zero
3803 3803
             if ($tot === 0) {
@@ -3806,7 +3806,7 @@  discard block
 block discarded – undo
3806 3806
             $centuries = '';
3807 3807
             $counts    = [];
3808 3808
             foreach ($rows as $values) {
3809
-                $counts[]  = round(100 * $values->total / $tot, 0);
3809
+                $counts[] = round(100 * $values->total / $tot, 0);
3810 3810
                 $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|';
3811 3811
             }
3812 3812
             $chd = $this->arrayToExtendedEncoding($counts);
@@ -3904,7 +3904,7 @@  discard block
 block discarded – undo
3904 3904
             $centuries = '';
3905 3905
             $counts    = [];
3906 3906
             foreach ($rows as $values) {
3907
-                $counts[]  = round(100 * $values->total / $tot, 0);
3907
+                $counts[] = round(100 * $values->total / $tot, 0);
3908 3908
                 $centuries .= $this->centuryName($values->century) . ' - ' . I18N::number($values->total) . '|';
3909 3909
             }
3910 3910
             $chd = $this->arrayToExtendedEncoding($counts);
@@ -4173,7 +4173,7 @@  discard block
 block discarded – undo
4173 4173
                 if ($sizes[0] < 1000) {
4174 4174
                     $sizes[0] += 50;
4175 4175
                 }
4176
-                $chxl    .= $this->centuryName($century) . '|';
4176
+                $chxl .= $this->centuryName($century) . '|';
4177 4177
                 $average = 0;
4178 4178
                 if (isset($values['F'])) {
4179 4179
                     if ($max <= 50) {
@@ -4230,7 +4230,7 @@  discard block
 block discarded – undo
4230 4230
                 while ($offset = strpos(I18N::translate('Average age in century of marriage'), ' ', $offset + 1)) {
4231 4231
                     $counter[] = $offset;
4232 4232
                 }
4233
-                $half = (int)(count($counter) / 2);
4233
+                $half = (int) (count($counter) / 2);
4234 4234
                 $chtt = substr_replace(I18N::translate('Average age in century of marriage'), '|', $counter[$half], 1);
4235 4235
             }
4236 4236
 
@@ -4762,7 +4762,7 @@  discard block
 block discarded – undo
4762 4762
     private function topTenFamilyQuery($type = 'list', $params = [])
4763 4763
     {
4764 4764
         if (isset($params[0])) {
4765
-            $total = (int)$params[0];
4765
+            $total = (int) $params[0];
4766 4766
         } else {
4767 4767
             $total = 10;
4768 4768
         }
@@ -4829,7 +4829,7 @@  discard block
 block discarded – undo
4829 4829
     private function ageBetweenSiblingsQuery($type = 'list', $params = [])
4830 4830
     {
4831 4831
         if (isset($params[0])) {
4832
-            $total = (int)$params[0];
4832
+            $total = (int) $params[0];
4833 4833
         } else {
4834 4834
             $total = 10;
4835 4835
         }
@@ -4885,10 +4885,10 @@  discard block
 block discarded – undo
4885 4885
                 return $return;
4886 4886
             }
4887 4887
             $age = $fam->age;
4888
-            if ((int)($age / 365.25) > 0) {
4889
-                $age = (int)($age / 365.25) . 'y';
4890
-            } elseif ((int)($age / 30.4375) > 0) {
4891
-                $age = (int)($age / 30.4375) . 'm';
4888
+            if ((int) ($age / 365.25) > 0) {
4889
+                $age = (int) ($age / 365.25) . 'y';
4890
+            } elseif ((int) ($age / 30.4375) > 0) {
4891
+                $age = (int) ($age / 30.4375) . 'm';
4892 4892
             } else {
4893 4893
                 $age = $age . 'd';
4894 4894
             }
@@ -4899,7 +4899,7 @@  discard block
 block discarded – undo
4899 4899
             if ($type == 'list') {
4900 4900
                 if ($one && !in_array($fam->family, $dist)) {
4901 4901
                     if ($child1->canShow() && $child2->canShow()) {
4902
-                        $return  = '<li>';
4902
+                        $return = '<li>';
4903 4903
                         $return  .= '<a href="' . e($child2->url()) . '">' . $child2->getFullName() . '</a> ';
4904 4904
                         $return  .= I18N::translate('and') . ' ';
4905 4905
                         $return  .= '<a href="' . e($child1->url()) . '">' . $child1->getFullName() . '</a>';
@@ -4910,7 +4910,7 @@  discard block
 block discarded – undo
4910 4910
                         $dist[]  = $fam->family;
4911 4911
                     }
4912 4912
                 } elseif (!$one && $child1->canShow() && $child2->canShow()) {
4913
-                    $return  = '<li>';
4913
+                    $return = '<li>';
4914 4914
                     $return  .= '<a href="' . e($child2->url()) . '">' . $child2->getFullName() . '</a> ';
4915 4915
                     $return  .= I18N::translate('and') . ' ';
4916 4916
                     $return  .= '<a href="' . e($child1->url()) . '">' . $child1->getFullName() . '</a>';
@@ -5185,7 +5185,7 @@  discard block
 block discarded – undo
5185 5185
             $total = 10;
5186 5186
         }
5187 5187
         $sizes = explode('x', $size);
5188
-        $total = (int)$total;
5188
+        $total = (int) $total;
5189 5189
         $rows  = $this->runSql(
5190 5190
             " SELECT f_numchil AS tot, f_id AS id" .
5191 5191
             " FROM `##families`" .
@@ -5198,7 +5198,7 @@  discard block
 block discarded – undo
5198 5198
         }
5199 5199
         $tot = 0;
5200 5200
         foreach ($rows as $row) {
5201
-            $tot += (int)$row->tot;
5201
+            $tot += (int) $row->tot;
5202 5202
         }
5203 5203
         $chd = '';
5204 5204
         $chl = [];
@@ -5210,7 +5210,7 @@  discard block
 block discarded – undo
5210 5210
                 } else {
5211 5211
                     $per = round(100 * $row->tot / $tot, 0);
5212 5212
                 }
5213
-                $chd   .= $this->arrayToExtendedEncoding([$per]);
5213
+                $chd .= $this->arrayToExtendedEncoding([$per]);
5214 5214
                 $chl[] = htmlspecialchars_decode(strip_tags($family->getFullName())) . ' - ' . I18N::number($row->tot);
5215 5215
             }
5216 5216
         }
@@ -5556,7 +5556,7 @@  discard block
 block discarded – undo
5556 5556
             if ($max < $values->count) {
5557 5557
                 $max = $values->count;
5558 5558
             }
5559
-            $tot += (int)$values->count;
5559
+            $tot += (int) $values->count;
5560 5560
         }
5561 5561
         $unknown = $this->noChildrenFamiliesQuery() - $tot;
5562 5562
         if ($unknown > $max) {
@@ -5580,13 +5580,13 @@  discard block
 block discarded – undo
5580 5580
         $chm      .= 't' . $unknown . ',000000,0,' . $i . ',11,1';
5581 5581
         $chxl     .= I18N::translateContext('unknown century', 'Unknown') . '|1:||' . I18N::translate('century') . '|2:|0|';
5582 5582
         $step     = $max + 1;
5583
-        for ($d = (int)($max + 1); $d > 0; $d--) {
5583
+        for ($d = (int) ($max + 1); $d > 0; $d--) {
5584 5584
             if (($max + 1) < ($d * 10 + 1) && fmod(($max + 1), $d) == 0) {
5585 5585
                 $step = $d;
5586 5586
             }
5587 5587
         }
5588
-        if ($step == (int)($max + 1)) {
5589
-            for ($d = (int)($max); $d > 0; $d--) {
5588
+        if ($step == (int) ($max + 1)) {
5589
+            for ($d = (int) ($max); $d > 0; $d--) {
5590 5590
                 if ($max < ($d * 10 + 1) && fmod($max, $d) == 0) {
5591 5591
                     $step = $d;
5592 5592
                 }
@@ -5611,7 +5611,7 @@  discard block
 block discarded – undo
5611 5611
     private function topTenGrandFamilyQuery($type = 'list', $params = [])
5612 5612
     {
5613 5613
         if (isset($params[0])) {
5614
-            $total = (int)$params[0];
5614
+            $total = (int) $params[0];
5615 5615
         } else {
5616 5616
             $total = 10;
5617 5617
         }
@@ -5709,8 +5709,8 @@  discard block
 block discarded – undo
5709 5709
      */
5710 5710
     private function commonSurnamesQuery($type = 'list', $show_tot = false, $params = [])
5711 5711
     {
5712
-        $threshold          = empty($params[0]) ? 10 : (int)$params[0];
5713
-        $number_of_surnames = empty($params[1]) ? 10 : (int)$params[1];
5712
+        $threshold          = empty($params[0]) ? 10 : (int) $params[0];
5713
+        $number_of_surnames = empty($params[1]) ? 10 : (int) $params[1];
5714 5714
         $sorting            = empty($params[2]) ? 'alpha' : $params[2];
5715 5715
 
5716 5716
         $surnames = $this->topSurnames($number_of_surnames, $threshold);
@@ -5886,7 +5886,7 @@  discard block
 block discarded – undo
5886 5886
             $max_name  = 0;
5887 5887
             $top_name  = '';
5888 5888
             foreach ($surns as $spfxsurn => $count) {
5889
-                $per       = $count;
5889
+                $per = $count;
5890 5890
                 $count_per += $per;
5891 5891
                 // select most common surname from all variants
5892 5892
                 if ($per > $max_name) {
@@ -5910,11 +5910,11 @@  discard block
 block discarded – undo
5910 5910
                     ], $top_name);
5911 5911
             }
5912 5912
             $per   = round(100 * $count_per / $tot_indi, 0);
5913
-            $chd   .= $this->arrayToExtendedEncoding([$per]);
5913
+            $chd .= $this->arrayToExtendedEncoding([$per]);
5914 5914
             $chl[] = $top_name . ' - ' . I18N::number($count_per);
5915 5915
         }
5916 5916
         $per   = round(100 * ($tot_indi - $tot) / $tot_indi, 0);
5917
-        $chd   .= $this->arrayToExtendedEncoding([$per]);
5917
+        $chd .= $this->arrayToExtendedEncoding([$per]);
5918 5918
         $chl[] = I18N::translate('Other') . ' - ' . I18N::number($tot_indi - $tot);
5919 5919
 
5920 5920
         $chart_title = implode(I18N::$list_separator, $chl);
@@ -5936,12 +5936,12 @@  discard block
 block discarded – undo
5936 5936
     private function commonGivenQuery($sex = 'B', $type = 'list', $show_tot = false, $params = [])
5937 5937
     {
5938 5938
         if (isset($params[0]) && $params[0] != '' && $params[0] >= 0) {
5939
-            $threshold = (int)$params[0];
5939
+            $threshold = (int) $params[0];
5940 5940
         } else {
5941 5941
             $threshold = 1;
5942 5942
         }
5943 5943
         if (isset($params[1]) && $params[1] != '' && $params[1] >= 0) {
5944
-            $maxtoshow = (int)$params[1];
5944
+            $maxtoshow = (int) $params[1];
5945 5945
         } else {
5946 5946
             $maxtoshow = 10;
5947 5947
         }
@@ -6414,11 +6414,11 @@  discard block
 block discarded – undo
6414 6414
             } else {
6415 6415
                 $per = round(100 * $count / $tot_indi, 0);
6416 6416
             }
6417
-            $chd   .= $this->arrayToExtendedEncoding([$per]);
6417
+            $chd .= $this->arrayToExtendedEncoding([$per]);
6418 6418
             $chl[] = $givn . ' - ' . I18N::number($count);
6419 6419
         }
6420 6420
         $per   = round(100 * ($tot_indi - $tot) / $tot_indi, 0);
6421
-        $chd   .= $this->arrayToExtendedEncoding([$per]);
6421
+        $chd .= $this->arrayToExtendedEncoding([$per]);
6422 6422
         $chl[] = I18N::translate('Other') . ' - ' . I18N::number($tot_indi - $tot);
6423 6423
 
6424 6424
         $chart_title = implode(I18N::$list_separator, $chl);
@@ -6645,7 +6645,7 @@  discard block
 block discarded – undo
6645 6645
                     $datestamp = I18N::dateFormat();
6646 6646
                 }
6647 6647
 
6648
-                return FunctionsDate::timestampToGedcomDate((int)$user->getPreference('reg_timestamp'))->display(false, $datestamp);
6648
+                return FunctionsDate::timestampToGedcomDate((int) $user->getPreference('reg_timestamp'))->display(false, $datestamp);
6649 6649
             case 'regtime':
6650 6650
                 if (is_array($params) && isset($params[0]) && $params[0] != '') {
6651 6651
                     $datestamp = $params[0];
@@ -6653,7 +6653,7 @@  discard block
 block discarded – undo
6653 6653
                     $datestamp = str_replace('%', '', I18N::timeFormat());
6654 6654
                 }
6655 6655
 
6656
-                return date($datestamp, (int)$user->getPreference('reg_timestamp'));
6656
+                return date($datestamp, (int) $user->getPreference('reg_timestamp'));
6657 6657
             case 'loggedin':
6658 6658
                 if (is_array($params) && isset($params[0]) && $params[0] != '') {
6659 6659
                     $yes = $params[0];
@@ -6993,9 +6993,9 @@  discard block
 block discarded – undo
6993 6993
             if ($value < 0) {
6994 6994
                 $value = 0;
6995 6995
             }
6996
-            $first    = (int)($value / 64);
6996
+            $first    = (int) ($value / 64);
6997 6997
             $second   = $value % 64;
6998
-            $encoding .= $xencoding[(int)$first] . $xencoding[(int)$second];
6998
+            $encoding .= $xencoding[(int) $first] . $xencoding[(int) $second];
6999 6999
         }
7000 7000
 
7001 7001
         return $encoding;
@@ -7140,7 +7140,7 @@  discard block
 block discarded – undo
7140 7140
      */
7141 7141
     public function totalUserMessages()
7142 7142
     {
7143
-        $total = (int)Database::prepare("SELECT COUNT(*) FROM `##message` WHERE user_id = ?")
7143
+        $total = (int) Database::prepare("SELECT COUNT(*) FROM `##message` WHERE user_id = ?")
7144 7144
             ->execute([Auth::id()])
7145 7145
             ->fetchOne();
7146 7146
 
@@ -7155,7 +7155,7 @@  discard block
 block discarded – undo
7155 7155
     public function totalUserJournal()
7156 7156
     {
7157 7157
         try {
7158
-            $number = (int)Database::prepare("SELECT COUNT(*) FROM `##news` WHERE user_id = ?")
7158
+            $number = (int) Database::prepare("SELECT COUNT(*) FROM `##news` WHERE user_id = ?")
7159 7159
                 ->execute([Auth::id()])
7160 7160
                 ->fetchOne();
7161 7161
         } catch (PDOException $ex) {
@@ -7176,7 +7176,7 @@  discard block
 block discarded – undo
7176 7176
     public function totalGedcomNews()
7177 7177
     {
7178 7178
         try {
7179
-            $number = (int)Database::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?")
7179
+            $number = (int) Database::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?")
7180 7180
                 ->execute([$this->tree->getTreeId()])
7181 7181
                 ->fetchOne();
7182 7182
         } catch (PDOException $ex) {
Please login to merge, or discard this patch.
app/Census/CensusColumnAge.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,6 +34,6 @@
 block discarded – undo
34 34
      */
35 35
     public function generate(Individual $individual, Individual $head)
36 36
     {
37
-        return (string)Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0);
37
+        return (string) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0);
38 38
     }
39 39
 }
Please login to merge, or discard this patch.
app/Theme/AbstractTheme.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     {
215 215
         if ($analytics_id) {
216 216
             // Add extra dimensions (i.e. filtering categories)
217
-            $dimensions = (object)[
217
+            $dimensions = (object) [
218 218
                 'dimension1' => $this->tree ? $this->tree->getName() : '-',
219 219
                 'dimension2' => $this->tree ? Auth::accessLevel($this->tree) : '-',
220 220
             ];
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
         if ($project_id && $security_id) {
277 277
             return
278 278
                 '<script>' .
279
-                'var sc_project=' . (int)$project_id . ',sc_invisible=1,sc_security="' . $security_id .
279
+                'var sc_project=' . (int) $project_id . ',sc_invisible=1,sc_security="' . $security_id .
280 280
                 '",scJsHost = (("https:"===document.location.protocol)?"https://secure.":"http://www.");' .
281 281
                 'document.write("<sc"+"ript src=\'"+scJsHost+"statcounter.com/counter/counter.js\'></"+"script>");' .
282 282
                 '</script>';
@@ -1803,7 +1803,7 @@  discard block
 block discarded – undo
1803 1803
     public function menuSearchPhonetic()
1804 1804
     {
1805 1805
         /* I18N: search using “sounds like”, rather than exact spelling */
1806
-        return new Menu(I18N::translate('Phonetic search'), route('search-phonetic', ['ged'    => $this->tree->getName(), 'action' => 'soundex',]), 'menu-search-soundex', ['rel' => 'nofollow']);
1806
+        return new Menu(I18N::translate('Phonetic search'), route('search-phonetic', ['ged'    => $this->tree->getName(), 'action' => 'soundex', ]), 'menu-search-soundex', ['rel' => 'nofollow']);
1807 1807
     }
1808 1808
 
1809 1809
     /**
Please login to merge, or discard this patch.