| @@ -342,9 +342,11 @@ | ||
| 342 | 342 | 'fqpn', | 
| 343 | 343 | ]; | 
| 344 | 344 | |
| 345 | -        if ($serverfile !== '') {  // first choice is file on server | |
| 345 | +        if ($serverfile !== '') { | |
| 346 | +// first choice is file on server | |
| 346 | 347 | $filename = WT_DATA_DIR . 'places/' . $serverfile; | 
| 347 | -        } elseif ($_FILES['localfile']['error'] === UPLOAD_ERR_OK) { // 2nd choice is local file | |
| 348 | +        } elseif ($_FILES['localfile']['error'] === UPLOAD_ERR_OK) { | |
| 349 | +// 2nd choice is local file | |
| 348 | 350 | $filename = $_FILES['localfile']['tmp_name']; | 
| 349 | 351 | } | 
| 350 | 352 | |
| @@ -494,7 +494,7 @@ | ||
| 494 | 494 | // ... and process the differences | 
| 495 | 495 | $inserted = 0; | 
| 496 | 496 |          if (!empty($diff)) { | 
| 497 | -            $nextRecordId    = 1 + (int) DB::table('placelocation')->max('pl_id'); | |
| 497 | +            $nextRecordId = 1 + (int) DB::table('placelocation')->max('pl_id'); | |
| 498 | 498 | |
| 499 | 499 |              foreach ($diff as $place) { | 
| 500 | 500 | // For Westminster, London, England, we must also create England and London, England | 
| @@ -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( | 
| @@ -74,7 +74,7 @@ | ||
| 74 | 74 | } | 
| 75 | 75 | |
| 76 | 76 |          if (preg_match('/^(\d+) B\.C\.$/', $year, $match)) { | 
| 77 | - return - (int) $match[1]; | |
| 77 | + return -(int) $match[1]; | |
| 78 | 78 | } | 
| 79 | 79 | |
| 80 | 80 | return (int) $year; | 
| @@ -162,7 +162,7 @@ discard block | ||
| 162 | 162 | // Ambiguous dates - don't override calendar escape | 
| 163 | 163 |          if ($cal == '') { | 
| 164 | 164 |              if (preg_match('/^(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)$/', $m)) { | 
| 165 | - $cal = GregorianDate::ESCAPE; | |
| 165 | + $cal = GregorianDate::ESCAPE; | |
| 166 | 166 |              } else { | 
| 167 | 167 |                  if (preg_match('/^[345]\d\d\d$/', $y)) { | 
| 168 | 168 | // Year 3000-5999 | 
| @@ -460,7 +460,7 @@ discard block | ||
| 460 | 460 | public function addYears(int $years, string $qualifier = ''): Date | 
| 461 | 461 |      { | 
| 462 | 462 | $tmp = clone $this; | 
| 463 | - $tmp->date1->year += $years; | |
| 463 | + $tmp->date1->year += $years; | |
| 464 | 464 | $tmp->date1->month = 0; | 
| 465 | 465 | $tmp->date1->day = 0; | 
| 466 | 466 | $tmp->date1->setJdFromYmd(); | 
| @@ -320,7 +320,7 @@ discard block | ||
| 320 | 320 | return $new_path; | 
| 321 | 321 | } | 
| 322 | 322 | |
| 323 | - $paths[] = $new_path; | |
| 323 | + $paths[] = $new_path; | |
| 324 | 324 | $visited[$spouse->xref()] = true; | 
| 325 | 325 | } | 
| 326 | 326 | } | 
| @@ -334,7 +334,7 @@ discard block | ||
| 334 | 334 | return $new_path; | 
| 335 | 335 | } | 
| 336 | 336 | |
| 337 | - $paths[] = $new_path; | |
| 337 | + $paths[] = $new_path; | |
| 338 | 338 | $visited[$child->xref()] = true; | 
| 339 | 339 | } | 
| 340 | 340 | } | 
| @@ -353,7 +353,7 @@ discard block | ||
| 353 | 353 | return $new_path; | 
| 354 | 354 | } | 
| 355 | 355 | |
| 356 | - $paths[] = $new_path; | |
| 356 | + $paths[] = $new_path; | |
| 357 | 357 | $visited[$spouse->xref()] = true; | 
| 358 | 358 | } | 
| 359 | 359 | } | 
| @@ -367,7 +367,7 @@ discard block | ||
| 367 | 367 | return $new_path; | 
| 368 | 368 | } | 
| 369 | 369 | |
| 370 | - $paths[] = $new_path; | |
| 370 | + $paths[] = $new_path; | |
| 371 | 371 | $visited[$child->xref()] = true; | 
| 372 | 372 | } | 
| 373 | 373 | } | 
| @@ -121,7 +121,7 @@ | ||
| 121 | 121 | |
| 122 | 122 | // If we are only showing living individuals, then we don't need to search for DEAT events. | 
| 123 | 123 |          if ($filter) { | 
| 124 | - $event_array = array_diff($event_array, Gedcom::DEATH_EVENTS); | |
| 124 | + $event_array = array_diff($event_array, Gedcom::DEATH_EVENTS); | |
| 125 | 125 | } | 
| 126 | 126 | |
| 127 | 127 |          $events_filter = implode('|', $event_array); | 
| @@ -52,7 +52,7 @@ | ||
| 52 | 52 | } | 
| 53 | 53 | |
| 54 | 54 | // Did we emigrate or naturalise? | 
| 55 | -        foreach ($individual->facts(['IMMI' ,'EMIG', 'NATU'], true) as $fact) { | |
| 55 | +        foreach ($individual->facts(['IMMI', 'EMIG', 'NATU'], true) as $fact) { | |
| 56 | 56 |              if (Date::compare($fact->date(), $this->date()) <= 0) { | 
| 57 | 57 | $place = $fact->place()->getGedcomName(); | 
| 58 | 58 | } | 
| @@ -121,7 +121,7 @@ | ||
| 121 | 121 | |
| 122 | 122 | // If we are only showing living individuals, then we don't need to search for DEAT events. | 
| 123 | 123 |          if ($filter) { | 
| 124 | - $event_array = array_diff($event_array, Gedcom::DEATH_EVENTS); | |
| 124 | + $event_array = array_diff($event_array, Gedcom::DEATH_EVENTS); | |
| 125 | 125 | } | 
| 126 | 126 | |
| 127 | 127 |          $events_filter = implode('|', $event_array); | 
| @@ -76,7 +76,7 @@ | ||
| 76 | 76 |      { | 
| 77 | 77 | $latest_version = $this->fetchLatestVersion(); | 
| 78 | 78 | |
| 79 | -        [, , $url] = explode('|', $latest_version . '||'); | |
| 79 | +        [,, $url] = explode('|', $latest_version . '||'); | |
| 80 | 80 | |
| 81 | 81 | return $url; | 
| 82 | 82 | } |