Completed
Push — openstreetmap ( 902efc...a5697c )
by Greg
20:13 queued 09:32
created
app/Http/Controllers/ListController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 					}
288 288
 					// Don't sublists short lists.
289 289
 					if ($count < $tree->getPreference('SUBLIST_TRIGGER_I')) {
290
-						$falpha              = '';
290
+						$falpha = '';
291 291
 					} else {
292 292
 						$givn_initials = $this->givenAlpha($surname, $alpha, $show_marnm === 'yes', $families);
293 293
 						// Break long lists by initial letter of given name
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 	 */
509 509
 	private function allMedia(Tree $tree, string $folder, string $subfolders, string $sort, string $filter, string $form_type): array {
510 510
 		// All files in the folder, plus external files
511
-		$sql  =
511
+		$sql =
512 512
 			"SELECT m_id AS xref, m_gedcom AS gedcom" .
513 513
 			" FROM `##media`" .
514 514
 			" JOIN `##media_file` USING (m_id, m_file)" .
@@ -527,11 +527,11 @@  discard block
 block discarded – undo
527 527
 		// Include / exclude subfolders (but always include external)
528 528
 		switch ($subfolders) {
529 529
 			case 'include':
530
-				$sql    .= " AND (multimedia_file_refn LIKE CONCAT(?, '%') $sql_external)";
530
+				$sql .= " AND (multimedia_file_refn LIKE CONCAT(?, '%') $sql_external)";
531 531
 				$args[] = Database::escapeLike($folder);
532 532
 				break;
533 533
 			case 'exclude':
534
-				$sql    .= " AND (multimedia_file_refn LIKE CONCAT(?, '%') AND multimedia_file_refn NOT LIKE CONCAT(?, '%/%') $sql_external)";
534
+				$sql .= " AND (multimedia_file_refn LIKE CONCAT(?, '%') AND multimedia_file_refn NOT LIKE CONCAT(?, '%/%') $sql_external)";
535 535
 				$args[] = Database::escapeLike($folder);
536 536
 				$args[] = Database::escapeLike($folder);
537 537
 				break;
@@ -539,13 +539,13 @@  discard block
 block discarded – undo
539 539
 
540 540
 		// Apply search terms
541 541
 		if ($filter) {
542
-			$sql    .= " AND (SUBSTRING_INDEX(multimedia_file_refn, '/', -1) LIKE CONCAT('%', ?, '%') OR descriptive_title LIKE CONCAT('%', ?, '%'))";
542
+			$sql .= " AND (SUBSTRING_INDEX(multimedia_file_refn, '/', -1) LIKE CONCAT('%', ?, '%') OR descriptive_title LIKE CONCAT('%', ?, '%'))";
543 543
 			$args[] = Database::escapeLike($filter);
544 544
 			$args[] = Database::escapeLike($filter);
545 545
 		}
546 546
 
547 547
 		if ($form_type) {
548
-			$sql    .= " AND source_media_type = ?";
548
+			$sql .= " AND source_media_type = ?";
549 549
 			$args[] = $form_type;
550 550
 		}
551 551
 
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
 		];
1458 1458
 
1459 1459
 		foreach ($this->getAlphabetForLocale(WT_LOCALE) as $n => $letter) {
1460
-			$sql                   .= " AND n_surn COLLATE :collate_" . $n . " NOT LIKE :letter_" . $n;
1460
+			$sql .= " AND n_surn COLLATE :collate_" . $n . " NOT LIKE :letter_" . $n;
1461 1461
 			$args['collate_' . $n] = I18N::collation();
1462 1462
 			$args['letter_' . $n]  = $letter . '%';
1463 1463
 		}
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
 		];
1543 1543
 
1544 1544
 		if ($surn) {
1545
-			$sql               .= " AND n_surn COLLATE :collate_1 = :surn";
1545
+			$sql .= " AND n_surn COLLATE :collate_1 = :surn";
1546 1546
 			$args['collate_1'] = I18N::collation();
1547 1547
 			$args['surn']      = $surn;
1548 1548
 		} elseif ($salpha === ',') {
@@ -1593,7 +1593,7 @@  discard block
 block discarded – undo
1593 1593
 		];
1594 1594
 
1595 1595
 		if ($surn) {
1596
-			$sql               .= " AND n_surn COLLATE :collate_1 = :surn";
1596
+			$sql .= " AND n_surn COLLATE :collate_1 = :surn";
1597 1597
 			$args['collate_1'] = I18N::collation();
1598 1598
 			$args['surn']      = $surn;
1599 1599
 		} elseif ($salpha === ',') {
@@ -1606,7 +1606,7 @@  discard block
 block discarded – undo
1606 1606
 			// All surnames
1607 1607
 			$sql .= " AND n_surn NOT IN ('', '@N.N.')";
1608 1608
 		}
1609
-		$sql               .= " GROUP BY n_surn COLLATE :collate_2, n_file) AS n2 ON (n1.n_surn = n2.n_surn COLLATE :collate_3 AND n1.n_file = n2.n_file)";
1609
+		$sql .= " GROUP BY n_surn COLLATE :collate_2, n_file) AS n2 ON (n1.n_surn = n2.n_surn COLLATE :collate_3 AND n1.n_file = n2.n_file)";
1610 1610
 		$args['collate_2'] = I18N::collation();
1611 1611
 		$args['collate_3'] = I18N::collation();
1612 1612
 
@@ -1646,7 +1646,7 @@  discard block
 block discarded – undo
1646 1646
 		];
