Completed
Push — openstreetmap ( 989c11...97b8ee )
by Greg
11:56
created
resources/views/modules/openstreetmap/admin-places.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 </div>
20 20
 <form method="POST"
21 21
 	  action="<?=e(route('admin-module',
22
-		  ['module' => $module, 'action' => 'AdminPlaces', 'parent_id' => $parent_id])) ?>">
22
+			['module' => $module, 'action' => 'AdminPlaces', 'parent_id' => $parent_id])) ?>">
23 23
 
24 24
 	<?= csrf_field() ?>
25 25
 	<?= Bootstrap4::checkbox(
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 		<tr>
55 55
             <td>
56 56
                 <a href="<?= e(route('admin-module',
57
-					   ['module' => $module,
58
-					    'action' => 'AdminPlaces',
59
-					    'parent_id' => $place->pl_id,
60
-					    'inactive' => $inactive]
61
-				   )
62
-				   ) ?>">
57
+						 ['module' => $module,
58
+							'action' => 'AdminPlaces',
59
+							'parent_id' => $place->pl_id,
60
+							'inactive' => $inactive]
61
+					 )
62
+					 ) ?>">
63 63
 					<?= e($place->pl_place) ?>
64 64
                     <span class="badge badge-pill badge-<?= $place->badge ?>">
65 65
 				        <?= I18N::number($place->child_count) ?>
@@ -68,11 +68,11 @@  discard block
 block discarded – undo
68 68
             </td>
69 69
 			<td>
70 70
 				<?= ($place->pl_lati === null) ? FontAwesome::decorativeIcon('warning') :
71
-                    strtr($place->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) ?>
71
+										strtr($place->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) ?>
72 72
 			</td>
73 73
 			<td>
74 74
 				<?= ($place->pl_long === null) ? FontAwesome::decorativeIcon('warning') :
75
-                    strtr($place->pl_long, ['E' => '', 'W' => '-', ',' => '.']) ?>
75
+										strtr($place->pl_long, ['E' => '', 'W' => '-', ',' => '.']) ?>
76 76
 			</td>
77 77
 			<td>
78 78
 				<?= $place->pl_long === null ? FontAwesome::decorativeIcon('warning') : $place->pl_zoom ?>
Please login to merge, or discard this 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/Http/Controllers/SearchController.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 
604 604
 		foreach ($search_terms as $n => $q) {
605 605
 			$queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
606
-			$sql                   .= " AND f_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
606
+			$sql .= " AND f_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
607 607
 			$args['collate_' . $n] = I18N::collation();
608 608
 			$args['query_' . $n]   = Database::escapeLike($q);
609 609
 		}
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 	 * @return Family[]
651 651
 	 */
652 652
 	private function searchFamilyNames(array $search_terms, array $search_trees): array {
653
-		$sql  =
653
+		$sql =
654 654
 			"SELECT DISTINCT f_id AS xref, f_file AS gedcom_id, f_gedcom AS gedcom" .
655 655
 			" FROM `##families`" .
656 656
 			" LEFT JOIN `##name` husb ON f_husb = husb.n_id AND f_file = husb.n_file" .
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 		$args = [];
660 660
 
661 661
 		foreach ($search_terms as $n => $q) {
662
-			$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 . ", '%'))";
662
+			$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 . ", '%'))";
663 663
 			$args['husb_collate_' . $n] = I18N::collation();
664 664
 			$args['husb_query_' . $n]   = Database::escapeLike($q);
665 665
 			$args['wife_collate_' . $n] = I18N::collation();
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
 
711 711
 		foreach ($search_terms as $n => $q) {
712 712
 			$queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
713
-			$sql                   .= " AND i_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
713
+			$sql .= " AND i_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
714 714
 			$args['collate_' . $n] = I18N::collation();
715 715
 			$args['query_' . $n]   = Database::escapeLike($q);
716 716
 		}
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
 		}
856 856
 
857 857
 		// Add the where clause
858
-		$sql    .= " WHERE ind.i_file=?";
858
+		$sql .= " WHERE ind.i_file=?";
859 859
 		$bind[] = $this->tree()->getTreeId();
860 860
 
861 861
 		foreach ($fields as $field_name => $field_value) {
@@ -866,15 +866,15 @@  discard block
 block discarded – undo
866 866
 					case 'GIVN':
867 867
 						switch ($modifiers[$field_name]) {
868 868
 							case 'EXACT':
869
-								$sql    .= " AND i_n.n_givn=?";
869
+								$sql .= " AND i_n.n_givn=?";
870 870
 								$bind[] = $field_value;
871 871
 								break;
872 872
 							case 'BEGINS':
873
-								$sql    .= " AND i_n.n_givn LIKE CONCAT(?, '%')";
873
+								$sql .= " AND i_n.n_givn LIKE CONCAT(?, '%')";
874 874
 								$bind[] = $field_value;
875 875
 								break;
876 876
 							case 'CONTAINS':
877
-								$sql    .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
877
+								$sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
878 878
 								$bind[] = $field_value;
879 879
 								break;
880 880
 							case 'SDX_STD':
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
 									$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
889 889
 								} else {
890 890
 									// No phonetic content? Use a substring match
891
-									$sql    .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
891
+									$sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
892 892
 									$bind[] = $field_value;
893 893
 								}
894 894
 								break;
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
 									$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
905 905
 								} else {
906 906
 									// No phonetic content? Use a substring match
907
-									$sql    .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
907
+									$sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
908 908
 									$bind[] = $field_value;
909 909
 								}
910 910
 								break;
@@ -913,15 +913,15 @@  discard block
 block discarded – undo
913 913
 					case 'SURN':
914 914
 						switch ($modifiers[$field_name]) {
915 915
 							case 'EXACT':
916
-								$sql    .= " AND i_n.n_surname=?";
916
+								$sql .= " AND i_n.n_surname=?";
917 917
 								$bind[] = $field_value;
918 918
 								break;
919 919
 							case 'BEGINS':
920
-								$sql    .= " AND i_n.n_surname LIKE CONCAT(?, '%')";
920
+								$sql .= " AND i_n.n_surname LIKE CONCAT(?, '%')";
921 921
 								$bind[] = $field_value;
922 922
 								break;
923 923
 							case 'CONTAINS':
924
-								$sql    .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')";
924
+								$sql .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')";
925 925
 								$bind[] = $field_value;
926 926
 								break;
927 927
 							case 'SDX_STD':
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
 									$sql .= " AND (" . implode(' OR ', $sdx) . ")";
936 936
 								} else {
937 937
 									// No phonetic content? Use a substring match
938
-									$sql    .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
938
+									$sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
939 939
 									$bind[] = $field_value;
940 940
 								}
941 941
 								break;
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
 									break;
953 953
 								} else {
954 954
 									// No phonetic content? Use a substring match
955
-									$sql    .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
955
+									$sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
956 956
 									$bind[] = $field_value;
957 957
 								}
