Skip to content

Commit f69a39b

Browse files
authored
Merge pull request #8337 from kenjis/docs-Time-properties
docs: add @Property to Time
2 parents 521cc98 + c39961a commit f69a39b

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

system/I18n/Time.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,23 @@
1919
*
2020
* Requires the intl PHP extension.
2121
*
22-
* @property string $date
22+
* @property int $age read-only
23+
* @property string $day read-only
24+
* @property string $dayOfWeek read-only
25+
* @property string $dayOfYear read-only
26+
* @property bool $dst read-only
27+
* @property string $hour read-only
28+
* @property bool $local read-only
29+
* @property string $minute read-only
30+
* @property string $month read-only
31+
* @property string $quarter read-only
32+
* @property string $second read-only
33+
* @property int $timestamp read-only
34+
* @property bool $utc read-only
35+
* @property string $weekOfMonth read-only
36+
* @property string $weekOfYear read-only
37+
* @property string $year read-only
38+
*
2339
* @see \CodeIgniter\I18n\TimeTest
2440
*/
2541
class Time extends DateTimeImmutable

system/I18n/TimeLegacy.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,22 @@
2020
* This is not immutable! Some methods are immutable,
2121
* but some methods can alter the state.
2222
*
23-
* @property string $date
23+
* @property int $age read-only
24+
* @property string $day read-only
25+
* @property string $dayOfWeek read-only
26+
* @property string $dayOfYear read-only
27+
* @property bool $dst read-only
28+
* @property string $hour read-only
29+
* @property bool $local read-only
30+
* @property string $minute read-only
31+
* @property string $month read-only
32+
* @property string $quarter read-only
33+
* @property string $second read-only
34+
* @property int $timestamp read-only
35+
* @property bool $utc read-only
36+
* @property string $weekOfMonth read-only
37+
* @property string $weekOfYear read-only
38+
* @property string $year read-only
2439
*
2540
* @deprecated Use Time instead.
2641
* @see \CodeIgniter\I18n\TimeLegacyTest

system/I18n/TimeTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,8 @@ public function __wakeup(): void
11821182
$timezone = $this->timezone;
11831183

11841184
$this->timezone = new DateTimeZone($timezone);
1185+
1186+
// @phpstan-ignore-next-line `$this->date` is a special property for PHP internal use.
11851187
parent::__construct($this->date, $this->timezone);
11861188
}
11871189
}

0 commit comments

Comments
 (0)