Completed
Branch develop (b6db7c)
by Greg
09:30
created
app/Http/Controllers/Auth/VerifyEmailController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
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(),
Please login to merge, or discard this patch.
app/Http/Controllers/AdminUpgradeController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function wizard(Request $request): Response
63 63
     {
64
-        $continue = (bool)$request->get('continue');
64
+        $continue = (bool) $request->get('continue');
65 65
 
66 66
         $title = I18N::translate('Upgrade wizard');
67 67
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $export_steps = [];
121 121
 
122 122
         foreach (Tree::getAll() as $tree) {
123
-            $route                = route('upgrade', [
123
+            $route = route('upgrade', [
124 124
                 'step' => 'Export',
125 125
                 'ged'  => $tree->getName(),
126 126
             ]);
Please login to merge, or discard this patch.
app/Http/Controllers/MessageController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -344,8 +344,8 @@  discard block
 block discarded – undo
344 344
     private function validContacts(Tree $tree)
345 345
     {
346 346
         $contacts = [
347
-            User::find((int)$tree->getPreference('CONTACT_USER_ID')),
348
-            User::find((int)$tree->getPreference('WEBMASTER_USER_ID')),
347
+            User::find((int) $tree->getPreference('CONTACT_USER_ID')),
348
+            User::find((int) $tree->getPreference('WEBMASTER_USER_ID')),
349 349
         ];
350 350
 
351 351
         return array_filter($contacts);
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
     {
370 370
         // Create a dummy user, so we can send messages from the tree.
371 371
         $from = new User(
372
-            (object)[
372
+            (object) [
373 373
                 'user_id'   => null,
374 374
                 'user_name' => '',
375 375
                 'real_name' => $tree->getTitle(),
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 
380 380
         // Create a dummy user, so we can reply to visitors.
381 381
         $sender = new User(
382
-            (object)[
382
+            (object) [
383 383
                 'user_id'   => null,
384 384
                 'user_name' => '',
385 385
                 'real_name' => $sender_name,
Please login to merge, or discard this patch.
app/Http/Controllers/AncestorsChartController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -64,12 +64,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
app/Http/Controllers/HourglassChartController.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -57,15 +57,15 @@  discard block
 block discarded – undo
57 57
 
58 58
         $this->checkIndividualAccess($individual);
59 59
 
60
-        $maximum_generations = (int)$tree->getPreference('MAX_DESCENDANCY_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS);
61
-        $default_generations = (int)$tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS);
60
+        $maximum_generations = (int) $tree->getPreference('MAX_DESCENDANCY_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS);
61
+        $default_generations = (int) $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS);
62 62
 
63
-        $generations = (int)$request->get('generations', $default_generations);
63
+        $generations = (int) $request->get('generations', $default_generations);
64 64
 
65 65
         $generations = min($generations, $maximum_generations);
66 66
         $generations = max($generations, self::MINIMUM_GENERATIONS);
67 67
 
68
-        $show_spouse = (bool)$request->get('show_spouse');
68
+        $show_spouse = (bool) $request->get('show_spouse');
69 69
 
70 70
         $title = /* I18N: %s is an individual’s name */
71 71
             I18N::translate('Hourglass chart of %s', $individual->getFullName());
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
 
100 100
         $this->checkIndividualAccess($individual);
101 101
 
102
-        $maximum_generations = (int)$tree->getPreference('MAX_DESCENDANCY_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS);
103
-        $default_generations = (int)$tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS);
102
+        $maximum_generations = (int) $tree->getPreference('MAX_DESCENDANCY_GENERATIONS', self::DEFAULT_MAXIMUM_GENERATIONS);
103
+        $default_generations = (int) $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS', self::DEFAULT_GENERATIONS);
104 104
 
105
-        $generations = (int)$request->get('generations', $default_generations);
105
+        $generations = (int) $request->get('generations', $default_generations);
106 106
         $generations = min($generations, $maximum_generations);
107 107
         $generations = max($generations, self::MINIMUM_GENERATIONS);
108 108
 
109
-        $show_spouse = (bool)$request->get('show_spouse');
109
+        $show_spouse = (bool) $request->get('show_spouse');
110 110
 
111 111
         ob_start();
112 112
         $this->printDescendency($individual, 1, $generations, $show_spouse, true);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         return new Response(view('hourglass-chart', [
120 120
             'descendants' => $descendants,
121 121
             'ancestors'   => $ancestors,
122
-            'bhalfheight' => (int)(Theme::theme()->parameter('chart-box-y') / 2),
122
+            'bhalfheight' => (int) (Theme::theme()->parameter('chart-box-y') / 2),
123 123
         ]));
124 124
     }
125 125
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
         $this->checkIndividualAccess($individual);
142 142
 
143
-        $show_spouse = (bool)$request->get('show_spouse');
143
+        $show_spouse = (bool) $request->get('show_spouse');
144 144
 
145 145
         ob_start();
146 146
         $this->printPersonPedigree($individual, 0, 1, $show_spouse);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         $xref       = $request->get('xref');
165 165
         $individual = Individual::getInstance($xref, $tree);
166 166
 
167
-        $show_spouse = (bool)$request->get('show_spouse');
167
+        $show_spouse = (bool) $request->get('show_spouse');
168 168
 
169 169
         ob_start();
170 170
         $this->printDescendency($individual, 1, 2, $show_spouse, false);
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
                     echo '<a href="' . e(route('hourglass', [
318 318
                             'xref'        => $spouse->getXref(),
319 319
                             'generations' => $generations,
320
-                            'show_spouse' => (int)$show_spouse,
320
+                            'show_spouse' => (int) $show_spouse,
321 321
                             'ged'         => $spouse->getTree()->getName(),
322 322
                         ])) . '" class="name1">' . $spouse->getFullName() . '</a>';
323 323
                 }
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
                     echo '<a href="' . e(route('hourglass', [
326 326
                             'xref'        => $child->getXref(),
327 327
                             'generations' => $generations,
328
-                            'show_spouse' => (int)$show_spouse,
328
+                            'show_spouse' => (int) $show_spouse,
329 329
                             'ged'         => $child->getTree()->getName(),
330 330
                         ])) . '" class="name1">' . $child->getFullName() . '</a>';
331 331
                 }
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
                         echo '<a href="' . e(route('hourglass', [
341 341
                                 'xref'        => $husb->getXref(),
342 342
                                 'generations' => $generations,
343
-                                'show_spouse' => (int)$show_spouse,
343
+                                'show_spouse' => (int) $show_spouse,
344 344
                                 'ged'         => $husb->getTree()->getName(),
345 345
                             ])) . '" class="name1">' . $husb->getFullName() . '</a>';
346 346
                     }
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
                         echo '<a href="' . e(route('hourglass', [
350 350
                                 'xref'        => $wife->getXref(),
351 351
                                 'generations' => $generations,
352
-                                'show_spouse' => (int)$show_spouse,
352
+                                'show_spouse' => (int) $show_spouse,
353 353
                                 'ged'         => $wife->getTree()->getName(),
354 354
                             ])) . '" class="name1">' . $wife->getFullName() . '</a>';
355 355
                     }
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
                         echo '<a href="' . e(route('hourglass', [
369 369
                                 'xref'        => $child->getXref(),
370 370
                                 'generations' => $generations,
371
-                                'show_spouse' => (int)$show_spouse,
371
+                                'show_spouse' => (int) $show_spouse,
372 372
                                 'ged'         => $child->getTree()->getName(),
373 373
                             ])) . '" class="name1">' . $child->getFullName() . '</a>';
374 374
                     }
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
                         'href'         => '#',
432 432
                         'data-route'   => 'hourglass-add-asc',
433 433
                         'data-xref'    => $ARID,
434
-                        'data-spouses' => (int)$show_spouse,
434
+                        'data-spouses' => (int) $show_spouse,
435 435
                         'data-tree'    => $family->getHusband()->getTree()->getName(),
436 436
                     ]);
437 437
                 }
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
                         'href'         => '#',
469 469
                         'data-route'   => 'hourglass-add-asc',
470 470
                         'data-xref'    => $ARID,
471
-                        'data-spouses' => (int)$show_spouse,
471
+                        'data-spouses' => (int) $show_spouse,
472 472
                         'data-tree'    => $family->getWife()->getTree()->getName(),
473 473
                     ]);
474 474
                 }