958 958
 						}
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
 					case '_MARNM':
962 962
 					case '_HEB':
963 963
 					case '_AKA':
964
-						$sql    .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')";
964
+						$sql .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')";
965 965
 						$bind[] = $parts[1];
966 966
 						$bind[] = $field_value;
967 967
 						break;
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
 				$date = new Date($field_value);
972 972
 				if ($date->isOK()) {
973 973
 					$delta  = 365 * ($modifiers[$field_name] ?? 0);
974
-					$sql    .= " AND i_d.d_fact=? AND i_d.d_julianday1>=? AND i_d.d_julianday2<=?";
974
+					$sql .= " AND i_d.d_fact=? AND i_d.d_julianday1>=? AND i_d.d_julianday2<=?";
975 975
 					$bind[] = $parts[0];
976 976
 					$bind[] = $date->minimumJulianDay() - $delta;
977 977
 					$bind[] = $date->maximumJulianDay() + $delta;
@@ -981,7 +981,7 @@  discard block
 block discarded – undo
981 981
 				$date = new Date($field_value);
982 982
 				if ($date->isOK()) {
983 983
 					$delta  = 365 * $modifiers[$field_name];
984
-					$sql    .= " AND f_d.d_fact=? AND f_d.d_julianday1>=? AND f_d.d_julianday2<=?";
984
+					$sql .= " AND f_d.d_fact=? AND f_d.d_julianday1>=? AND f_d.d_julianday2<=?";
985 985
 					$bind[] = $parts[1];
986 986
 					$bind[] = $date->minimumJulianDay() - $delta;
987 987
 					$bind[] = $date->maximumJulianDay() + $delta;
@@ -989,12 +989,12 @@  discard block
 block discarded – undo
989 989
 			} elseif ($parts[1] === 'PLAC') {
990 990
 				// *:PLAC
991 991
 				// SQL can only link a place to a person/family, not to an event.
992
-				$sql    .= " AND i_p.place LIKE CONCAT('%', ?, '%')";
992
+				$sql .= " AND i_p.place LIKE CONCAT('%', ?, '%')";
993 993
 				$bind[] = $field_value;
994 994
 			} elseif ($parts[0] === 'FAMS' && $parts[2] === 'PLAC') {
995 995
 				// FAMS:*:PLAC
996 996
 				// SQL can only link a place to a person/family, not to an event.
997
-				$sql    .= " AND f_p.place LIKE CONCAT('%', ?, '%')";
997
+				$sql .= " AND f_p.place LIKE CONCAT('%', ?, '%')";
998 998
 				$bind[] = $field_value;
999 999
 			} elseif ($parts[0] === 'FAMC' && $parts[2] === 'NAME') {
1000 1000
 				$table = $parts[1] === 'HUSB' ? 'f_n' : 'm_n';
@@ -1003,15 +1003,15 @@  discard block
 block discarded – undo
1003 1003
 					case 'GIVN':
1004 1004
 						switch ($modifiers[$field_name]) {
1005 1005
 							case 'EXACT':
1006
-								$sql    .= " AND {$table}.n_givn=?";
1006
+								$sql .= " AND {$table}.n_givn=?";
1007 1007
 								$bind[] = $field_value;
1008 1008
 								break;
1009 1009
 							case 'BEGINS':
1010
-								$sql    .= " AND {$table}.n_givn LIKE CONCAT(?, '%')";
1010
+								$sql .= " AND {$table}.n_givn LIKE CONCAT(?, '%')";
1011 1011
 								$bind[] = $field_value;
1012 1012
 								break;
1013 1013
 							case 'CONTAINS':
1014
-								$sql    .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
1014
+								$sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
1015 1015
 								$bind[] = $field_value;
1016 1016
 								break;
1017 1017
 							case 'SDX_STD':
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
 									$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
1026 1026
 								} else {
1027 1027
 									// No phonetic content? Use a substring match
1028
-									$sql    .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')";
1028
+									$sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')";
1029 1029
 									$bind[] = $field_value;
1030 1030
 								}
1031 1031
 								break;
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
 									break;
1043 1043
 								} else {
1044 1044
 									// No phonetic content? Use a substring match
1045
-									$sql    .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')";
1045
+									$sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')";
1046 1046
 									$bind[] = $field_value;
1047 1047
 								}
1048 1048
 						}
