Make implicit nullable parameters explicitly nullable.

This is to address a deprecation planned for PHP 8.4.

https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
This commit is contained in:
wn_
2024-03-26 16:38:05 +00:00
parent fea3089bde
commit de00a09538
9 changed files with 26 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
<?php
class TimeHelper {
static function smart_date_time(int $timestamp, int $tz_offset = 0, int $owner_uid = null, bool $eta_min = false): string {
static function smart_date_time(int $timestamp, int $tz_offset = 0, ?int $owner_uid = null, bool $eta_min = false): string {
if (!$owner_uid) $owner_uid = $_SESSION['uid'];
if ($eta_min && time() + $tz_offset - $timestamp < 3600) {
@@ -21,7 +21,7 @@ class TimeHelper {
}
}
static function make_local_datetime(?string $timestamp, bool $long, int $owner_uid = null,
static function make_local_datetime(?string $timestamp, bool $long, ?int $owner_uid = null,
bool $no_smart_dt = false, bool $eta_min = false): string {
if (!$owner_uid) $owner_uid = $_SESSION['uid'];