Completed
Pull Request — master (#1904)
by Rico
09:54
created
app/Http/Controllers/EditIndividualController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     public function reorderMediaAction(Request $request, Tree $tree): Response
63 63
     {
64 64
         $xref       = $request->get('xref');
65
-        $order      = (array)$request->get('order', []);
65
+        $order      = (array) $request->get('order', []);
66 66
         $individual = Individual::getInstance($xref, $tree);
67 67
 
68 68
         $this->checkIndividualAccess($individual, true);
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     public function reorderNamesAction(Request $request, Tree $tree): Response
124 124
     {
125 125
         $xref       = $request->get('xref');
126
-        $order      = (array)$request->get('order', []);
126
+        $order      = (array) $request->get('order', []);
127 127
         $individual = Individual::getInstance($xref, $tree);
128 128
 
129 129
         $this->checkIndividualAccess($individual, true);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
     public function reorderSpousesAction(Request $request, Tree $tree): Response
185 185
     {
186 186
         $xref       = $request->get('xref');
187
-        $order      = (array)$request->get('order', []);
187
+        $order      = (array) $request->get('order', []);
188 188
         $individual = Individual::getInstance($xref, $tree);
189 189
 
190 190
         $this->checkIndividualAccess($individual, true);
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
                 $gedcom .= $this->addNewFact($request, $tree, $match);
292 292
             }
293 293
         }
294
-        if ((bool)$request->get('SOUR_INDI')) {
294
+        if ((bool) $request->get('SOUR_INDI')) {
295 295
             $gedcom = $this->handleUpdates($gedcom);
296 296
         } else {
297 297
             $gedcom = $this->updateRest($gedcom);
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
                 $gedcom .= $this->addNewFact($request, $tree, $match);
384 384
             }
385 385
         }
386
-        if ((bool)$request->get('SOUR_INDI')) {
386
+        if ((bool) $request->get('SOUR_INDI')) {
387 387
             $gedcom = $this->handleUpdates($gedcom);
388 388
         } else {
389 389
             $gedcom = $this->updateRest($gedcom);
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
      */
417 417
     public function addSpouse(Request $request, Tree $tree): Response
418 418
     {
419
-        $xref   = $request->get('xref', '');
419
+        $xref = $request->get('xref', '');
420 420
 
421 421
         $individual = Individual::getInstance($xref, $tree);
422 422
 
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
                 $indi_gedcom .= $this->addNewFact($request, $tree, $match);
475 475
             }
476 476
         }
477
-        if ((bool)$request->get('SOUR_INDI')) {
477
+        if ((bool) $request->get('SOUR_INDI')) {
478 478
             $indi_gedcom = $this->handleUpdates($indi_gedcom);
479 479
         } else {
480 480
             $indi_gedcom = $this->updateRest($indi_gedcom);
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
                 $fam_gedcom .= $this->addNewFact($request, $tree, $match);
487 487
             }
488 488
         }
489
-        if ((bool)$request->get('SOUR_FAM')) {
489
+        if ((bool) $request->get('SOUR_FAM')) {
490 490
             $fam_gedcom = $this->handleUpdates($fam_gedcom);
491 491
         } else {
492 492
             $fam_gedcom = $this->updateRest($fam_gedcom);
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
                 $gedrec .= $this->addNewFact($request, $tree, $match);
561 561
             }
562 562
         }
563
-        if ((bool)$request->get('SOUR_INDI')) {
563
+        if ((bool) $request->get('SOUR_INDI')) {
564 564
             $gedrec = $this->handleUpdates($gedrec);
565 565
         } else {
566 566
             $gedrec = $this->updateRest($gedrec);
Please login to merge, or discard this patch.
app/Services/CalendarService.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -327,9 +327,9 @@
 block discarded – undo
327 327
 
328 328
             // Now fetch these anniversaries
329 329
             foreach ([
330
-                         'INDI' => $ind_sql . $where . $order_by,
331
-                         'FAM'  => $fam_sql . $where . $order_by,
332
-                     ] as $type => $sql) {
330
+                            'INDI' => $ind_sql . $where . $order_by,
331
+                            'FAM'  => $fam_sql . $where . $order_by,
332
+                        ] as $type => $sql) {
333 333
                 $rows = Database::prepare($sql)->execute($args)->fetchAll();
334 334
                 foreach ($rows as $row) {
335 335
                     if ($type === 'INDI') {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * webtrees: online genealogy
5 5
  * Copyright (C) 2018 webtrees development team
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                 "SELECT DISTINCT f_id AS xref, f_gedcom AS gedcom, d_type, d_day, d_month, d_year, d_fact" .
225 225
                 " FROM `##dates` JOIN `##families` ON d_gid = f_id AND d_file = f_file" .
226 226
                 " WHERE d_type = :type AND d_file = :tree_id";
227
-            $args    = [
227
+            $args = [
228 228
                 'type'    => $anniv->format('%@'),
229 229
                 'tree_id' => $tree->getTreeId(),
230 230
             ];
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                     $where       .= " AND d_day = :day";
255 255
                     $args['day'] = $anniv->d;
256 256
                 }
257
-                $where         .= " AND d_mon = :month";
257
+                $where .= " AND d_mon = :month";
258 258
                 $args['month'] = $anniv->m;
259 259
             } else {
260 260
                 // SPECIAL CASES:
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
                         } elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) {
269 269
                             $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2";
270 270
                         } else {
271
-                            $where       .= " AND d_day = :day AND d_mon = 2";
271
+                            $where .= " AND d_day = :day AND d_mon = 2";
272 272
                             $args['day'] = $anniv->d;
273 273
                         }
274 274
                         break;
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
                         } elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) {
292 292
                             $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3";
293 293
                         } else {
294
-                            $where       .= " AND d_day = :day AND d_mon = 3";
294
+                            $where .= " AND d_day = :day AND d_mon = 3";
295 295
                             $args['day'] = $anniv->d;
296 296
                         }
297 297
                         break;
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                 }
347 347
             }
348 348
             // Only events in the past (includes dates without a year)
349
-            $where        .= " AND d_year <= :year";
349
+            $where .= " AND d_year <= :year";
350 350
             $args['year'] = $anniv->y;
351 351
 
352 352
             if ($facts) {
Please login to merge, or discard this patch.
app/Http/Controllers/BranchesController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
     public function page(Request $request): Response
44 44
     {
45 45
         $surname     = $request->get('surname', '');
46
-        $soundex_std = (bool)$request->get('soundex_std');
47
-        $soundex_dm  = (bool)$request->get('soundex_dm');
46
+        $soundex_std = (bool) $request->get('soundex_std');
47
+        $soundex_dm  = (bool) $request->get('soundex_dm');
48 48
 
49 49
         if ($surname !== '') {
50 50
             /* I18N: %s is a surname */
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function list(Request $request, Tree $tree, User $user): Response
73 73
     {
74
-        $soundex_dm  = (bool)$request->get('soundex_dm');
75
-        $soundex_std = (bool)$request->get('soundex_std');
74
+        $soundex_dm  = (bool) $request->get('soundex_dm');
75
+        $soundex_std = (bool) $request->get('soundex_std');
76 76
         $surname     = $request->get('surname', '');
77 77
 
78 78
         // Highlight direct-line ancestors of this individual.
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             $sdx = Soundex::russell($surname);
161 161
             if ($sdx !== '') {
162 162
                 foreach (explode(':', $sdx) as $value) {
163
-                    $sql    .= " OR n_soundex_surn_std LIKE CONCAT('%', ?, '%')";
163
+                    $sql .= " OR n_soundex_surn_std LIKE CONCAT('%', ?, '%')";
164 164
                     $args[] = $value;
165 165
                 }
166 166
             }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
             $sdx = Soundex::daitchMokotoff($surname);
171 171
             if ($sdx !== '') {
172 172
                 foreach (explode(':', $sdx) as $value) {
173
-                    $sql    .= " OR n_soundex_surn_dm LIKE CONCAT('%', ?, '%')";
173
+                    $sql .= " OR n_soundex_surn_dm LIKE CONCAT('%', ?, '%')";
174 174
                     $args[] = $value;
175 175
                 }
176 176
             }
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      */
341 341
     private static function sosaGeneration($sosa): string
342 342
     {
343
-        $generation = (int)log($sosa, 2) + 1;
343
+        $generation = (int) log($sosa, 2) + 1;
344 344
 
345 345
         return '<sup title="' . I18N::translate('Generation') . '">' . $generation . '</sup>';
346 346
     }
Please login to merge, or discard this patch.
app/Http/Controllers/FamilyController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
      */
63 63
     private function significant(Family $family): stdClass
64 64
     {
65
-        $significant = (object)[
65
+        $significant = (object) [
66 66
             'family'     => $family,
67 67
             'individual' => null,
68 68
             'surname'    => '',
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
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
     private function validContacts(Tree $tree): array
329 329
     {
330 330
         $contacts = [
331
-            User::find((int)$tree->getPreference('CONTACT_USER_ID')),
332
-            User::find((int)$tree->getPreference('WEBMASTER_USER_ID')),
331
+            User::find((int) $tree->getPreference('CONTACT_USER_ID')),
332
+            User::find((int) $tree->getPreference('WEBMASTER_USER_ID')),
333 333
         ];
334 334
 
335 335
         return array_filter($contacts);
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     {
354 354
         // Create a dummy user, so we can send messages from the tree.
355 355
         $from = new User(
356
-            (object)[
356
+            (object) [
357 357
                 'user_id'   => null,
358 358
                 'user_name' => '',
359 359
                 'real_name' => $tree->getTitle(),
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 
364 364
         // Create a dummy user, so we can reply to visitors.
365 365
         $sender = new User(
366
-            (object)[
366
+            (object) [
367 367
                 'user_id'   => null,
368 368
                 'user_name' => '',
369 369
                 'real_name' => $sender_name,
Please login to merge, or discard this patch.
app/Module/PlacesModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     private function getPersonalFacts(Individual $individual): array
143 143
     {
144
-        $facts      = $individual->getFacts();
144
+        $facts = $individual->getFacts();
145 145
         foreach ($individual->getSpouseFamilies() as $family) {
146 146
             $facts = array_merge($facts, $family->getFacts());
147 147
             // Add birth of children from this family to the facts array
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                     'provider' => 'openstreetmap',
216 216
                     'style'    => 'mapnik',
217 217
                 ];
218
-                self::$map_providers  = [
218
+                self::$map_providers = [
219 219
                     'openstreetmap' => [
220 220
                         'name'   => 'OpenStreetMap',
221 221
                         'styles' => ['mapnik' => 'Mapnik'],
Please login to merge, or discard this patch.
resources/views/media-list-page.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -123,49 +123,49 @@
 block discarded – undo
123 123
 
124 124
 							<p class="card-text">
125 125
 								<?php
126
-								// Show file details
127
-								$mediatype = $media_file->type();
128
-								if ($mediatype) {
129
-									echo GedcomTag::getLabelValue('TYPE', GedcomTag::getFileFormTypeValue($mediatype));
130
-								}
131
-								echo FunctionsPrintFacts::printFactSources($tree, $media_object->getGedcom(), 1);
132
-								echo FunctionsPrint::printFactNotes($tree, $media_object->getGedcom(), 1);
133
-								if ($media_file->isExternal()) {
134
-									echo GedcomTag::getLabelValue('URL', $media_file->filename());
135
-								} elseif ($media_file->fileExists()) {
136
-									?>
126
+                                // Show file details
127
+                                $mediatype = $media_file->type();
128
+                                if ($mediatype) {
129
+                                    echo GedcomTag::getLabelValue('TYPE', GedcomTag::getFileFormTypeValue($mediatype));
130
+                                }
131
+                                echo FunctionsPrintFacts::printFactSources($tree, $media_object->getGedcom(), 1);
132
+                                echo FunctionsPrint::printFactNotes($tree, $media_object->getGedcom(), 1);
133
+                                if ($media_file->isExternal()) {
134
+                                    echo GedcomTag::getLabelValue('URL', $media_file->filename());
135
+                                } elseif ($media_file->fileExists()) {
136
+                                    ?>
137 137
 								<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#details-<?= e($n) ?>" aria-expanded="false" aria-controls="details-<?= e($n) ?>">
138 138
 									<?= I18N::translate('Media file') ?>
139 139
 								</button>
140 140
 							<div class="collapse" id="details-<?= e($n) ?>">
141 141
 								<?php
142
-								if (Auth::isEditor($tree)) {
143
-									echo GedcomTag::getLabelValue('FILE', $media_file->filename());
144
-								}
145
-								echo GedcomTag::getLabelValue('FORM', $media_file->mimeType());
146
-								foreach ($media_file->attributes() as $tag => $value) {
147
-									echo GedcomTag::getLabelValue($tag, $value);
148
-								}
149
-								?>
142
+                                if (Auth::isEditor($tree)) {
143
+                                    echo GedcomTag::getLabelValue('FILE', $media_file->filename());
144
+                                }
145
+                                echo GedcomTag::getLabelValue('FORM', $media_file->mimeType());
146
+                                foreach ($media_file->attributes() as $tag => $value) {
147
+                                    echo GedcomTag::getLabelValue($tag, $value);
148
+                                }
149
+                                ?>
150 150
 							</div>
151 151
 						<?php
152
-								} else {
153
-									echo '<p class="alert alert-danger">', /* I18N: %s is a filename */ I18N::translate('The file “%s” does not exist.', $media_file->filename()), '</p>';
154
-								}
155
-								?>
152
+                                } else {
153
+                                    echo '<p class="alert alert-danger">', /* I18N: %s is a filename */ I18N::translate('The file “%s” does not exist.', $media_file->filename()), '</p>';
154
+                                }
155
+                                ?>
156 156
 							</p>
157 157
 						</div>
158 158
 						<div class="card-footer">
159 159
 							<?php
160
-							foreach ($media_object->linkedIndividuals('OBJE') as $individual) {
161
-								echo '<a href="' . e($individual->url()) . '">' . FontAwesome::semanticIcon('individual', I18N::translate('Individual')) . ' ' . $individual->getFullName() . '</a><br>';
162
-							}
163
-							foreach ($media_object->linkedFamilies('OBJE') as $family) {
164
-								echo '<a href="' . e($family->url()) . '">' . FontAwesome::semanticIcon('family', I18N::translate('Family')) . ' ' . $family->getFullName() . '</a><br>';
165
-							}
166
-							foreach ($media_object->linkedSources('OBJE') as $source) {
167
-								echo '<a href="' . e($source->url()) . '">' . FontAwesome::semanticIcon('source', I18N::translate('Source')) . ' ' . $source->getFullName() . '</a><br>';
168
-							} ?>
160
+                            foreach ($media_object->linkedIndividuals('OBJE') as $individual) {
161
+                                echo '<a href="' . e($individual->url()) . '">' . FontAwesome::semanticIcon('individual', I18N::translate('Individual')) . ' ' . $individual->getFullName() . '</a><br>';
162
+                            }
163
+                            foreach ($media_object->linkedFamilies('OBJE') as $family) {
164
+                                echo '<a href="' . e($family->url()) . '">' . FontAwesome::semanticIcon('family', I18N::translate('Family')) . ' ' . $family->getFullName() . '</a><br>';
165
+                            }
166
+                            foreach ($media_object->linkedSources('OBJE') as $source) {
167
+                                echo '<a href="' . e($source->url()) . '">' . FontAwesome::semanticIcon('source', I18N::translate('Source')) . ' ' . $source->getFullName() . '</a><br>';
168
+                            } ?>
169 169
 						</div>
170 170
 					</div>
171 171
 				</div>
Please login to merge, or discard this patch.
resources/views/calendar-page.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -159,16 +159,16 @@
 block discarded – undo
159 159
 			</td>
160 160
 			<td class="topbottombar width50">
161 161
 				<?php
162
-					$n = 0;
163
-					foreach (Date::calendarNames() as $newcal => $cal_name) {
164
-						$tmp = $cal_date->convertToCalendar($newcal);
165
-						if ($tmp->inValidRange()) {
166
-							if ($n++) {
167
-								echo ' | ';
168
-							}
169
-							echo '<a ' . (get_class($tmp) === get_class($cal_date) ? 'class="error"' : '') . 'href="' . e(route('calendar', ['cal' => $tmp->format('%@'), 'day' => $tmp->d, 'month' => $tmp->format('%O'), 'year' => $tmp->y, 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => $view, 'ged' => $tree->getName()])) . '" rel="nofollow">', $cal_name, '</a>';
170
-						}
171
-					} ?>
162
+                    $n = 0;
163
+                    foreach (Date::calendarNames() as $newcal => $cal_name) {
164
+                        $tmp = $cal_date->convertToCalendar($newcal);
165
+                        if ($tmp->inValidRange()) {
166
+                            if ($n++) {
167
+                                echo ' | ';
168
+                            }
169
+                            echo '<a ' . (get_class($tmp) === get_class($cal_date) ? 'class="error"' : '') . 'href="' . e(route('calendar', ['cal' => $tmp->format('%@'), 'day' => $tmp->d, 'month' => $tmp->format('%O'), 'year' => $tmp->y, 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => $view, 'ged' => $tree->getName()])) . '" rel="nofollow">', $cal_name, '</a>';
170
+                        }
171
+                    } ?>
172 172
 			</td>
173 173
 		</tr>
174 174
 	</table>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,8 @@  discard block
 block discarded – undo
45 45
                     <a href="<?= e(route('calendar', ['cal' => $cal, 'day' => $cal_date->d, 'month' => $m, 'year' => $cal_date->y, 'filterev' => $filterev, 'filterof' => $filterof, 'filtersx' => $filtersx, 'view' => 'month', 'ged' => $tree->getName()])) ?>" rel="nofollow">
46 46
                         <?php if ($m === $cal_month): ?>
47 47
                             <span class="error"><?= e($month_name) ?></span>
48
-                        <?php else: ?>
48
+                        <?php else {
49
+    : ?>
49 50
                             <?= e($month_name) ?>
50 51
                         <?php endif ?>
51 52
                     </a> |
@@ -160,6 +161,7 @@  discard block
 block discarded – undo
160 161
 			<td class="topbottombar width50">
161 162
 				<?php
162 163
 					$n = 0;
164
+}
163 165
 					foreach (Date::calendarNames() as $newcal => $cal_name) {
164 166
 						$tmp = $cal_date->convertToCalendar($newcal);
165 167
 						if ($tmp->inValidRange()) {
Please login to merge, or discard this patch.
themes/webtrees/theme.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 /**
4 4
  * webtrees: online genealogy
5 5
  * Copyright (C) 2018 webtrees development team
Please login to merge, or discard this patch.