@@ -1050,15 +1050,15 @@  discard block
 block discarded – undo
1050 1050
 					case 'SURN':
1051 1051
 						switch ($modifiers[$field_name]) {
1052 1052
 							case 'EXACT':
1053
-								$sql    .= " AND {$table}.n_surname=?";
1053
+								$sql .= " AND {$table}.n_surname=?";
1054 1054
 								$bind[] = $field_value;
1055 1055
 								break;
1056 1056
 							case 'BEGINS':
1057
-								$sql    .= " AND {$table}.n_surname LIKE CONCAT(?, '%')";
1057
+								$sql .= " AND {$table}.n_surname LIKE CONCAT(?, '%')";
1058 1058
 								$bind[] = $field_value;
1059 1059
 								break;
1060 1060
 							case 'CONTAINS':
1061
-								$sql    .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')";
1061
+								$sql .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')";
1062 1062
 								$bind[] = $field_value;
1063 1063
 								break;
1064 1064
 							case 'SDX_STD':
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
 									$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
1073 1073
 								} else {
1074 1074
 									// No phonetic content? Use a substring match
1075
-									$sql    .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')";
1075
+									$sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')";
1076 1076
 									$bind[] = $field_value;
1077 1077
 								}
1078 1078
 								break;
@@ -1088,7 +1088,7 @@  discard block
 block discarded – undo
1088 1088
 									$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
1089 1089
 								} else {
1090 1090
 									// No phonetic content? Use a substring match
1091
-									$sql    .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')";
1091
+									$sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')";
1092 1092
 									$bind[] = $field_value;
1093 1093
 								}
1094 1094
 								break;
@@ -1097,17 +1097,17 @@  discard block
 block discarded – undo
1097 1097
 				}
1098 1098
 			} elseif ($parts[0] === 'FAMS') {
1099 1099
 				// e.g. searches for occupation, religion, note, etc.
1100
-				$sql    .= " AND fam.f_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)";
1100
+				$sql .= " AND fam.f_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)";
1101 1101
 				$bind[] = $parts[1];
1102 1102
 				$bind[] = $field_value;
1103 1103
 			} elseif ($parts[1] === 'TYPE') {
1104 1104
 				// e.g. FACT:TYPE or EVEN:TYPE
1105
-				$sql    .= " AND ind.i_gedcom REGEXP CONCAT('\n1 ', ?, '.*(\n[2-9] .*)*\n2 TYPE .*', ?)";
1105
+				$sql .= " AND ind.i_gedcom REGEXP CONCAT('\n1 ', ?, '.*(\n[2-9] .*)*\n2 TYPE .*', ?)";
1106 1106
 				$bind[] = $parts[0];
1107 1107
 				$bind[] = $field_value;
1108 1108
 			} else {
1109 1109
 				// e.g. searches for occupation, religion, note, etc.
1110
-				$sql    .= " AND ind.i_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)";
1110
+				$sql .= " AND ind.i_gedcom REGEXP CONCAT('\n[0-9] ', ?, '(.*\n[0-9] CONT)* [^\n]*', ?)";
1111 1111
 				$bind[] = $parts[0];
1112 1112
 				$bind[] = $field_value;
1113 1113
 			}
@@ -1185,7 +1185,7 @@  discard block
 block discarded – undo
1185 1185
 		$sql .= ")";
1186 1186
 
