From 385b3f4adf86606e03941171c136d8f2eb2b35c2 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Fri, 24 Apr 2020 16:36:12 +0200 Subject: fix: most of PHPStan errors --- app/class/Event.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'app/class/Event.php') diff --git a/app/class/Event.php b/app/class/Event.php index 3317a1b..069050a 100644 --- a/app/class/Event.php +++ b/app/class/Event.php @@ -40,7 +40,7 @@ class Event extends Dbitem public function stamp() { - $this->date = new DateTimeImmutable(null, timezone_open("Europe/Paris")); + $this->date = new DateTimeImmutable("now", timezone_open("Europe/Paris")); $this->user = idclean($this->user); if (in_array($this->type, self::EVENT_ART)) { $this->target = idclean($this->target); @@ -66,16 +66,13 @@ class Event extends Dbitem switch ($type) { case 'datetime': return $this->date; - break; case 'string': return $this->date->format(DateTime::ISO8601); - break; case 'hrdi': - $now = new DateTimeImmutable(null, timezone_open("Europe/Paris")); + $now = new DateTimeImmutable("now", timezone_open("Europe/Paris")); return hrdi($this->date->diff($now)); - break; } } -- cgit v1.2.3