@@ -23,7 +23,7 @@ |
||
23 | 23 | </div> |
24 | 24 | <select id="serverfile" name="serverfile" class="form-control"> |
25 | 25 | <option selected value=""></option> |
26 | - <?php foreach($files as $file): ?> |
|
26 | + <?php foreach ($files as $file): ?> |
|
27 | 27 | <option value="<?= e($file) ?>"> |
28 | 28 | <?= e($file) ?> |
29 | 29 | </option> |
@@ -32,12 +32,10 @@ |
||
32 | 32 | </a> |
33 | 33 | </th> |
34 | 34 | <td> |
35 | - <?= ($place->pl_lati === null) ? FontAwesome::decorativeIcon('warning') : |
|
36 | - strtr($place->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) ?> |
|
35 | + <?= ($place->pl_lati === null) ? FontAwesome::decorativeIcon('warning') : strtr($place->pl_lati, ['N' => '', 'S' => '-', ',' => '.']) ?> |
|
37 | 36 | </td> |
38 | 37 | <td> |
39 | - <?= ($place->pl_long === null) ? FontAwesome::decorativeIcon('warning') : |
|
40 | - strtr($place->pl_long, ['E' => '', 'W' => '-', ',' => '.']) ?> |
|
38 | + <?= ($place->pl_long === null) ? FontAwesome::decorativeIcon('warning') : strtr($place->pl_long, ['E' => '', 'W' => '-', ',' => '.']) ?> |
|
41 | 39 | </td> |
42 | 40 | <td> |
43 | 41 | <?= $place->pl_long === null ? FontAwesome::decorativeIcon('warning') : $place->pl_zoom ?> |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | 'type' => 'radio', |
101 | 101 | 'name' => $name, |
102 | 102 | 'value' => $value, |
103 | - 'checked' => (string)$value === (string)$selected, |
|
103 | + 'checked' => (string) $value === (string) $selected, |
|
104 | 104 | ] + $attributes); |
105 | 105 | |
106 | 106 | $html .= |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | foreach ($options as $value => $option) { |
130 | 130 | $option_attributes = self::attributes([ |
131 | 131 | 'value' => $value, |
132 | - 'selected' => (string)$value === (string)$selected, |
|
132 | + 'selected' => (string) $value === (string) $selected, |
|
133 | 133 | ]); |
134 | 134 | |
135 | 135 | $html .= '<option ' . $option_attributes . '>' . e($option) . '</option>'; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | foreach ($options as $value => $option) { |
162 | 162 | $option_attributes = self::attributes([ |
163 | 163 | 'value' => $value, |
164 | - 'selected' => in_array((string)$value, $selected), |
|
164 | + 'selected' => in_array((string) $value, $selected), |
|
165 | 165 | ]); |
166 | 166 | |
167 | 167 | $html .= '<option ' . $option_attributes . '>' . e($option) . '</option>'; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | </div> |
29 | 29 | <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() ?>"> |
30 | 30 | <div class="card-body"> |
31 | - <?php $importing = Database::prepare("SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id = ? AND imported = '0' LIMIT 1" )->execute([$managed_tree->getTreeId()])->fetchOne() ?> |
|
31 | + <?php $importing = Database::prepare("SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id = ? AND imported = '0' LIMIT 1")->execute([$managed_tree->getTreeId()])->fetchOne() ?> |
|
32 | 32 | <?php if ($importing): ?> |
33 | 33 | <div id="import<?= $managed_tree->getTreeId() ?>" class="col-xs-12"> |
34 | 34 | <div class="progress"> |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | if ($openParIndex !== false) { |
293 | 293 | // Opening parentheses always inherit the following directionality |
294 | 294 | self::$waitingText .= $currentLetter; |
295 | - $workingText = substr($workingText, $currentLen); |
|
295 | + $workingText = substr($workingText, $currentLen); |
|
296 | 296 | while (true) { |
297 | 297 | if ($workingText === '') { |
298 | 298 | break; |
@@ -300,13 +300,13 @@ discard block |
||
300 | 300 | if (substr($workingText, 0, 1) === ' ') { |
301 | 301 | // Spaces following this left parenthesis inherit the following directionality too |
302 | 302 | self::$waitingText .= ' '; |
303 | - $workingText = substr($workingText, 1); |
|
303 | + $workingText = substr($workingText, 1); |
|
304 | 304 | continue; |
305 | 305 | } |
306 | 306 | if (substr($workingText, 0, 6) === ' ') { |
307 | 307 | // Spaces following this left parenthesis inherit the following directionality too |
308 | 308 | self::$waitingText .= ' '; |
309 | - $workingText = substr($workingText, 6); |
|
309 | + $workingText = substr($workingText, 6); |
|
310 | 310 | continue; |
311 | 311 | } |
312 | 312 | break; |
@@ -323,9 +323,9 @@ discard block |
||
323 | 323 | // Exceptions to this rule will be handled later during final clean-up. |
324 | 324 | // |
325 | 325 | self::$waitingText .= $currentLetter; |
326 | - $workingText = substr($workingText, $currentLen); |
|
326 | + $workingText = substr($workingText, $currentLen); |
|
327 | 327 | if (self::$currentState != '') { |
328 | - $result .= self::$waitingText; |
|
328 | + $result .= self::$waitingText; |
|
329 | 329 | self::$waitingText = ''; |
330 | 330 | } |
331 | 331 | break 2; // double break because we're waiting for more information |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | } |
457 | 457 | if (substr($result . "\n", 0, self::LENGTH_START) != self::START_LTR && substr($result . "\n", 0, self::LENGTH_START) != self::START_RTL) { |
458 | 458 | $leadingText .= substr($result, 0, 1); |
459 | - $result = substr($result, 1); |
|
459 | + $result = substr($result, 1); |
|
460 | 460 | continue; |
461 | 461 | } |
462 | 462 | $result = substr($result, 0, self::LENGTH_START) . $leadingText . substr($result, self::LENGTH_START); |
@@ -591,11 +591,11 @@ discard block |
||
591 | 591 | public static function breakCurrentSpan(&$result) |
592 | 592 | { |
593 | 593 | // Interrupt the current span, insert that <br>, and then continue the current span |
594 | - $result .= self::$waitingText; |
|
594 | + $result .= self::$waitingText; |
|
595 | 595 | self::$waitingText = ''; |
596 | 596 | |
597 | 597 | $breakString = '<' . self::$currentState . 'br>'; |
598 | - $result .= $breakString; |
|
598 | + $result .= $breakString; |
|
599 | 599 | } |
600 | 600 | |
601 | 601 | /** |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | break; |
649 | 649 | } // No more numeric strings |
650 | 650 | |
651 | - $tempResult .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string |
|
651 | + $tempResult .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string |
|
652 | 652 | $numericString = substr($textSpan, $posLRE + 3, $posPDF - $posLRE); // Separate the entire numeric string |
653 | 653 | $textSpan = substr($textSpan, $posPDF + 3); |
654 | 654 | $posColon = strpos($numericString, ':'); |
@@ -1140,7 +1140,7 @@ discard block |
||
1140 | 1140 | while ($string) { |
1141 | 1141 | if (mb_strlen($string) <= $width) { |
1142 | 1142 | // Do not wrap any text that is less than the output area. |
1143 | - $out .= $string; |
|
1143 | + $out .= $string; |
|
1144 | 1144 | $string = ''; |
1145 | 1145 | } else { |
1146 | 1146 | $sub1 = mb_substr($string, 0, $width + 1); |
@@ -1154,7 +1154,7 @@ discard block |
||
1154 | 1154 | if ($spacepos === false) { |
1155 | 1155 | // No space on line? |
1156 | 1156 | if ($cut) { |
1157 | - $out .= $sub . $sep; |
|
1157 | + $out .= $sub . $sep; |
|
1158 | 1158 | $string = mb_substr($string, mb_strlen($sub)); |
1159 | 1159 | } else { |
1160 | 1160 | $spacepos = strpos($string, ' '); |
@@ -1168,7 +1168,7 @@ discard block |
||
1168 | 1168 | } |
1169 | 1169 | } else { |
1170 | 1170 | // Split at space; |
1171 | - $out .= substr($string, 0, $spacepos) . $sep; |
|
1171 | + $out .= substr($string, 0, $spacepos) . $sep; |
|
1172 | 1172 | $string = substr($string, $spacepos + 1); |
1173 | 1173 | } |
1174 | 1174 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function edit(Tree $tree, User $user): Response |
49 | 49 | { |
50 | - $allow_user_themes = (bool)Site::getPreference('ALLOW_USER_THEMES'); |
|
50 | + $allow_user_themes = (bool) Site::getPreference('ALLOW_USER_THEMES'); |
|
51 | 51 | $my_individual_record = Individual::getInstance($tree->getUserPreference(Auth::user(), 'gedcomid'), $tree); |
52 | 52 | $contact_methods = FunctionsEdit::optionsContactMethods(); |
53 | 53 | $default_individual = Individual::getInstance($tree->getUserPreference(Auth::user(), 'rootid'), $tree); |
@@ -82,16 +82,16 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function update(Request $request, Tree $tree, User $user): RedirectResponse |
84 | 84 | { |
85 | - $contact_method = (string)$request->get('contact_method'); |
|
86 | - $email = (string)$request->get('email'); |
|
87 | - $language = (string)$request->get('language'); |
|
88 | - $real_name = (string)$request->get('real_name'); |
|
89 | - $password = (string)$request->get('password'); |
|
90 | - $rootid = (string)$request->get('root_id'); |
|
91 | - $theme = (string)$request->get('theme'); |
|
92 | - $time_zone = (string)$request->get('timezone'); |
|
93 | - $user_name = (string)$request->get('user_name'); |
|
94 | - $visible_online = (string)$request->get('visible_online'); |
|
85 | + $contact_method = (string) $request->get('contact_method'); |
|
86 | + $email = (string) $request->get('email'); |
|
87 | + $language = (string) $request->get('language'); |
|
88 | + $real_name = (string) $request->get('real_name'); |
|
89 | + $password = (string) $request->get('password'); |
|
90 | + $rootid = (string) $request->get('root_id'); |
|
91 | + $theme = (string) $request->get('theme'); |
|
92 | + $time_zone = (string) $request->get('timezone'); |
|
93 | + $user_name = (string) $request->get('user_name'); |
|
94 | + $visible_online = (string) $request->get('visible_online'); |
|
95 | 95 | |
96 | 96 | // Change the password |
97 | 97 | if ($password !== '') { |
@@ -290,8 +290,8 @@ discard block |
||
290 | 290 | public function editRawRecordAction(Request $request, Tree $tree): Response |
291 | 291 | { |
292 | 292 | $xref = $request->get('xref'); |
293 | - $facts = (array)$request->get('fact'); |
|
294 | - $fact_ids = (array)$request->get('fact_id'); |
|
293 | + $facts = (array) $request->get('fact'); |
|
294 | + $fact_ids = (array) $request->get('fact_id'); |
|
295 | 295 | $record = GedcomRecord::getInstance($xref, $tree); |
296 | 296 | |
297 | 297 | $this->checkRecordAccess($record, true); |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | $record = GedcomRecord::getInstance($xref, $tree); |
396 | 396 | $this->checkRecordAccess($record, true); |
397 | 397 | |
398 | - $keep_chan = (bool)$request->get('keep_chan'); |
|
398 | + $keep_chan = (bool) $request->get('keep_chan'); |
|
399 | 399 | |
400 | 400 | $this->glevels = $request->get('glevels', []); |
401 | 401 | $this->tag = $request->get('tag', []); |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | |
415 | 415 | $newged = ''; |
416 | 416 | if (!empty($_POST['NAME'])) { |
417 | - $newged .= "\n1 NAME " . $_POST['NAME']; |
|
417 | + $newged .= "\n1 NAME " . $_POST['NAME']; |
|
418 | 418 | $name_facts = [ |
419 | 419 | 'TYPE', |
420 | 420 | 'NPFX', |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $pages = []; |
85 | 85 | |
86 | 86 | // Escape the query for MySQL and PHP, converting spaces to wildcards. |
87 | - $like_query = strtr($query, [ |
|
87 | + $like_query = strtr($query, [ |
|
88 | 88 | '_' => '\\_', |
89 | 89 | '%' => '\\%', |
90 | 90 | ' ' => '%', |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function select2Family(Request $request, Tree $tree): JsonResponse |
208 | 208 | { |
209 | - $page = (int)$request->get('page'); |
|
209 | + $page = (int) $request->get('page'); |
|
210 | 210 | $query = $request->get('q'); |
211 | 211 | |
212 | 212 | return new JsonResponse(Select2::familySearch($tree, $page, $query)); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | public function select2Flag(Request $request): JsonResponse |
221 | 221 | { |
222 | 222 | $page = $request->get('page'); |
223 | - $query = (int)$request->get('q'); |
|
223 | + $query = (int) $request->get('q'); |
|
224 | 224 | |
225 | 225 | return new JsonResponse(Select2::flagSearch($page, $query)); |
226 | 226 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function select2Individual(Request $request, Tree $tree): JsonResponse |
235 | 235 | { |
236 | - $page = (int)$request->get('page'); |
|
236 | + $page = (int) $request->get('page'); |
|
237 | 237 | $query = $request->get('q'); |
238 | 238 | |
239 | 239 | return new JsonResponse(Select2::individualSearch($tree, $page, $query)); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function select2MediaObject(Request $request, Tree $tree): JsonResponse |
249 | 249 | { |
250 | - $page = (int)$request->get('page'); |
|
250 | + $page = (int) $request->get('page'); |
|
251 | 251 | $query = $request->get('q'); |
252 | 252 | |
253 | 253 | return new JsonResponse(Select2::mediaObjectSearch($tree, $page, $query)); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function select2Note(Request $request, Tree $tree): JsonResponse |
263 | 263 | { |
264 | - $page = (int)$request->get('page'); |
|
264 | + $page = (int) $request->get('page'); |
|
265 | 265 | $query = $request->get('q'); |
266 | 266 | |
267 | 267 | return new JsonResponse(Select2::noteSearch($tree, $page, $query)); |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | */ |
276 | 276 | public function select2Place(Request $request, Tree $tree): JsonResponse |
277 | 277 | { |
278 | - $page = (int)$request->get('page'); |
|
278 | + $page = (int) $request->get('page'); |
|
279 | 279 | $query = $request->get('q'); |
280 | 280 | |
281 | 281 | return new JsonResponse(Select2::placeSearch($tree, $page, $query, true)); |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | */ |
290 | 290 | public function select2Repository(Request $request, Tree $tree): JsonResponse |
291 | 291 | { |
292 | - $page = (int)$request->get('page'); |
|
292 | + $page = (int) $request->get('page'); |
|
293 | 293 | $query = $request->get('q'); |
294 | 294 | |
295 | 295 | return new JsonResponse(Select2::repositorySearch($tree, $page, $query)); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | */ |
304 | 304 | public function select2Source(Request $request, Tree $tree): JsonResponse |
305 | 305 | { |
306 | - $page = (int)$request->get('page'); |
|
306 | + $page = (int) $request->get('page'); |
|
307 | 307 | $query = $request->get('q'); |
308 | 308 | |
309 | 309 | return new JsonResponse(Select2::sourceSearch($tree, $page, $query)); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | */ |
318 | 318 | public function select2Submitter(Request $request, Tree $tree): JsonResponse |
319 | 319 | { |
320 | - $page = (int)$request->get('page'); |
|
320 | + $page = (int) $request->get('page'); |
|
321 | 321 | $query = $request->get('q'); |
322 | 322 | |
323 | 323 | return new JsonResponse(Select2::submitterSearch($tree, $page, $query)); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $url = $request->get('url', ''); |
100 | 100 | $xref = $request->get('xref', ''); |
101 | - $change_id = (int)$request->get('change_id'); |
|
101 | + $change_id = (int) $request->get('change_id'); |
|
102 | 102 | |
103 | 103 | $changes = Database::prepare( |
104 | 104 | "SELECT change_id, xref, old_gedcom, new_gedcom" . |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | $url = $request->get('url', ''); |
206 | 206 | $xref = $request->get('xref', ''); |
207 | - $change_id = (int)$request->get('change_id'); |
|
207 | + $change_id = (int) $request->get('change_id'); |
|
208 | 208 | |
209 | 209 | // Reject a change, and subsequent changes to the same record |
210 | 210 | Database::prepare( |