1187 1187
 		if ($givn_sdx !== '') {
1188
-			$sql      .= " AND (";
1188
+			$sql .= " AND (";
1189 1189
 			$givn_sdx = explode(':', $givn_sdx);
1190 1190
 			foreach ($givn_sdx as $n => $sdx) {
1191 1191
 				$sql .= $n > 0 ? " OR " : "";
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
 		}
1204 1204
 
1205 1205
 		if ($surn_sdx !== '') {
1206
-			$sql      .= " AND (";
1206
+			$sql .= " AND (";
1207 1207
 			$surn_sdx = explode(':', $surn_sdx);
1208 1208
 			foreach ($surn_sdx as $n => $sdx) {
1209 1209
 				$sql .= $n ? " OR " : "";
@@ -1221,7 +1221,7 @@  discard block
 block discarded – undo
1221 1221
 		}
1222 1222
 
1223 1223
 		if ($plac_sdx !== '') {
1224
-			$sql      .= " AND (";
1224
+			$sql .= " AND (";
1225 1225
 			$plac_sdx = explode(':', $plac_sdx);
1226 1226
 			foreach ($plac_sdx as $n => $sdx) {
1227 1227
 				$sql .= $n ? " OR " : "";
@@ -1267,7 +1267,7 @@  discard block
 block discarded – undo
1267 1267
 
1268 1268
 		foreach ($search_terms as $n => $q) {
1269 1269
 			$queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
1270
-			$sql                   .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1270
+			$sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1271 1271
 			$args['collate_' . $n] = I18N::collation();
1272 1272
 			$args['query_' . $n]   = Database::escapeLike($q);
1273 1273
 		}
@@ -1322,7 +1322,7 @@  discard block
 block discarded – undo
1322 1322
 
1323 1323
 		foreach ($search_terms as $n => $q) {
1324 1324
 			$queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
1325
-			$sql                   .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1325
+			$sql .= " AND o_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1326 1326
 			$args['collate_' . $n] = I18N::collation();
1327 1327
 			$args['query_' . $n]   = Database::escapeLike($q);
1328 1328
 		}
@@ -1377,7 +1377,7 @@  discard block
 block discarded – undo
1377 1377
 
1378 1378
 		foreach ($search_terms as $n => $q) {
1379 1379
 			$queryregex[]          = preg_quote(I18N::strtoupper($q), '/');
1380
-			$sql                   .= " AND s_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1380
+			$sql .= " AND s_gedcom COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')";
1381 1381
 			$args['collate_' . $n] = I18N::collation();
1382 1382
 			$args['query_' . $n]   = Database::escapeLike($q);
1383 1383
 		}
Please login to merge, or discard this patch.
app/Http/Controllers/PlaceHierarchyController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,14 +50,14 @@  discard block
 block discarded – undo
50 50
 		$osm_module = Module::getModuleByName(self::MAP_MODULE);
51 51
 		$method     = 'assets';
52 52
 		$showmap    = $osm_module &&
53
-			(bool)$osm_module->getPreference('place_hierarchy') &&
53
+			(bool) $osm_module->getPreference('place_hierarchy') &&
54 54
 			method_exists($osm_module, $method) &&
55 55
 			strpos($action, 'hierarchy') === 0;
56 56
 		$data       = null;
57 57
 		$note       = false;
58 58
 
59 59
 		if ($showmap) {
60
-			$note    = true;
60
+			$note = true;
61 61
 			$content .= view('modules/openstreetmap/map',
62 62
 				[
63 63
 					'assets' => $osm_module->$method(),
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
 
71 71
 		switch ($action) {
72 72
 			case 'list':
73
-				$nextaction      = ['hierarchy' => I18N::translate('Show place hierarchy')];
74
-				$content         .= view('place-list', $this->getList($tree));
73
+				$nextaction = ['hierarchy' => I18N::translate('Show place hierarchy')];
74
+				$content .= view('place-list', $this->getList($tree));
75 75
 				break;
76 76
 			case 'hierarchy':
77 77
 			case 'hierarchy-e':
78 78
 				$nextaction      = ['list' => I18N::translate('Show all places in a list')];
79 79
 				$data            = $this->getHierarchy($tree, $place, $parent);
80
-				$content         .= (null === $data || $showmap) ? '' : view('place-hierarchy', $data);
80
+				$content .= (null === $data || $showmap) ? '' : view('place-hierarchy', $data);
81 81
 				if (null === $data || $action === 'hierarchy-e') {
82 82
 					$content .= view('place-events', $this->getEvents($tree, $place));
83 83
 				}
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 		return
119 119
 			[
120
-				'columns' => array_chunk($list_places, (int)ceil($numfound / $divisor)),
120
+				'columns' => array_chunk($list_places, (int) ceil($numfound / $divisor)),
121 121
 			];
122 122
 	}
123 123
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 				[
140 140
 					'tree'      => $tree,
141 141
 					'col_class' => "w-" . ($divisor === 2 ? "25" : "50"),
142
-					'columns'   => array_chunk($child_places, (int)ceil($numfound / $divisor)),
142
+					'columns'   => array_chunk($child_places, (int) ceil($numfound / $divisor)),
143 143
 					'place'     => $place,
144 144
 					'parent'    => $parent,
145 145
 				];
Please login to merge, or discard this patch.
app/Http/Controllers/FamilyBookChartController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@
 block discarded – undo
170 170
 				echo '<table cellspacing="0" cellpadding="0" border="0" >';
171 171
 				foreach ($children as $i => $child) {
172 172
 					echo '<tr><td>';
173
-					$kids    = $this->printDescendency($child, $generation + 1);
173
+					$kids = $this->printDescendency($child, $generation + 1);
174 174
 					$numkids += $kids;
175 175
 					echo '</td>';
176 176
 					// Print the lines
Please login to merge, or discard this patch.
app/Module/InteractiveTreeModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@
 block discarded – undo
161 161
 	 * @return Response
162 162
 	 */
163 163
 	public function getPersonsAction(Request $request): Response {
164
-		$q  = $request->get('q');
164
+		$q = $request->get('q');
165 165
 		$instance = $request->get('instance');
166 166
 		$treeview = new TreeView($instance);
167 167
 
Please login to merge, or discard this patch.
app/Module/OpenStreetMapModule.php 3 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1067,9 +1067,11 @@  discard block
 block discarded – undo
1067 1067
 		$delimiter   = '';
1068 1068
 		$field_names = ['pl_level', 'pl_long', 'pl_lati', 'pl_zoom', 'pl_icon', 'fqpn'];
1069 1069
 
1070
-		if ($serverfile !== '') {  // first choice is file on server
1070
+		if ($serverfile !== '') {
1071
+// first choice is file on server
1071 1072
 			$filename = WT_MODULES_DIR . $this->getName() . '/extra/' . $serverfile;
1072
-		} elseif ($_FILES['localfile']['error'] === UPLOAD_ERR_OK) { // 2nd choice is local file
1073
+		} elseif ($_FILES['localfile']['error'] === UPLOAD_ERR_OK) {
1074
+// 2nd choice is local file
1073 1075
 			$filename = $_FILES['localfile']['tmp_name'];
1074 1076
 		}
1075 1077
 
@@ -1090,7 +1092,8 @@  discard block
 block discarded – undo
1090 1092
 					$delimiter = ',';
1091 1093
 				}
1092 1094
 				if ($delimiter !== '') {
1093
-					if (!is_numeric($record[0])) { // lose the header
1095
+					if (!is_numeric($record[0])) {
1096
+// lose the header
1094 1097
 						array_shift($input_array);
1095 1098
 					}
1096 1099
 
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -529,8 +529,8 @@  discard block
 block discarded – undo
529 529
 			case 'BaseData':
530 530
 				$varName = (self::$map_selections['style'] === '') ? '' : self::$map_providers[self::$map_selections['provider']]['styles'][self::$map_selections['style']];
531 531
 				$payload = ['selectedProvIndex' => self::$map_selections['provider'],
532
-				            'selectedProvName'  => self::$map_providers[self::$map_selections['provider']]['name'],
533
-				            'selectedStyleName' => $varName,
532
+										'selectedProvName'  => self::$map_providers[self::$map_selections['provider']]['name'],
533
+										'selectedStyleName' => $varName,
534 534
 				];
535 535
 				break;
536 536
 			case 'ProviderStyles':
@@ -543,9 +543,9 @@  discard block
 block discarded – undo
543 543
 					$providers[$key] = $provider['name'];
544 544
 				}
545 545
 				$payload = ['providers'     => $providers,
546
-				            'selectedProv'  => self::$map_selections['provider'],
547
-				            'styles'        => self::$map_providers[self::$map_selections['provider']]['styles'],
548
-				            'selectedStyle' => self::$map_selections['style'],
546
+										'selectedProv'  => self::$map_selections['provider'],
547
+										'styles'        => self::$map_providers[self::$map_selections['provider']]['styles'],
548
+										'selectedStyle' => self::$map_selections['style'],
549 549
 				];
550 550
 				break;
551 551
 			default:
@@ -1105,8 +1105,8 @@  discard block
 block discarded – undo
1105 1105
 					$row    = explode($delimiter, $input_array[0]);
1106 1106
 					$fields = count($row);
1107 1107
 					if ($fields >= 6 &&
1108
-					    (bool)preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) &&
1109
-					    (bool)preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) {
1108
+							(bool)preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) &&
1109
+							(bool)preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) {
1110 1110
 						$filetype = 'csv';
1111 1111
 					}
1112 1112
 				}
Please login to merge, or discard this patch.
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 						$color            = self::LINE_COLORS[log($id, 2) % $color_count];
298 298
 						$icon['color']    = $color; //make icon color the same as the line
299 299
 						$sosa_points[$id] = $event->getLatLonJSArray();
300
-						$sosa_parent      = (int)floor($id / 2);
300
+						$sosa_parent      = (int) floor($id / 2);
301 301
 						if (array_key_exists($sosa_parent, $sosa_points)) {
302 302
 							// Would like to use a GeometryCollection to hold LineStrings
303 303
 							// rather than generate polylines but the MarkerCluster library
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 								'modules/openstreetmap/event-sidebar',
330 330
 								$event->shortSummary($mapType, $id)
331 331
 							),
332
-							'zoom'     => (int)$event->getZoom(),
332
+							'zoom'     => (int) $event->getZoom(),
333 333
 						],
334 334
 					];
335 335
 				}
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 							'stats'    => $placeStats,
400 400
 						]
401 401
 					),
402
-					'zoom'    => (int)($location->getZoom() ?? 2),
402
+					'zoom'    => (int) ($location->getZoom() ?? 2),
403 403
 				],
404 404
 			];