1647 1647
 
1648 1648
 		if ($surn) {
1649
-			$sql               .= " AND n_surn COLLATE :collate_1 = :surn";
1649
+			$sql .= " AND n_surn COLLATE :collate_1 = :surn";
1650 1650
 			$args['collate_1'] = I18N::collation();
1651 1651
 			$args['surn']      = $surn;
1652 1652
 		} elseif ($salpha === ',') {
@@ -1663,7 +1663,7 @@  discard block
 block discarded – undo
1663 1663
 			$sql .= " AND " . $this->getInitialSql('n_givn', $galpha);
1664 1664
 		}
1665 1665
 
1666
-		$sql               .= " ORDER BY CASE n_surn WHEN '@N.N.' THEN 1 ELSE 0 END, n_surn COLLATE :collate_2, CASE n_givn WHEN '@P.N.' THEN 1 ELSE 0 END, n_givn COLLATE :collate_3";
1666
+		$sql .= " ORDER BY CASE n_surn WHEN '@N.N.' THEN 1 ELSE 0 END, n_surn COLLATE :collate_2, CASE n_givn WHEN '@P.N.' THEN 1 ELSE 0 END, n_givn COLLATE :collate_3";
1667 1667
 		$args['collate_2'] = I18N::collation();
1668 1668
 		$args['collate_3'] = I18N::collation();
1669 1669
 
Please login to merge, or discard this patch.
app/Http/Controllers/RelationshipsChartController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		$recursion = (int) $request->get('recursion', '0');
106 106
 		$ancestors = (bool) $request->get('ancestors', '0');
107 107
 
108
-		$max_recursion  = (int) $tree->getPreference('RELATIONSHIP_RECURSION', RelationshipsChartModule::DEFAULT_RECURSION);
108
+		$max_recursion = (int) $tree->getPreference('RELATIONSHIP_RECURSION', RelationshipsChartModule::DEFAULT_RECURSION);
109 109
 
110 110
 		$recursion = min($recursion, $max_recursion);
111 111
 
@@ -153,14 +153,14 @@  discard block
 block discarded – undo
153 153
 							case 'sis':
154 154
 							case 'sib':
155 155
 								$table[$x + 1][$y] = '<div style="background:url(' . Theme::theme()->parameter('image-hline') . ') repeat-x center;  width: 94px; text-align: center"><div class="hline-text" style="height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $tree), Individual::getInstance($path[$n + 1], $tree)) . '</div><div style="height: 32px;">' . FontAwesome::decorativeIcon('arrow-end') . '</div></div>';
156
-								$x                 += 2;
156
+								$x += 2;
157 157
 								break;
158 158
 							case 'son':
