diff --git a/system/I18n/Time.php b/system/I18n/Time.php index 520f38eb90d1..f01718aac6e0 100644 --- a/system/I18n/Time.php +++ b/system/I18n/Time.php @@ -19,7 +19,23 @@ * * Requires the intl PHP extension. * - * @property string $date + * @property int $age read-only + * @property string $day read-only + * @property string $dayOfWeek read-only + * @property string $dayOfYear read-only + * @property bool $dst read-only + * @property string $hour read-only + * @property bool $local read-only + * @property string $minute read-only + * @property string $month read-only + * @property string $quarter read-only + * @property string $second read-only + * @property int $timestamp read-only + * @property bool $utc read-only + * @property string $weekOfMonth read-only + * @property string $weekOfYear read-only + * @property string $year read-only + * * @see \CodeIgniter\I18n\TimeTest */ class Time extends DateTimeImmutable diff --git a/system/I18n/TimeLegacy.php b/system/I18n/TimeLegacy.php index 7be9f80fac20..35523e322475 100644 --- a/system/I18n/TimeLegacy.php +++ b/system/I18n/TimeLegacy.php @@ -20,7 +20,22 @@ * This is not immutable! Some methods are immutable, * but some methods can alter the state. * - * @property string $date + * @property int $age read-only + * @property string $day read-only + * @property string $dayOfWeek read-only + * @property string $dayOfYear read-only + * @property bool $dst read-only + * @property string $hour read-only + * @property bool $local read-only + * @property string $minute read-only + * @property string $month read-only + * @property string $quarter read-only + * @property string $second read-only + * @property int $timestamp read-only + * @property bool $utc read-only + * @property string $weekOfMonth read-only + * @property string $weekOfYear read-only + * @property string $year read-only * * @deprecated Use Time instead. * @see \CodeIgniter\I18n\TimeLegacyTest diff --git a/system/I18n/TimeTrait.php b/system/I18n/TimeTrait.php index 7f2068b7a30c..da2bf046517b 100644 --- a/system/I18n/TimeTrait.php +++ b/system/I18n/TimeTrait.php @@ -1182,6 +1182,8 @@ public function __wakeup(): void $timezone = $this->timezone; $this->timezone = new DateTimeZone($timezone); + + // @phpstan-ignore-next-line `$this->date` is a special property for PHP internal use. parent::__construct($this->date, $this->timezone); } }