@@ -172,7 +172,7 @@ |
||
172 | 172 | * @return boolean Whether the info was successfully written |
173 | 173 | */ |
174 | 174 | #[\ReturnTypeWillChange] |
175 | - public function write(/*PHP 8.0 string*/$id,/*PHP 8.0 string */ $data): bool |
|
175 | + public function write(/*PHP 8.0 string*/$id, /*PHP 8.0 string */ $data): bool |
|
176 | 176 | { |
177 | 177 | global $smcFunc; |
178 | 178 |
@@ -56,7 +56,9 @@ |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | // This should never be needed, but set it for completeness. |
59 | -$smcFunc['db_insert'] = function($method, $table, $columns, $data, $keys, $returnmode = 0, $connection = null) {}; |
|
59 | +$smcFunc['db_insert'] = function($method, $table, $columns, $data, $keys, $returnmode = 0, $connection = null) |
|
60 | +{ |
|
61 | +}; |
|
60 | 62 | |
61 | 63 | // 3. Do the job. |
62 | 64 | require_once($sourcedir . '/Subs.php'); |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | else |
454 | 454 | { |
455 | 455 | // First, parse the existing code into usable chunks. |
456 | - $search_for = str_replace('array\(', 'array(\((?'.'>[^()]|(?1))*\)),', $search_for); |
|
456 | + $search_for = str_replace('array\(', 'array(\((?' . '>[^()]|(?1))*\)),', $search_for); |
|
457 | 457 | |
458 | 458 | preg_match('~' . $search_for . '~', $file_contents, $matches); |
459 | 459 | |
@@ -463,14 +463,14 @@ discard block |
||
463 | 463 | $existing_code = $matches[0]; |
464 | 464 | $existing_inner = $matches[1]; |
465 | 465 | |
466 | - preg_match_all('~(?:\h*//[^\n]*\n)*\h*array(\((?'.'>[^()]|(?1))*\)),~', $existing_inner, $matches); |
|
466 | + preg_match_all('~(?:\h*//[^\n]*\n)*\h*array(\((?' . '>[^()]|(?1))*\)),~', $existing_inner, $matches); |
|
467 | 467 | $existing_entries = $matches[0]; |
468 | 468 | |
469 | 469 | // Now do the same with the generated code. |
470 | 470 | preg_match('~' . $search_for . '~', $code, $matches); |
471 | 471 | $new_inner = $matches[1]; |
472 | 472 | |
473 | - preg_match_all('~(?:\h*//[^\n]*\n)*\h*array(\((?'.'>[^()]|(?1))*\)),~', $new_inner, $matches); |
|
473 | + preg_match_all('~(?:\h*//[^\n]*\n)*\h*array(\((?' . '>[^()]|(?1))*\)),~', $new_inner, $matches); |
|
474 | 474 | $new_entries = $matches[0]; |
475 | 475 | |
476 | 476 | // This is what we will ultimately save. |
@@ -1407,7 +1407,7 @@ discard block |
||
1407 | 1407 | // Filter out the canonical tzid. |
1408 | 1408 | $shared_options = array_filter( |
1409 | 1409 | $shared_options, |
1410 | - function ($tzid) use ($option) |
|
1410 | + function($tzid) use ($option) |
|
1411 | 1411 | { |
1412 | 1412 | return $tzid !== $this->zones[$option]['canonical']; |
1413 | 1413 | } |
@@ -2230,7 +2230,7 @@ discard block |
||
2230 | 2230 | // A human should still check our suggestion, though. |
2231 | 2231 | uasort( |
2232 | 2232 | $possible_fallback_zones, |
2233 | - function ($a, $b) use ($new_zone) |
|
2233 | + function($a, $b) use ($new_zone) |
|
2234 | 2234 | { |
2235 | 2235 | $cc = $new_zone['country_code']; |
2236 | 2236 | |
@@ -2533,7 +2533,7 @@ discard block |
||
2533 | 2533 | { |
2534 | 2534 | $date_string = preg_replace_callback( |
2535 | 2535 | "/(\d{4})\h+($month)\h+($weekday)<=(\d+)/", |
2536 | - function ($matches) |
|
2536 | + function($matches) |
|
2537 | 2537 | { |
2538 | 2538 | $d = new \DateTime($matches[2] . ' ' . $matches[4] . ' ' . $matches[1]); |
2539 | 2539 | $d->add(new \DateInterval('P1D')); |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | |
370 | 370 | if (preg_match('~\n\h+\K\'' . $new_tzid . '\'(?=\s+=>\s+\'\w+\',)~', $file_contents)) |
371 | 371 | { |
372 | - echo "Renamed $old_tzid to $new_tzid in get_tzid_metazones().\n\n"; |
|
372 | + echo "renamed $old_tzid to $new_tzid in get_tzid_metazones().\n\n"; |
|
373 | 373 | |
374 | 374 | $this->files_updated = true; |
375 | 375 | } |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | |
383 | 383 | if (preg_match('~\n\h+\K\'' . $new_tzid . '\'(?=,\n)~', $file_contents)) |
384 | 384 | { |
385 | - echo "Renamed $old_tzid to $new_tzid in get_sorted_tzids_for_country().\n\n"; |
|
385 | + echo "renamed $old_tzid to $new_tzid in get_sorted_tzids_for_country().\n\n"; |
|
386 | 386 | |
387 | 387 | $this->files_updated = true; |
388 | 388 | } |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | |
425 | 425 | if (preg_match('~\n\h+\K\'' . $tzid . '\'(?=,\n)~', $file_contents)) |
426 | 426 | { |
427 | - echo "Added $tzid to $cc in get_sorted_tzids_for_country().\n\n"; |
|
427 | + echo "added $tzid to $cc in get_sorted_tzids_for_country().\n\n"; |
|
428 | 428 | |
429 | 429 | $this->files_updated = true; |
430 | 430 | } |