1<?php
2
3/** @generate-class-entries */
4
5class IntlDateFormatter
6{
7    /**
8     * @param IntlTimeZone|DateTimeZone|string|null $timezone
9     * @param IntlCalendar|int|null $calendar
10     */
11    public function __construct(
12        ?string $locale,
13        int $dateType = IntlDateFormatter::FULL,
14        int $timeType = IntlDateFormatter::FULL,
15        $timezone = null,
16        $calendar = null,
17        ?string $pattern = null
18    ) {}
19
20    /**
21     * @param IntlTimeZone|DateTimeZone|string|null $timezone
22     * @tentative-return-type
23     * @alias datefmt_create
24     */
25    public static function create(
26        ?string $locale,
27        int $dateType = IntlDateFormatter::FULL,
28        int $timeType = IntlDateFormatter::FULL,
29        $timezone = null,
30        IntlCalendar|int|null $calendar = null,
31        ?string $pattern = null
32    ): ?IntlDateFormatter {}
33
34    /**
35     * @tentative-return-type
36     * @alias datefmt_get_datetype
37     */
38    public function getDateType(): int|false {}
39
40    /**
41     * @tentative-return-type
42     * @alias datefmt_get_timetype
43     */
44    public function getTimeType(): int|false {}
45
46    /**
47     * @tentative-return-type
48     * @alias datefmt_get_calendar
49     */
50    public function getCalendar(): int|false {}
51
52    /**
53     * @tentative-return-type
54     * @alias datefmt_set_calendar
55     */
56    public function setCalendar(IntlCalendar|int|null $calendar): bool {}
57
58    /**
59     * @tentative-return-type
60     * @alias datefmt_get_timezone_id
61     */
62    public function getTimeZoneId(): string|false {}
63
64    /**
65     * @tentative-return-type
66     * @alias datefmt_get_calendar_object
67     */
68    public function getCalendarObject(): IntlCalendar|false|null {}
69
70    /**
71     * @tentative-return-type
72     * @alias datefmt_get_timezone
73     */
74    public function getTimeZone(): IntlTimeZone|false {}
75
76    /**
77     * @param IntlTimeZone|DateTimeZone|string|null $timezone
78     * @tentative-return-type
79     * @alias datefmt_set_timezone
80     */
81    public function setTimeZone($timezone): ?bool {} // TODO return true on success
82
83    /**
84     * @tentative-return-type
85     * @alias datefmt_set_pattern
86     */
87    public function setPattern(string $pattern): bool {}
88
89    /**
90     * @tentative-return-type
91     * @alias datefmt_get_pattern
92     */
93    public function getPattern(): string|false {}
94
95    /**
96     * @tentative-return-type
97     * @alias datefmt_get_locale
98     */
99    public function getLocale(int $type = ULOC_ACTUAL_LOCALE): string|false {}
100
101    /**
102     * @tentative-return-type
103     * @alias datefmt_set_lenient
104     */
105    public function setLenient(bool $lenient): void {}
106
107    /**
108     * @tentative-return-type
109     * @alias datefmt_is_lenient
110     */
111    public function isLenient(): bool {}
112
113    /**
114     * @param IntlCalendar|DateTimeInterface|array|string|int|float $datetime
115     * @tentative-return-type
116     * @alias datefmt_format
117     */
118    public function format($datetime): string|false {}
119
120    /**
121     * @param IntlCalendar|DateTimeInterface $datetime
122     * @param array|int|string|null $format
123     * @tentative-return-type
124     * @alias datefmt_format_object
125     */
126    public static function formatObject($datetime, $format = null, ?string $locale = null): string|false {}
127
128    /**
129     * @param int $offset
130     * @tentative-return-type
131     * @alias datefmt_parse
132     */
133    public function parse(string $string, &$offset = null): int|float|false {}
134
135    /**
136     * @param int $offset
137     * @return array<string, int>|false
138     * @tentative-return-type
139     * @alias datefmt_localtime
140     */
141    public function localtime(string $string, &$offset = null): array|false {}
142
143    /**
144     * @tentative-return-type
145     * @alias datefmt_get_error_code
146     */
147    public function getErrorCode(): int {}
148
149    /**
150     * @tentative-return-type
151     * @alias datefmt_get_error_message
152     */
153    public function getErrorMessage(): string {}
154}
155