diff options
author | n-peugnet <n.peugnet@free.fr> | 2020-04-24 16:36:12 +0200 |
---|---|---|
committer | Vincent Peugnet <33429034+vincent-peugnet@users.noreply.github.com> | 2020-04-25 17:44:38 +0200 |
commit | 385b3f4adf86606e03941171c136d8f2eb2b35c2 (patch) | |
tree | 2231cf04d67a5cae7284364ac5552a321b9a236e /app/class/Item.php | |
parent | 03d425bdd9a639446ae72ce6556d753f2f162f83 (diff) | |
download | wcms-385b3f4adf86606e03941171c136d8f2eb2b35c2.tar.gz wcms-385b3f4adf86606e03941171c136d8f2eb2b35c2.zip |
fix: most of PHPStan errors
Diffstat (limited to 'app/class/Item.php')
-rw-r--r-- | app/class/Item.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/class/Item.php b/app/class/Item.php index 8a8f2d6..a76e700 100644 --- a/app/class/Item.php +++ b/app/class/Item.php @@ -33,7 +33,7 @@ abstract class Item public function dry() { $array = []; - foreach ($this as $var => $value) { + foreach (get_object_vars($this) as $var => $value) { $array[$var] = $this->$var(); } return $array; @@ -74,13 +74,13 @@ abstract class Item } elseif ($option == 'date' || $option == 'sort') { return $this->$property; } elseif ($option == 'hrdi') { - $now = new DateTimeImmutable(null, timezone_open("Europe/Paris")); + $now = new DateTimeImmutable("now", timezone_open("Europe/Paris")); return hrdi($this->$property->diff($now)); } elseif ($option == 'pdate') { return $this->$property->format('Y-m-d'); } elseif ($option == 'ptime') { return $this->$property->format('H:i'); - } elseif ($option = 'dmy') { + } elseif ($option == 'dmy') { return $this->$property->format('d/m/Y'); } } else { |