405 405
 		}
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 		$xref        = $request->get('reference');
452 452
 		$tree        = $request->attributes->get('tree');
453 453
 		$individual  = Individual::getInstance($xref, $tree);
454
-		$generations = (int)$request->get(
454
+		$generations = (int) $request->get(
455 455
 			'generations',
456 456
 			$tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS')
457 457
 		);
@@ -500,14 +500,14 @@  discard block
 block discarded – undo
500 500
 						function ($item) {
501 501
 							return preg_replace('/[^a-z\d]/i', '', strtolower($item));
502 502
 						},
503
-						(array)$provider->styles
503
+						(array) $provider->styles
504 504
 					);
505 505
 
506
-					$key = preg_replace('/[^a-z\d]/i', '', strtolower((string)$provider->name));
506
+					$key = preg_replace('/[^a-z\d]/i', '', strtolower((string) $provider->name));
507 507
 
508 508
 					self::$map_providers[$key] = [
509
-						'name'   => (string)$provider->name,
510
-						'styles' => array_combine($style_keys, (array)$provider->styles),
509
+						'name'   => (string) $provider->name,
510
+						'styles' => array_combine($style_keys, (array) $provider->styles),
511 511
 					];
512 512
 				}
513 513
 			} catch (\Exception $ex) {
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 					'provider' => 'openstreetmap',
517 517
 					'style'    => 'mapnik',
518 518
 				];