Please login to merge, or discard this patch.
app/Http/Controllers/IndividualController.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -443,7 +443,7 @@
 block discarded – undo
443 443
      */
444 444
     private function significant(Individual $individual)
445 445
     {
446
-        $significant = (object)[
446
+        $significant = (object) [
447 447
             'family'     => null,
448 448
             'individual' => $individual,
449 449
             'surname'    => '',
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 {
Please login to merge, or discard this patch.
app/Http/Controllers/AdminMediaController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
         $files  = $request->get('files'); // local|external|unused
120 120
         $search = $request->get('search');
121 121
         $search = $search['value'];
122
-        $start  = (int)$request->get('start');
123
-        $length = (int)$request->get('length');
122
+        $start  = (int) $request->get('start');
123
+        $length = (int) $request->get('length');
124 124
 
125 125
         // family tree setting MEDIA_DIRECTORY
126 126
         $media_folders = $this->allMediaFolders();
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                     "  OR   descriptive_title LIKE CONCAT('%', :search_2, '%'))" .
157 157
                     " AND   multimedia_file_refn NOT LIKE 'http://%'" .
158 158
                     " AND   multimedia_file_refn NOT LIKE 'https://%'";
159
-                $ARGS1   = [
159
+                $ARGS1 = [
160 160
                     'media_path_1' => $media_path,
161 161
                     'media_folder' => $media_folder,
162 162
                     'media_path_2' => Database::escapeLike($media_path),
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
                     " AND   multimedia_file_refn LIKE CONCAT(:media_path_3, '%')" .
174 174
                     " AND   multimedia_file_refn NOT LIKE 'http://%'" .
175 175
                     " AND   multimedia_file_refn NOT LIKE 'https://%'";
176
-                $ARGS2   = [
176
+                $ARGS2 = [
177 177
                     'media_folder' => $media_folder,
178 178
                     'media_path_3' => $media_path,
179 179
                 ];
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                     $ARGS2['media_path_4'] = Database::escapeLike($media_path);
186 186
                 }
187 187
 
188
-                $order   = $request->get('order', []);
188
+                $order = $request->get('order', []);
189 189
                 $SELECT1 .= " ORDER BY ";
190 190
                 if ($order) {
191 191
                     foreach ($order as $key => $value) {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
                 }
210 210
 
211 211
                 if ($length > 0) {
212
-                    $SELECT1         .= " LIMIT :length OFFSET :start";
212
+                    $SELECT1 .= " LIMIT :length OFFSET :start";
213 213
                     $ARGS1['length'] = $length;
214 214
                     $ARGS1['start']  = $start;
215 215
                 }
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                     " JOIN  `##media_file` USING (m_id, m_file)" .
243 243
                     " WHERE (multimedia_file_refn LIKE 'http://%' OR multimedia_file_refn LIKE 'https://%')" .
244 244
                     " AND   (multimedia_file_refn LIKE CONCAT('%', :search_1, '%') OR descriptive_title LIKE CONCAT('%', :search_2, '%'))";
245
-                $ARGS1   = [
245
+                $ARGS1 = [
246 246
                     'search_1' => Database::escapeLike($search),
247 247
                     'search_2' => Database::escapeLike($search),
248 248
                 ];
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                 }
279 279
 
280 280
                 if ($length > 0) {
281
-                    $SELECT1         .= " LIMIT :length OFFSET :start";
281
+                    $SELECT1 .= " LIMIT :length OFFSET :start";
282 282
                     $ARGS1['length'] = $length;
283 283
                     $ARGS1['start']  = $start;
284 284
                 }
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
         $full_path = WT_DATA_DIR . $media_folder . $media_path . $file;
661 661
         try {
662 662
             $size = filesize($full_path);
663
-            $size = (int)(($size + 1023) / 1024); // Round up to next KB
663
+            $size = (int) (($size + 1023) / 1024); // Round up to next KB
664 664
             $size = /* I18N: size of file in KB */
665 665
                 I18N::translate('%s KB', I18N::number($size));
666 666
             $html .= '<dt>' . I18N::translate('File size') . '</dt>';
Please login to merge, or discard this patch.
app/Http/Controllers/SearchController.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -167,11 +167,11 @@  discard block
 block discarded – undo
167 167
         $query = $request->get('query', '');
168 168
 
169 169
         // What type of records to search?
170
-        $search_individuals  = (bool)$request->get('search_individuals');
171
-        $search_families     = (bool)$request->get('search_families');
172
-        $search_repositories = (bool)$request->get('search_repositories');
173
-        $search_sources      = (bool)$request->get('search_sources');
174
-        $search_notes        = (bool)$request->get('search_notes');
170
+        $search_individuals  = (bool) $request->get('search_individuals');
171
+        $search_families     = (bool) $request->get('search_families');
172
+        $search_repositories = (bool) $request->get('search_repositories');
173
+        $search_sources      = (bool) $request->get('search_sources');
174
+        $search_notes        = (bool) $request->get('search_notes');
175 175
 
176 176
         // Default to individuals only
177 177
         if (!$search_individuals && !$search_families && !$search_repositories && !$search_sources && !$search_notes) {
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             $all_trees = [$tree];
189 189
         }
190 190
 
191
-        $search_tree_names = (array)$request->get('search_trees', []);
191
+        $search_tree_names = (array) $request->get('search_trees', []);
192 192
 
193 193
         $search_trees = array_filter($all_trees, function (Tree $tree) use ($search_tree_names) {
194 194
             return in_array($tree->getName(), $search_tree_names);
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
             $all_trees = [$tree];
297 297
         }
298 298
 
299
-        $search_tree_names = (array)$request->get('search_trees', []);
299
+        $search_tree_names = (array) $request->get('search_trees', []);
300 300
 
301 301
         $search_trees = array_filter($all_trees, function (Tree $tree) use ($search_tree_names) {
302 302
             return in_array($tree->getName(), $search_tree_names);
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 
651 651
         foreach ($search_terms as $n => $q) {
652 652
             $queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
653
-            $sql                   .= " AND f_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
653
+            $sql .= " AND f_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
654 654
             $args['collate_' . $n] = I18N::collation();
655 655
             $args['query_' . $n]   = Database::escapeLike($q);
656 656
         }
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
      */
699 699
     private function searchFamilyNames(array $search_terms, array $search_trees): array
700 700
     {
701
-        $sql  =
701
+        $sql =
702 702
             "SELECT DISTINCT f_id AS xref, f_file AS gedcom_id, f_gedcom AS gedcom" .
703 703
             " FROM `##families`" .
704 704
             " LEFT JOIN `##name` husb ON f_husb = husb.n_id AND f_file = husb.n_file" .
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
         $args = [];
708 708
 
709 709
         foreach ($search_terms as $n => $q) {
710
-            $sql                        .= " AND (husb.n_full COLLATE :husb_collate_" . $n . " LIKE CONCAT('%', :husb_query_" . $n . ", '%') OR wife.n_full COLLATE :wife_collate_" . $n . " LIKE CONCAT('%', :wife_query_" . $n . ", '%'))";
710
+            $sql .= " AND (husb.n_full COLLATE :husb_collate_" . $n . " LIKE CONCAT('%', :husb_query_" . $n . ", '%') OR wife.n_full COLLATE :wife_collate_" . $n . " LIKE CONCAT('%', :wife_query_" . $n . ", '%'))";
711 711
             $args['husb_collate_' . $n] = I18N::collation();
712 712
             $args['husb_query_' . $n]   = Database::escapeLike($q);
713 713
             $args['wife_collate_' . $n] = I18N::collation();
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 
760 760
         foreach ($search_terms as $n => $q) {
761 761
             $queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
762
-            $sql                   .= " AND i_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
762
+            $sql .= " AND i_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
763 763
             $args['collate_' . $n] = I18N::collation();
764 764
             $args['query_' . $n]   = Database::escapeLike($q);
765 765
         }
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
         }
907 907
 
908 908
         // Add the where clause
909
-        $sql    .= " WHERE ind.i_file=?";
909
+        $sql .= " WHERE ind.i_file=?";
910 910
         $bind[] = $tree->getTreeId();
911 911
 
912 912
         foreach ($fields as $field_name => $field_value) {
@@ -917,15 +917,15 @@  discard block
 block discarded – undo
917 917
                     case 'GIVN':
918 918
                         switch ($modifiers[$field_name]) {
919 919
                             case 'EXACT':
920
-                                $sql    .= " AND i_n.n_givn=?";
920
+                                $sql .= " AND i_n.n_givn=?";
921 921
                                 $bind[] = $field_value;
922 922
                                 break;
923 923
                             case 'BEGINS':
924
-                                $sql    .= " AND i_n.n_givn LIKE CONCAT(?, '%')";
924
+                                $sql .= " AND i_n.n_givn LIKE CONCAT(?, '%')";
925 925
                                 $bind[] = $field_value;
926 926
                                 break;
927 927
                             case 'CONTAINS':
928
-                                $sql    .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
928
+                                $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
929 929
                                 $bind[] = $field_value;
930 930
                                 break;
931 931
                             case 'SDX_STD':
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
                                     $sql .= ' AND (' . implode(' OR ', $sdx) . ')';
940 940
                                 } else {
941 941
                                     // No phonetic content? Use a substring match
942
-                                    $sql    .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
942
+                                    $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
943 943
                                     $bind[] = $field_value;
944 944
                                 }
945 945
                                 break;
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
                                     $sql .= ' AND (' . implode(' OR ', $sdx) . ')';
956 956
                                 } else {
957 957
                                     // No phonetic content? Use a substring match
958
-                                    $sql    .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
958
+                                    $sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
959 959
                                     $bind[] = $field_value;
960 960
                                 }
961 961
                                 break;
@@ -964,15 +964,15 @@  discard block
 block discarded – undo
964 964
                     case 'SURN':
965 965
                         switch ($modifiers[$field_name]) {
966 966
                             case 'EXACT':
967
-                                $sql    .= " AND i_n.n_surname=?";
967
+                                $sql .= " AND i_n.n_surname=?";
968 968
                                 $bind[] = $field_value;
969 969
                                 break;
970 970
                             case 'BEGINS':
971
-                                $sql    .= " AND i_n.n_surname LIKE CONCAT(?, '%')";
971
+                                $sql .= " AND i_n.n_surname LIKE CONCAT(?, '%')";
972 972
                                 $bind[] = $field_value;
973 973
                                 break;
974 974
                             case 'CONTAINS':
975
-                                $sql    .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')";
975
+                                $sql .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')";
976 976
                                 $bind[] = $field_value;
977 977
                                 break;
978 978
                             case 'SDX_STD':
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
                                     $sql .= " AND (" . implode(' OR ', $sdx) . ")";
987 987
                                 } else {
988 988
                                     // No phonetic content? Use a substring match
989
-                                    $sql    .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
989
+                                    $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
990 990
                                     $bind[] = $field_value;
991 991
                                 }
992 992
                                 break;
@@ -1003,7 +1003,7 @@  discard block
 block discarded – undo
1003 1003
                                     break;
1004 1004
                                 } else {
1005 1005
                                     // No phonetic content? Use a substring match
1006
-                                    $sql    .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
1006
+                                    $sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
1007 1007
                                     $bind[] = $field_value;
1008 1008
                                 }
1009 1009
                         }
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
                     case '_MARNM':
1013 1013
                     case '_HEB':
1014 1014
                     case '_AKA':
1015
-                        $sql    .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')";
1015
+                        $sql .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')";
1016 1016
                         $bind[] = $parts[1];
1017 1017
                         $bind[] = $field_value;
1018 1018
                         break;
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
                 $date = new Date($field_value);
1023 1023
                 if ($date->isOK()) {
1024 1024
                     $delta  = 365 * ($modifiers[$field_name] ?? 0);
1025
-                    $sql    .= " AND i_d.d_fact=? AND i_d.d_julianday1>=? AND i_d.d_julianday2<=?";
1025
+                    $sql .= " AND i_d.d_fact=? AND i_d.d_julianday1>=? AND i_d.d_julianday2<=?";
1026 1026
                     $bind[] = $parts[0];
1027 1027
                     $bind[] = $date->minimumJulianDay() - $delta;
1028 1028
                     $bind[] = $date->maximumJulianDay() + $delta;
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
                 $date = new Date($field_value);
1033 1033
                 if ($date->isOK()) {
1034 1034
                     $delta  = 365 * $modifiers[$field_name];
1035
-                    $sql    .= " AND f_d.d_fact=? AND f_d.d_julianday1>=? AND f_d.d_julianday2<=?";
1035
+                    $sql .= " AND f_d.d_fact=? AND f_d.d_julianday1>=? AND f_d.d_julianday2<=?";
1036 1036
                     $bind[] = $parts[1];
1037 1037
                     $bind[] = $date->minimumJulianDay() - $delta;
1038 1038
                     $bind[] = $date->maximumJulianDay() + $delta;
@@ -1040,12 +1040,12 @@  discard block
 block discarded – undo
1040 1040
             } elseif ($parts[1] === 'PLAC') {
1041 1041
                 // *:PLAC
1042 1042
                 // SQL can only link a place to a person/family, not to an event.
1043
-                $sql    .= " AND i_p.place LIKE CONCAT('%', ?, '%')";
1043
+                $sql .= " AND i_p.place LIKE CONCAT('%', ?, '%')";
1044 1044
                 $bind[] = $field_value;
1045 1045
             } elseif ($parts[0] === 'FAMS' && $parts[2] === 'PLAC') {
1046 1046
                 // FAMS:*:PLAC
1047 1047
                 // SQL can only link a place to a person/family, not to an event.
1048
-                $sql    .= " AND f_p.place LIKE CONCAT('%', ?, '%')";
1048
+                $sql .= " AND f_p.place LIKE CONCAT('%', ?, '%')";
1049 1049
                 $bind[] = $field_value;
1050 1050
             } elseif ($parts[0] === 'FAMC' && $parts[2] === 'NAME') {
1051 1051
                 $table = $parts[1] === 'HUSB' ? 'f_n' : 'm_n';
@@ -1054,15 +1054,15 @@  discard block
 block discarded – undo
1054 1054
                     case 'GIVN':
1055 1055
                         switch ($modifiers[$field_name]) {
1056 1056
                             case 'EXACT':
1057
-                                $sql    .= " AND {$table}.n_givn=?";
1057
+                                $sql .= " AND {$table}.n_givn=?";
1058 1058
                                 $bind[] = $field_value;
1059 1059
                                 break;
1060 1060
                             case 'BEGINS':
1061
-                                $sql    .= " AND {$table}.n_givn LIKE CONCAT(?, '%')";
1061
+                                $sql .= " AND {$table}.n_givn LIKE CONCAT(?, '%')";
1062 1062
                                 $bind[] = $field_value;
1063 1063
                                 break;
1064 1064
                             case 'CONTAINS':
1065
-                                $sql    .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
1065
+                                $sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
1066 1066
                                 $bind[] = $field_value;
1067 1067
                                 break;
1068 1068
                             case 'SDX_STD':
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
                                     $sql .= ' AND (' . implode(' OR ', $sdx) . ')';
1077 1077
                                 } else {
1078 1078
                                     // No phonetic content? Use a substring match
1079
-                                    $sql    .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')";
1079
+                                    $sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')";
1080 1080
                                     $bind[] = $field_value;
1081 1081
                                 }
1082 1082
                                 break;
@@ -1093,7 +1093,7 @@  discard block
 block discarded – undo
1093 1093
                                     break;
1094 1094
                                 } else {
1095 1095
                                     // No phonetic content? Use a substring match
1096
-                                    $sql    .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')";
1096
+                                    $sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')";
1097 1097
                                     $bind[] = $field_value;
1098 1098
                                 }
1099 1099
                         }
@@ -1101,15 +1101,15 @@  discard block
 block discarded – undo
1101 1101
                     case 'SURN':
1102 1102
                         switch ($modifiers[$field_name]) {
1103 1103
                             case 'EXACT':
1104
-                                $sql    .= " AND {$table}.n_surname=?";
1104
+                                $sql .= " AND {$table}.n_surname=?";
1105 1105
                                 $bind[] = $field_value;
1106 1106
                                 break;
1107 1107
                             case 'BEGINS':
1108
-                                $sql    .= " AND {$table}.n_surname LIKE CONCAT(?, '%')";
1108
+                                $sql .= " AND {$table}.n_surname LIKE CONCAT(?, '%')";
1109 1109
                                 $bind[] = $field_value;
1110 1110
                                 break;
1111 1111
                             case 'CONTAINS':
1112
-                                $sql    .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')";
1112
+                                $sql .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')";
1113 1113
                                 $bind[] = $field_value;
1114 1114
                                 break;
1115 1115
                             case 'SDX_STD':
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
                                     $sql .= ' AND (' . implode(' OR ', $sdx) . ')';
1124 1124
                                 } else {
1125 1125
                                     // No phonetic content? Use a substring match
1126
-                                    $sql    .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')";
1126
+                                    $sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')";
1127 1127
                                     $bind[] = $field_value;
1128 1128
                                 }
1129 1129
                                 break;
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
                                     $sql .= ' AND (' . implode(' OR ', $sdx) . ')';
1140 1140
                                 } else {
1141 1141
                                     // No phonetic content? Use a substring match
1142
-                                    $sql    .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')";
1142
+                                    $sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')";
1143 1143
                                     $bind[] = $field_value;
1144 1144
                                 }
1145 1145
                                 break;
@@ -1148,17 +1148,17 @@  discard block
 block discarded – undo
1148 1148
                 }
1149 1149
             } elseif ($parts[0] === 'FAMS') {
1150 1150
                 // e.g. searches for occupation, religion, note, etc.
1151
-                $sql    .= " AND fam.f_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)";
1151
+                $sql .= " AND fam.f_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)";
1152 1152
                 $bind[] = $parts[1];
1153 1153
                 $bind[] = $field_value;
1154 1154
             } elseif ($parts[1] === 'TYPE') {
1155 1155
                 // e.g. FACT:TYPE or EVEN:TYPE
1156
-                $sql    .= " AND ind.i_gedcom REGEXP CONCAT('\n1 ', ?, '.*(\n[2-9] .*)*\n2 TYPE .*', ?)";
1156
+                $sql .= " AND ind.i_gedcom REGEXP CONCAT('\n1 ', ?, '.*(\n[2-9] .*)*\n2 TYPE .*', ?)";
1157 1157
                 $bind[] = $parts[0];
1158 1158
                 $bind[] = $field_value;
1159 1159
             } else {
1160 1160
                 // e.g. searches for occupation, religion, note, etc.
1161
-                $sql    .= " AND ind.i_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)";
1161
+                $sql .= " AND ind.i_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)";
1162 1162
                 $bind[] = $parts[0];
1163 1163
                 $bind[] = $field_value;
1164 1164
             }
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
         $sql .= ")";
1238 1238
 
1239 1239
         if ($givn_sdx !== '') {
1240
-            $sql      .= " AND (";
1240
+            $sql .= " AND (";
1241 1241
             $givn_sdx = explode(':', $givn_sdx);
1242 1242
             foreach ($givn_sdx as $n => $sdx) {
1243 1243
                 $sql .= $n > 0 ? " OR " : "";
@@ -1255,7 +1255,7 @@  discard block
 block discarded – undo
1255 1255
         }
1256 1256
 
1257 1257
         if ($surn_sdx !== '') {
1258
-            $sql      .= " AND (";
1258
+            $sql .= " AND (";
1259 1259
             $surn_sdx = explode(':', $surn_sdx);
1260 1260
             foreach ($surn_sdx as $n => $sdx) {
1261 1261
                 $sql .= $n ? " OR " : "";
@@ -1273,7 +1273,7 @@  discard block
 block discarded – undo
1273 1273
         }
1274 1274
 
1275 1275
         if ($plac_sdx !== '') {
1276
-            $sql      .= " AND (";
1276
+            $sql .= " AND (";
1277 1277
             $plac_sdx = explode(':', $plac_sdx);
1278 1278
             foreach ($plac_sdx as $n => $sdx) {
1279 1279
                 $sql .= $n ? " OR " : "";
@@ -1320,7 +1320,7 @@  discard block
 block discarded – undo
1320 1320
 
1321 1321
         foreach ($search_terms as $n => $q) {
1322 1322
             $queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
1323
-            $sql                   .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1323
+            $sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1324 1324
             $args['collate_' . $n] = I18N::collation();
1325 1325
             $args['query_' . $n]   = Database::escapeLike($q);
1326 1326
         }
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 
1377 1377
         foreach ($search_terms as $n => $q) {
1378 1378
             $queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
1379
-            $sql                   .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1379
+            $sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1380 1380
             $args['collate_' . $n] = I18N::collation();
1381 1381
             $args['query_' . $n]   = Database::escapeLike($q);
1382 1382
         }
@@ -1432,7 +1432,7 @@  discard block
 block discarded – undo
1432 1432
 
1433 1433
         foreach ($search_terms as $n => $q) {
1434 1434
             $queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
1435
-            $sql                   .= " AND s_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1435
+            $sql .= " AND s_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1436 1436
             $args['collate_' . $n] = I18N::collation();
1437 1437
             $args['query_' . $n]   = Database::escapeLike($q);
1438 1438
         }
Please login to merge, or discard this patch.
app/Http/Controllers/PedigreeChartController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.