summaryrefslogtreecommitdiff
path: root/classes/timehelper.php
diff options
context:
space:
mode:
authorwn_ <[email protected]>2021-11-11 20:12:47 +0000
committerwn_ <[email protected]>2021-11-11 20:12:47 +0000
commitf704d25ab15c5ffd988403d36b90fe76fb72916e (patch)
treee007f1d105cabf60f9093fc84e3ec71121c51c53 /classes/timehelper.php
parent03495c11ed69f6311e9c7596cc53c5b15ce82bf6 (diff)
Address PHPStan warnings in 'classes/timehelper.php'.
Diffstat (limited to 'classes/timehelper.php')
-rw-r--r--classes/timehelper.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/classes/timehelper.php b/classes/timehelper.php
index 4317f343f..e66f82f90 100644
--- a/classes/timehelper.php
+++ b/classes/timehelper.php
@@ -1,7 +1,7 @@
<?php
class TimeHelper {
- static function smart_date_time($timestamp, $tz_offset = 0, $owner_uid = false, $eta_min = false) {
+ 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,8 +21,8 @@ class TimeHelper {
}
}
- static function make_local_datetime($timestamp, $long, $owner_uid = false,
- $no_smart_dt = false, $eta_min = false) {
+ 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'];
if (!$timestamp) $timestamp = '1970-01-01 0:00';
@@ -67,7 +67,7 @@ class TimeHelper {
}
}
- static function convert_timestamp($timestamp, $source_tz, $dest_tz) {
+ static function convert_timestamp(int $timestamp, string $source_tz, string $dest_tz): int {
try {
$source_tz = new DateTimeZone($source_tz);