519
-				self::$map_providers  = [
519
+				self::$map_providers = [
520 520
 					'openstreetmap' => [
521 521
 						'name'   => 'OpenStreetMap',
522 522
 						'styles' => ['mapnik' => 'Mapnik'],
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
 		$maxgenerations = $tree->getPreference('MAX_PEDIGREE_GENERATIONS');
570 570
 		$generations    = $request->get('generations', $tree->getPreference('DEFAULT_PEDIGREE_GENERATIONS'));
571 571
 
572
-		return (object)[
572
+		return (object) [
573 573
 			'name' => 'modules/openstreetmap/pedigreemap',
574 574
 			'data' => [
575 575
 				'assets'         => $this->assets(),
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 	 * @return object
633 633
 	 */
634 634
 	public function getAdminConfigAction(Request $request) {
635
-		return (object)[
635
+		return (object) [
636 636
 			'name' => 'modules/openstreetmap/admin-config',
637 637
 			'data' => [
638 638
 				'title'        => I18N::translate('Open Street Maps (Configuration)'),
@@ -688,8 +688,8 @@  discard block
 block discarded – undo
688 688
 	 * @throws \Exception
689 689
 	 */
690 690
 	public function getAdminPlacesAction(Request $request) {
691
-		$parent_id   = (int)$request->get('parent_id', 0);
692
-		$inactive    = (bool)$request->get('inactive');
691
+		$parent_id   = (int) $request->get('parent_id', 0);
692
+		$inactive    = (bool) $request->get('inactive');
693 693
 		$hierarchy   = $this->gethierarchy($parent_id);
694 694
 		$title       = I18N::translate('Open Street Maps (Geographic data)');
695 695
 		$breadcrumbs = [
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
 		}
713 713
 		$breadcrumbs[] = array_pop($breadcrumbs);
714 714
 
715
-		return (object)[
715
+		return (object) [
716 716
 			'name' => 'modules/openstreetmap/admin-places',
717 717
 			'data' => [
718 718
 				'title'       => $title,
@@ -733,9 +733,9 @@  discard block
 block discarded – undo
733 733
 	 * @throws \Exception
734 734
 	 */
735 735
 	public function getAdminPlaceEditAction(Request $request) {
736
-		$parent_id = (int)$request->get('parent_id', 0);
737
-		$place_id  = (int)$request->get('place_id');
738
-		$inactive  = (int)$request->get('inactive');
736
+		$parent_id = (int) $request->get('parent_id', 0);
737
+		$place_id  = (int) $request->get('place_id');
738
+		$inactive  = (int) $request->get('inactive');
739 739
 		$hierarchy = $this->gethierarchy($place_id);
740 740
 		$fqpn      = empty($hierarchy) ? '' : $hierarchy[0]->fqpn;
741 741
 		$location  = new Location($fqpn);
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
 		}
772 772
 		$breadcrumbs[] = $place_id === 0 ? I18N::translate('Add') : I18N::translate('Edit');
773 773
 
774
-		return (object)[
774
+		return (object) [
775 775
 			'name' => 'modules/openstreetmap/admin-place-edit',
776 776
 			'data' => [
777 777
 				'module'      => $this->getName(),
@@ -797,9 +797,9 @@  discard block
 block discarded – undo
797 797
 	 */
798 798
 	public function postAdminSaveAction(Request $request): RedirectResponse {
799 799
 		if (Filter::checkCsrf()) {
800
-			$parent_id = (int)$request->get('parent_id');
801
-			$place_id  = (int)$request->get('place_id');
802
-			$inactive  = (int)$request->get('inactive');
800
+			$parent_id = (int) $request->get('parent_id');
801
+			$place_id  = (int) $request->get('place_id');
802
+			$inactive  = (int) $request->get('inactive');
803 803
 			$lat       = round($request->get('new_place_lati'), 5); // 5 decimal places (locate to within about 1 metre)
804 804
 			$lat       = ($lat < 0 ? 'S' : 'N') . abs($lat);
805 805
 			$lng       = round($request->get('new_place_long'), 5);
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 						  VALUES (:id, :parent, :level, :place, :lng, :lat, :zoom, :icon)"
819 819
 				)->execute(
820 820
 					[
821
-						'id'     => (int)Database::prepare("SELECT MAX(pl_id)+1 FROM `##placelocation`")->fetchOne(),
821
+						'id'     => (int) Database::prepare("SELECT MAX(pl_id)+1 FROM `##placelocation`")->fetchOne(),
822 822
 						'parent' => $parent_id,
823 823
 						'level'  => $level,
824 824
 						'place'  => $request->get('new_place_name'),
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
 						'place' => $request->get('new_place_name'),
838 838
 						'lat'   => $request->get('lati_control') . $lat,
839 839
 						'lng'   => $request->get('long_control') . $lng,
840
-						'zoom'  => (int)$request->get('new_zoom_factor'),
840
+						'zoom'  => (int) $request->get('new_zoom_factor'),
841 841
 						'icon'  => $icon,
842 842
 					]
843 843
 				);
@@ -870,9 +870,9 @@  discard block
 block discarded – undo
870 870
 	 */
871 871
 	public function postAdminDeleteRecordAction(Request $request): RedirectResponse {
872 872
 		if (Filter::checkCsrf()) {
873
-			$place_id  = (int)$request->get('place_id');
874
-			$parent_id = (int)$request->get('parent_id');
875
-			$inactive  = (int)$request->get('inactive');
873
+			$place_id  = (int) $request->get('place_id');
874
+			$parent_id = (int) $request->get('parent_id');
875
+			$inactive  = (int) $request->get('inactive');
876 876
 
877 877
 			try {
878 878
 				Database::prepare(
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
 				);
892 892
 			}
893 893
 			// If after deleting there are no more places at this level then go up a level
894
-			$children = (int)Database::prepare(
894
+			$children = (int) Database::prepare(
895 895
 				"SELECT COUNT(pl_id) FROM `##placelocation` WHERE pl_parent_id = :parent_id"
896 896
 			)
897 897
 				->execute(['parent_id' => $parent_id])
@@ -924,9 +924,9 @@  discard block
 block discarded – undo
924 924
 	 * @throws \Exception
925 925
 	 */
926 926
 	public function getAdminExportAction(Request $request): RedirectResponse {
927
-		$parent_id = (int)$request->get('parent_id');
927
+		$parent_id = (int) $request->get('parent_id');
928 928
 		$format    = $request->get('format', 'csv');
929
-		$maxlevel  = (int)Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne();
929
+		$maxlevel  = (int) Database::prepare("SELECT max(pl_level) FROM `##placelocation`")->execute()->fetchOne();
930 930
 		$startfqpn = [];
931 931
 		$hierarchy = $this->gethierarchy($parent_id);
932 932
 		$geojson   = [];
@@ -978,8 +978,8 @@  discard block
 block discarded – undo
978 978
 							)
979 979
 						)
980 980
 					);
981
-					$long = (float)strtr($place['pl_long'], ['E' => '', 'W' => '-', ',' => '.']);
982
-					$lati = (float)strtr($place['pl_lati'], ['N' => '', 'S' => '-', ',' => '.']);
981
+					$long = (float) strtr($place['pl_long'], ['E' => '', 'W' => '-', ',' => '.']);
982
+					$lati = (float) strtr($place['pl_lati'], ['N' => '', 'S' => '-', ',' => '.']);
983 983
 
984 984
 					$geojson['features'][] = [
985 985
 						'type'       => 'Feature',
@@ -1015,8 +1015,8 @@  discard block
 block discarded – undo
1015 1015
 	 * @return object
1016 1016
 	 */
1017 1017
 	public function getAdminImportFormAction(Request $request) {
1018
-		$parent_id   = (int)$request->get('parent_id');
1019
-		$inactive    = (int)$request->get('inactive');
1018
+		$parent_id   = (int) $request->get('parent_id');
1019
+		$inactive    = (int) $request->get('inactive');
1020 1020
 		$breadcrumbs = [
1021 1021
 			route('admin-control-panel') => I18N::translate('Control panel'),
1022 1022
 			route('admin-modules')       => I18N::translate('Module administration'),
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 			)                            => $this->getTitle() . ' (' . I18N::translate('Geographic data') . ')',
1032 1032
 			I18N::translate('Import file'),
1033 1033
 		];
1034
-		$files       = $this->findFiles(WT_MODULES_DIR . $this->getName() . '/extra', ['csv', 'geojson', 'json']);
1034
+		$files = $this->findFiles(WT_MODULES_DIR . $this->getName() . '/extra', ['csv', 'geojson', 'json']);
1035 1035
 		uasort(
1036 1036
 			$files,
1037 1037
 			function ($a, $b) {
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
 			}
1043 1043
 		);
1044 1044
 
1045
-		return (object)[
1045
+		return (object) [
1046 1046
 			'name' => 'modules/openstreetmap/admin-import-form',
1047 1047
 			'data' => [
1048 1048
 				'title'       => I18N::translate('Import geographic data'),
@@ -1106,8 +1106,8 @@  discard block
 block discarded – undo
1106 1106
 					$row    = explode($delimiter, $input_array[0]);
1107 1107
 					$fields = count($row);
1108 1108
 					if ($fields >= 6 &&
1109
-					    (bool)preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) &&
1110
-					    (bool)preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) {
1109
+					    (bool) preg_match("/[SN][0-9]*\.?[0-9]*/", $row[$fields - 3]) &&
1110
+					    (bool) preg_match("/[EW][0-9]*\.?[0-9]*/", $row[$fields - 4])) {
1111 1111
 						$filetype = 'csv';
1112 1112
 					}
1113 1113
 				}
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
 							}
1148 1148
 						);
1149 1149
 						// convert separate place fields into a comma separated placename
1150
-						$row[]    = implode(
1150
+						$row[] = implode(
1151 1151
 							Place::GEDCOM_SEPARATOR,
1152 1152
 							array_filter(
1153 1153
 								array_reverse(
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
 			}
1164 1164
 
1165 1165
 			if ($filetype !== '?') {
1166
-				if ((bool)$request->get('cleardatabase')) {
1166
+				if ((bool) $request->get('cleardatabase')) {
1167 1167
 					Database::exec("TRUNCATE TABLE `##placelocation`");
1168 1168
 				}
1169 1169
 				//process places
@@ -1174,10 +1174,10 @@  discard block
 block discarded – undo
1174 1174
 				usort(
1175 1175
 					$places,
1176 1176
 					function (array $a, array $b) {
1177
-						if ((int)$a['pl_level'] === (int)$b['pl_level']) {
1177
+						if ((int) $a['pl_level'] === (int) $b['pl_level']) {
1178 1178
 							return I18N::strcasecmp($a['fqpn'], $b['fqpn']);
1179 1179
 						} else {
1180
-							return (int)$a['pl_level'] - (int)$b['pl_level'];
1180
+							return (int) $a['pl_level'] - (int) $b['pl_level'];
1181 1181
 						}
1182 1182
 					}
1183 1183
 				);
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
 						)) {
1198 1198
 
1199 1199
 						// overwrite
1200
-						$location->update((object)$place);
1200
+						$location->update((object) $place);
1201 1201
 						$updated++;
1202 1202
 					} elseif (!$valid && $options !== 'update') {
1203 1203
 						//add
@@ -1267,7 +1267,7 @@  discard block
 block discarded – undo
1267 1267
 	 */
1268 1268
 	public function postAdminImportPlacesAction(Request $request): RedirectResponse {
1269 1269
 		$gedcomName = $request->get('ged');
1270
-		$inactive   = (int)$request->get('inactive');
1270
+		$inactive   = (int) $request->get('inactive');
1271 1271
 		$tree       = Tree::findByName($gedcomName);
1272 1272
 
1273 1273
 		// Get all the places from the places table ...
@@ -1323,7 +1323,7 @@  discard block
 block discarded – undo
1323 1323
 				"INSERT INTO `##placelocation` (pl_id, pl_parent_id, pl_level, pl_place)" .
1324 1324
 				" VALUES (:id, :parent, :level, :place)"
1325 1325
 			);
1326
-			$checkRecordQry  = Database::prepare(
1326
+			$checkRecordQry = Database::prepare(
1327 1327
 				"SELECT pl1.pl_id" .
1328 1328
 				" FROM	  `##placelocation` AS pl1" .
1329 1329
 				" LEFT JOIN `##placelocation` AS pl2 ON (pl1.pl_parent_id = pl2.pl_id)" .
@@ -1486,18 +1486,18 @@  discard block
 block discarded – undo
1486 1486
 
1487 1487
 			if ($row['inactive']) {
1488 1488
 				$badge = 'danger';
1489
-			} elseif ((int)$children->no_coord > 0) {
1489
+			} elseif ((int) $children->no_coord > 0) {
1490 1490
 				$badge = 'warning';
1491
-			} elseif ((int)$children->child_count > 0) {
1491
+			} elseif ((int) $children->child_count > 0) {
1492 1492
 				$badge = 'info';
1493 1493
 			} else {
1494 1494
 				$badge = 'secondary';
1495 1495
 			}
1496 1496
 
1497
-			$list[] = (object)array_merge(
1497
+			$list[] = (object) array_merge(
1498 1498
 				$row,
1499 1499
 				[
1500
-					'child_count' => (int)$children->child_count,
1500
+					'child_count' => (int) $children->child_count,
1501 1501
 					'badge'       => $badge,
1502 1502
 				]
1503 1503
 			);
@@ -1519,7 +1519,7 @@  discard block
 block discarded – undo
1519 1519
 			$row       = $statement->execute(['id' => $id])->fetchOneRow();
1520 1520
 			$fqpn[]    = $row->pl_place;
1521 1521
 			$row->fqpn = implode(Place::GEDCOM_SEPARATOR, $fqpn);
1522
-			$id        = (int)$row->pl_parent_id;
1522
+			$id        = (int) $row->pl_parent_id;
1523 1523
 			$arr[]     = $row;
1524 1524
 		}
1525 1525
 
@@ -1534,7 +1534,7 @@  discard block
 block discarded – undo
1534 1534
 	 */
1535 1535
 	private function buildLevel($parent_id, $placename, &$places) {
1536 1536
 		$level = array_search('', $placename);
1537
-		$rows  = (array)Database::prepare(
1537
+		$rows  = (array) Database::prepare(
1538 1538
 			"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"
1539 1539
 		)
1540 1540
 			->execute([$parent_id])
Please login to merge, or discard this patch.
resources/views/admin/trees.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 				</div>
30 30
 				<div id="card-tree-content-<?= $managed_tree->getTreeId() ?>" class="collapse<?= $managed_tree == $tree || $managed_tree->getPreference('imported') === '0' ? ' show' : '' ?>" role="tabpanel" aria-labelledby="panel-tree-header-<?= $managed_tree->getTreeId() ?>">
31 31
 					<div class="card-body">
32
-						<?php $importing = Database::prepare( "SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id = ? AND imported = '0' LIMIT 1" )->execute([$managed_tree->getTreeId()])->fetchOne() ?>
32
+						<?php $importing = Database::prepare("SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id = ? AND imported = '0' LIMIT 1")->execute([$managed_tree->getTreeId()])->fetchOne() ?>
33 33
 						<?php if ($importing): ?>
34 34
 							<div id="import<?= $managed_tree->getTreeId() ?>" class="col-xs-12">
35 35
 								<div class="progress">
Please login to merge, or discard this patch.