159 159
 							case 'dau':
160 160
 							case 'chi':
161 161
 								if ($n > 2 && preg_match('/fat|mot|par/', $relationships[$n - 2])) {
162 162
 									$table[$x + 1][$y - 1] = '<div style="background:url(' . $diagonal2 . '); width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: end;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $tree), Individual::getInstance($path[$n + 1], $tree)) . '</div><div style="height: 32px; text-align: start;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>';
163
-									$x                     += 2;
163
+									$x += 2;
164 164
 								} else {
165 165
 									$table[$x][$y - 1] = '<div style="background:url(' . Theme::theme()
166 166
 											->parameter('image-vline') . ') repeat-y center; height: 64px; text-align: center;"><div class="vline-text" style="display: inline-block; width:50%; line-height: 64px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $tree), Individual::getInstance($path[$n + 1], $tree)) . '</div><div style="display: inline-block; width:50%; line-height: 64px;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>';
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 							case 'par':
173 173
 								if ($n > 2 && preg_match('/son|dau|chi/', $relationships[$n - 2])) {
174 174
 									$table[$x + 1][$y + 1] = '<div style="background:url(' . $diagonal1 . '); background-position: top right; width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: start;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $tree), Individual::getInstance($path[$n + 1], $tree)) . '</div><div style="height: 32px; text-align: end;">' . FontAwesome::decorativeIcon('arrow-down') . '</div></div>';
175
-									$x                     += 2;
175
+									$x += 2;
176 176
 								} else {
177 177
 									$table[$x][$y + 1] = '<div style="background:url(' . Theme::theme()
178 178
 											->parameter('image-vline') . ') repeat-y center; height: 64px; text-align:center; "><div class="vline-text" style="display: inline-block; width: 50%; line-height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $tree), Individual::getInstance($path[$n + 1], $tree)) . '</div><div style="display: inline-block; width: 50%; line-height: 32px">' . FontAwesome::decorativeIcon('arrow-up') . '</div></div>';
Please login to merge, or discard this patch.
app/FactLocation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
  * You should have received a copy of the GNU General Public License
14 14
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 15
  */
16
-declare(strict_types = 1);
16
+declare(strict_types=1);
17 17
 
18 18
 namespace Fisharebest\Webtrees;
19 19
 
Please login to merge, or discard this patch.
resources/views/modules/openstreetmap/event-sidebar.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@
 block discarded – undo
9 9
     </a>
10 10
 <?php endif ?>
11 11
 
12
-<?php if($value): ?>
12
+<?php if ($value): ?>
13 13
     <span>
14 14
         <?= $value ?>
15 15
     </span>
16 16
 <?php endif ?>
17 17
 
18 18
 <div>
19
-    <?php if($addtag): ?>
19
+    <?php if ($addtag): ?>
20 20
         <?= GedcomTag::getLabel('BIRT') ?>:
21 21
     <?php endif ?>
22 22
     <?= $date ?>
Please login to merge, or discard this patch.
resources/views/modules/openstreetmap/admin-import-form.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 
7 7
 <h3><?= $title ?></h3>
8 8
 <form id="upload_form" method="post" enctype="multipart/form-data" action="<?=
9
-    e(route('admin-module',[
9
+    e(route('admin-module', [
10 10
         'module' => $module,
11 11
         'action' => 'AdminImport',
12 12
     ])) ?>">
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 				</div>
30 30
 				<select id="serverfile" name="serverfile" class="form-control">
31 31
                     <option class='custom-select' selected disabled value=''><?= I18N::translate('choose a file&hellip;') ?></option>
32
-                    <?php foreach($files as $file): ?>
32
+                    <?php foreach ($files as $file): ?>
33 33
                         <option value="<?= e($file) ?>"><?= $file ?></option>
34 34
                     <?php endforeach ?>
35 35
 				</select>
Please login to merge, or discard this patch.
resources/views/modules/openstreetmap/admin-places.php 1 patch
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,12 +67,10 @@  discard block
 block discarded – undo
67 67
                 </a>
68 68
             </td>
69 69
 			<td>
70
-				<?= ($place->pl_lati === null) ? FontAwesome::decorativeIcon('warning') :
71
-                    strtr($place->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) ?>
70
+				<?= ($place->pl_lati === null) ? FontAwesome::decorativeIcon('warning') : strtr($place->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) ?>
72 71
 			</td>
73 72
 			<td>
74
-				<?= ($place->pl_long === null) ? FontAwesome::decorativeIcon('warning') :
75
-                    strtr($place->pl_long, ['E' => '', 'W' => '-', ',' => '.']) ?>
73
+				<?= ($place->pl_long === null) ? FontAwesome::decorativeIcon('warning') : strtr($place->pl_long, ['E' => '', 'W' => '-', ',' => '.']) ?>
76 74
 			</td>
77 75
 			<td>
78 76
 				<?= $place->pl_long === null ? FontAwesome::decorativeIcon('warning') : $place->pl_zoom ?>
@@ -194,7 +192,7 @@  discard block
 block discarded – undo
194 192
 	</tfoot>
195 193
 </table>
196 194
 
197
-<form method="POST" action="<?= e(route('admin-module',[
195
+<form method="POST" action="<?= e(route('admin-module', [
198 196
 		'module' => $module,
199 197
 		'action' => 'AdminImportPlaces'
200 198
 	])) ?>">
Please login to merge, or discard this patch.
resources/views/media-page.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
 
11 11
 <?php if ($media->isPendingDeletion()): ?>
12 12
 	<?php if (Auth::isModerator($media->getTree())): ?>
13
-		<?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This media object has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
13
+		<?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This media object has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
14 14
 	<?php elseif (Auth::isEditor($media->getTree())): ?>
15 15
 		<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This media object has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
16 16
 	<?php endif ?>
17 17
 <?php elseif ($media->isPendingAddition()): ?>
18 18
 	<?php if (Auth::isModerator($media->getTree())): ?>
19
-		<?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This media object has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
19
+		<?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This media object has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($media->getXref()) . '\', \'' . e($media->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
20 20
 	<?php elseif (Auth::isEditor($media->getTree())): ?>
21 21
 		<?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This media object has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?>
22 22
 	<?php endif ?>
Please login to merge, or discard this patch.
app/Location.php 1 patch
Spacing   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  * You should have received a copy of the GNU General Public License
14 14
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 15
  */
16
-declare(strict_types = 1);
16
+declare(strict_types=1);
17 17
 
18 18
 namespace Fisharebest\Webtrees;
19 19
 
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 	 * @param array $record
31 31
 	 * @throws \Exception
32 32
 	 */
33
-	public function __construct($gedcomName, $record=[]) {
33
+	public function __construct($gedcomName, $record = []) {
34 34
 		$tmp = $this->getRecordFromName($gedcomName);
35 35
 		if ($tmp !== null) {
36 36
 			$this->record = $tmp;
37 37
 		} elseif (!empty($record)) {
38
-			$this->record = (object)$record;
38
+			$this->record = (object) $record;
39 39
 		} else {
40
-			$this->record = (object)[
40
+			$this->record = (object) [
41 41
 				'fqpn'         => '',
42 42
 				'pl_id'        => 0,
43 43
 				'pl_parent_id' => 0,
@@ -67,8 +67,7 @@  discard block
 block discarded – undo
67 67
 		switch ($format) {
68 68
 			case 'signed':
69 69
 				return $this->record->pl_lati ?
70
-					(float)strtr($this->record->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) :
71
-					$this->record->pl_lati;
70
+					(float) strtr($this->record->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) : $this->record->pl_lati;
72 71
 			default:
73 72
 				return $this->record->pl_lati;
74 73
 		}
@@ -83,8 +82,7 @@  discard block
 block discarded – undo
83 82
 		switch ($format) {
84 83
 			case 'signed':
85 84
 				return $this->record->pl_long ?
86
-					(float)strtr($this->record->pl_long, ['E' => '', 'W' => '-', ',' => '.']) :
87
-					$this->record->pl_long;
85
+					(float) strtr($this->record->pl_long, ['E' => '', 'W' => '-', ',' => '.']) : $this->record->pl_long;
88 86
 			default:
89 87
 				return $this->record->pl_long;
90 88
 		}
Please login to merge, or discard this patch.
app/Module/OpenStreetmapModule.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	 */
207 207
 	public function getBaseDataAction(Request $request) {
208 208
 		$provider = $this->getMapProviderData($request);
209
-		$style    = $provider['selectedStyleName']    = '' ? '' : '.' . $provider['selectedStyleName'];
209
+		$style    = $provider['selectedStyleName'] = '' ? '' : '.' . $provider['selectedStyleName'];
210 210
 
211 211
 		switch ($provider['selectedProvIndex']) {
212 212
 			case 'mapbox':
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 						$color            = self::LINE_COLORS[log($id, 2) % $color_count];
294 294
 						$icon['color']    = $color; //make icon color the same as the line
295 295
 						$sosa_points[$id] = $event->getLatLonJSArray();
296
-						$sosa_parent      = (int)floor($id / 2);
296
+						$sosa_parent      = (int) floor($id / 2);
297 297
 						if (array_key_exists($sosa_parent, $sosa_points)) {
298 298
 							// Would like to use a GeometryCollection to hold LineStrings
299 299
 							// rather than generate polylines but the MarkerCluster library
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 								'modules/openstreetmap/event-sidebar',
326 326
 								$event->shortSummary($mapType, $id)
327 327
 							),
328
-							'zoom' => (int)$event->getZoom(),
328
+							'zoom' => (int) $event->getZoom(),
329 329
 						],
330 330
 					];
331 331
 				}
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 							'stats'    => $placeStats,
396 396
 						]
397 397
 					),
398
-					'zoom' => (int)($location->getZoom() ?? 2),
398
+					'zoom' => (int) ($location->getZoom() ?? 2),
399 399
 				],
400 400
 			];
401 401
 		}
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 		$xref        = $request->get('reference');
448 448
 		$tree        = $request->attributes->get('tree');
449 449
 		$individual  = Individual::getInstance($xref, $tree);
450
-		$generations = (int)$request->get(
450
+		$generations = (int) $request->get(
451 451
 			'generations',
452 452
 			$tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS')
453 453
 		);
@@ -496,14 +496,14 @@  discard block
 block discarded – undo
496 496
 						function ($item) {
497 497
 							return preg_replace('/[^a-z\d]/i', '', strtolower($item));
498 498
 						},
499
-						(array)$provider->styles
499
+						(array) $provider->styles
500 500
 					);
501 501
 
502
-					$key = preg_replace('/[^a-z\d]/i', '', strtolower((string)$provider->name));
502
+					$key = preg_replace('/[^a-z\d]/i', '', strtolower((string) $provider->name));
503 503
 
504 504
 					self::$map_providers[$key] = [
505
-						'name'   => (string)$provider->name,
506
-						'styles' => array_combine($style_keys, (array)$provider->styles),
505
+						'name'   => (string) $provider->name,
506
+						'styles' => array_combine($style_keys, (array) $provider->styles),
507 507
 					];
508 508
 				}
509 509
 			} catch (\Exception $ex) {
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 		$maxgenerations = $tree->getPreference('MAX_PEDIGREE_GENERATIONS');
566 566
 		$generations    = $request->get('generations', $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS'));
567 567
 
568
-		return (object)[
568
+		return (object) [
569 569
 			'name' => 'modules/openstreetmap/pedigreemap',
570 570
 			'data' => [
571 571
 				'assets' => $this->assets(),
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 	 * @return object
629 629
 	 */
630 630
 	public function getAdminConfigAction(Request $request) {
631
-		return (object)[
631
+		return (object) [
632 632
 			'name' => 'modules/openstreetmap/admin-config',
633 633
 			'data' => [
634 634
 				'title'        => I18N::translate('Open Street Maps (Configuration)'),
@@ -684,8 +684,8 @@  discard block
 block discarded – undo
684 684
 	 * @throws \Exception
685 685
 	 */
686 686
 	public function getAdminPlacesAction(Request $request) {
687
-		$parent_id   = (int)$request->get('parent_id', 0);
688
-		$inactive    = (bool)$request->get('inactive');
687
+		$parent_id   = (int) $request->get('parent_id', 0);
688
+		$inactive    = (bool) $request->get('inactive');
689 689
 		$hierarchy   = $this->gethierarchy($parent_id);
690 690
 		$title       = I18N::translate('Open Street Maps (Geographic data)');
691 691
 		$breadcrumbs = [
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 		}
709 709
 		$breadcrumbs[] = array_pop($breadcrumbs);
710 710
 
711
-		return (object)[
711
+		return (object) [
712 712
 			'name' => 'modules/openstreetmap/admin-places',
713 713
 			'data' => [
714 714
 				'title'       => $title,
@@ -729,9 +729,9 @@  discard block
 block discarded – undo
729 729
 	 * @throws \Exception
730 730
 	 */
731 731
 	public function getAdminPlaceEditAction(Request $request) {
732
-		$parent_id = (int)$request->get('parent_id', 0);
733
-		$place_id  = (int)$request->get('place_id');
734
-		$inactive  = (int)$request->get('inactive');
732
+		$parent_id = (int) $request->get('parent_id', 0);
733
+		$place_id  = (int) $request->get('place_id');
734
+		$inactive  = (int) $request->get('inactive');
735 735
 		$hierarchy = $this->gethierarchy($place_id);
736 736
 		$fqpn      = empty($hierarchy) ? '' : $hierarchy[0]->fqpn;
737 737
 		$location  = new Location($fqpn);
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 		}
768 768
 		$breadcrumbs[] = $place_id === 0 ? I18N::translate('Add') : I18N::translate('Edit');
769 769
 
770
-		return (object)[
770
+		return (object) [
771 771
 			'name' => 'modules/openstreetmap/admin-place-edit',
772 772
 			'data' => [
773 773
 				'module'      => $this->getName(),
@@ -793,9 +793,9 @@  discard block
 block discarded – undo
793 793
 	 */
794 794
 	public function postAdminSaveAction(Request $request) {
795 795
 		if (Filter::checkCsrf()) {
796
-			$parent_id = (int)$request->get('parent_id');
797
-			$place_id  = (int)$request->get('place_id');
798
-			$inactive  = (int)$request->get('inactive');
796
+			$parent_id = (int) $request->get('parent_id');
797
+			$place_id  = (int) $request->get('place_id');
798
+			$inactive  = (int) $request->get('inactive');
799 799
 			$lat       = round($request->get('new_place_lati'), 5); // 5 decimal places (locate to within about 1 metre)
800 800
 			$lat       = ($lat < 0 ? 'S' : 'N') . abs($lat);
801 801
 			$lng       = round($request->get('new_place_long'), 5);
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 						  VALUES (:id, :parent, :level, :place, :lng, :lat, :zoom, :icon)"
815 815
 				)->execute(
816 816
 					[
817
-					'id'     => (int)Database::prepare("SELECT MAX(pl_id)+1 FROM `##placelocation`")->fetchOne(),
817
+					'id'     => (int) Database::prepare("SELECT MAX(pl_id)+1 FROM `##placelocation`")->fetchOne(),
818 818
 					'parent' => $parent_id,
819 819
 					'level'  => $level,
820 820
 					'place'  => $request->get('new_place_name'),
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
 					'place' => $request->get('new_place_name'),
834 834
 					'lat'   => $request->get('lati_control') . $lat,
835 835
 					'lng'   => $request->get('long_control') . $lng,
836
-					'zoom'  => (int)$request->get('new_zoom_factor'),
836
+					'zoom'  => (int) $request->get('new_zoom_factor'),
837 837
 					'icon'  => $icon,
838 838
 				]
839 839
 				);
@@ -866,9 +866,9 @@  discard block
 block discarded – undo
866 866
 	 */
867 867
 	public function postAdminDeleteRecordAction(Request $request): RedirectResponse {
868 868
 		if (Filter::checkCsrf()) {
869
-			$place_id  = (int)$request->get('place_id');
870
-			$parent_id = (int)$request->get('parent_id');
871
-			$inactive  = (int)$request->get('inactive');
869
+			$place_id  = (int) $request->get('place_id');
870
+			$parent_id = (int) $request->get('parent_id');
871
+			$inactive  = (int) $request->get('inactive');
872 872
 
873 873
 			try {
874 874
 				Database::prepare(
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
 				);
888 888
 			}
889 889
 			// If after deleting there are no more places at this level then go up a level
890
-			$children = (int)Database::prepare(
890
+			$children = (int) Database::prepare(
891 891
 				"SELECT COUNT(pl_id) FROM `##placelocation` WHERE pl_parent_id = :parent_id"
892 892
 			)
893 893
 				->execute(['parent_id' => $parent_id])
@@ -920,9 +920,9 @@  discard block
 block discarded – undo
920 920
 	 * @throws \Exception
921 921
 	 */
922 922
 	public function getAdminExportAction(Request $request) {
923
-		$parent_id = (int)$request->get('parent_id');
923
+		$parent_id = (int) $request->get('parent_id');
924 924
 		$format    = $request->get('format', 'csv');
925
-		$maxlevel  = (int)Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne();
925
+		$maxlevel  = (int) Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne();
926 926
 		$startfqpn = [];
927 927
 		$hierarchy = $this->gethierarchy($parent_id);
928 928
 		$geojson   = [];
@@ -974,8 +974,8 @@  discard block
 block discarded – undo
974 974
 							)
975 975
 						)
976 976
 					);
977
-					$long = (float)strtr($place['pl_long'], ['E' => '', 'W' => '-', ',' => '.']);
978
-					$lati = (float)strtr($place['pl_lati'], ['N' => '', 'S' => '-', ',' => '.']);
977
+					$long = (float) strtr($place['pl_long'], ['E' => '', 'W' => '-', ',' => '.']);
978
+					$lati = (float) strtr($place['pl_lati'], ['N' => '', 'S' => '-', ',' => '.']);
979 979
 
980 980
 					$geojson['features'][] = [
981 981
 						'type'     => 'Feature',
@@ -1007,8 +1007,8 @@  discard block
 block discarded – undo
1007 1007
 	}
1008 1008
 
1009 1009
 	public function getAdminImportFormAction(Request $request) {
1010
-		$parent_id   = (int)$request->get('parent_id');
1011
-		$inactive    = (int)$request->get('inactive');
1010
+		$parent_id   = (int) $request->get('parent_id');
1011
+		$inactive    = (int) $request->get('inactive');
1012 1012
 		$breadcrumbs = [
1013 1013
 			route('admin-control-panel') => I18N::translate('Control panel'),
1014 1014
 			route('admin-modules')       => I18N::translate('Module administration'),
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
 			}
1035 1035
 		);
1036 1036
 
1037
-		return (object)[
1037
+		return (object) [
1038 1038
 			'name' => 'modules/openstreetmap/admin-import-form',
1039 1039
 			'data' => [
1040 1040
 				'title'       => I18N::translate('Import geographic data'),
@@ -1098,8 +1098,8 @@  discard block
 block discarded – undo
1098 1098
 					$row    = explode($delimiter, $input_array[0]);
1099 1099
 					$fields = count($row);
1100 1100
 					if ($fields >= 6 &&
1101
-						(bool)preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) &&
1102
-						(bool)preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) {
1101
+						(bool) preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) &&
1102
+						(bool) preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) {
1103 1103
 						$filetype = 'csv';
1104 1104
 					}
1105 1105
 				}
@@ -1155,7 +1155,7 @@  discard block
 block discarded – undo
1155 1155
 			}
1156 1156
 
1157 1157
 			if ($filetype !== '?') {
1158
-				if ((bool)$request->get('cleardatabase')) {
1158
+				if ((bool) $request->get('cleardatabase')) {
1159 1159
 					Database::exec("TRUNCATE TABLE `##placelocation`");
1160 1160
 				}
1161 1161
 				//process places
@@ -1166,10 +1166,10 @@  discard block
 block discarded – undo
1166 1166
 				usort(
1167 1167
 					$places,
1168 1168
 					function (array $a, array $b) {
1169
-						if ((int)$a['pl_level'] === (int)$b['pl_level']) {
1169
+						if ((int) $a['pl_level'] === (int) $b['pl_level']) {
1170 1170
 							return I18N::strcasecmp($a['fqpn'], $b['fqpn']);
1171 1171
 						} else {
1172
-							return (int)$a['pl_level'] - (int)$b['pl_level'];
1172
+							return (int) $a['pl_level'] - (int) $b['pl_level'];
1173 1173
 						}
1174 1174
 					}
1175 1175
 				);
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
 						)) {
1190 1190
 
1191 1191
 						// overwrite
1192
-						$location->update((object)$place);
1192
+						$location->update((object) $place);
1193 1193
 						$updated++;
1194 1194
 					} elseif (!$valid && $options !== 'update') {
1195 1195
 						//add
@@ -1259,7 +1259,7 @@  discard block
 block discarded – undo
1259 1259
 	 */
1260 1260
 	public function postAdminImportPlacesAction(Request $request) {
1261 1261
 		$gedcomName = $request->get('ged');
1262
-		$inactive   = (int)$request->get('inactive');
1262
+		$inactive   = (int) $request->get('inactive');
1263 1263
 		$tree       = Tree::findByName($gedcomName);
1264 1264
 
1265 1265
 		// Get all the places from the places table ...
@@ -1478,7 +1478,7 @@  discard block
 block discarded – undo
1478 1478
 		$list = [];
1479 1479
 		/** @var array $rows */
1480 1480
 		foreach ($rows as $row) {
1481
-			if ((bool)$row['inactive'] && !$show_inactive) {
1481
+			if ((bool) $row['inactive'] && !$show_inactive) {
1482 1482
 				continue;
1483 1483
 			}
1484 1484
 
@@ -1489,20 +1489,20 @@  discard block
 block discarded – undo
1489 1489
 				]
1490 1490
 			)->fetchOneRow();
1491 1491
 
1492
-			if ((bool)$row['inactive']) {
1492
+			if ((bool) $row['inactive']) {
1493 1493
 				$badge = 'danger';
1494
-			} elseif ((int)$children->no_coord > 0) {
1494
+			} elseif ((int) $children->no_coord > 0) {
1495 1495
 				$badge = 'warning';
1496
-			} elseif ((int)$children->child_count > 0) {
1496
+			} elseif ((int) $children->child_count > 0) {
1497 1497
 				$badge = 'info';
1498 1498
 			} else {
1499 1499
 				$badge = 'secondary';
1500 1500
 			}
1501 1501
 
1502
-			$list[] = (object)array_merge(
1502
+			$list[] = (object) array_merge(
1503 1503
 				$row,
1504 1504
 				[
1505
-					'child_count' => (int)$children->child_count,
1505
+					'child_count' => (int) $children->child_count,
1506 1506
 					'badge'       => $badge,
1507 1507
 				]
1508 1508
 			);
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
 			$row       = $statement->execute(['id' => $id])->fetchOneRow();
1525 1525
 			$fqpn[]    = $row->pl_place;
1526 1526
 			$row->fqpn = implode(Place::GEDCOM_SEPARATOR, $fqpn);
1527
-			$id        = (int)$row->pl_parent_id;
1527
+			$id        = (int) $row->pl_parent_id;
1528 1528
 			$arr[]     = $row;
1529 1529
 		}
1530 1530
 
@@ -1539,7 +1539,7 @@  discard block
 block discarded – undo
1539 1539
 	 */
1540 1540
 	private function buildLevel($parent_id, $placename, &$places) {
1541 1541
 		$level = array_search('', $placename);
1542
-		$rows  = (array)Database::prepare(
1542
+		$rows  = (array) Database::prepare(
1543 1543
 			"SELECT pl_level, pl_id, pl_place, pl_long, pl_lati, pl_zoom, pl_icon FROM `##placelocation` WHERE pl_parent_id=? ORDER BY pl_place"
1544 1544
 		)
1545 1545
 			->execute([$parent_id])
Please login to merge, or discard this patch.