1<?php
2
3/** @generate-class-entries */
4
5/** @not-serializable */
6class IntlDateFormatter
7{
8    /**
9     * @var int
10     * @cvalue UDAT_FULL
11     */
12    public const FULL = UNKNOWN;
13    /**
14     * @var int
15     * @cvalue UDAT_LONG
16     */
17    public const LONG = UNKNOWN;
18    /**
19     * @var int
20     * @cvalue UDAT_MEDIUM
21     */
22    public const MEDIUM = UNKNOWN;
23    /**
24     * @var int
25     * @cvalue UDAT_SHORT
26     */
27    public const SHORT = UNKNOWN;
28    /**
29     * @var int
30     * @cvalue UDAT_NONE
31     */
32    public const NONE = UNKNOWN;
33    /**
34     * @var int
35     * @cvalue UDAT_FULL_RELATIVE
36     */
37    public const RELATIVE_FULL = UNKNOWN;
38    /**
39     * @var int
40     * @cvalue UDAT_LONG_RELATIVE
41     */
42    public const RELATIVE_LONG = UNKNOWN;
43    /**
44     * @var int
45     * @cvalue UDAT_MEDIUM_RELATIVE
46     */
47    public const RELATIVE_MEDIUM = UNKNOWN;
48    /**
49     * @var int
50     * @cvalue UDAT_SHORT_RELATIVE
51     */
52    public const RELATIVE_SHORT = UNKNOWN;
53
54    /**
55     * @var int
56     * @cvalue UCAL_GREGORIAN
57     */
58    public const GREGORIAN = UNKNOWN;
59    /**
60     * @var int
61     * @cvalue UCAL_TRADITIONAL
62     */
63    public const TRADITIONAL = UNKNOWN;
64
65    /**
66     * @param IntlTimeZone|DateTimeZone|string|null $timezone
67     * @param IntlCalendar|int|null $calendar
68     */
69    public function __construct(
70        ?string $locale,
71        int $dateType = IntlDateFormatter::FULL,
72        int $timeType = IntlDateFormatter::FULL,
73        $timezone = null,
74        $calendar = null,
75        ?string $pattern = null
76    ) {}
77
78    /**
79     * @param IntlTimeZone|DateTimeZone|string|null $timezone
80     * @tentative-return-type
81     * @alias datefmt_create
82     */
83    public static function create(
84        ?string $locale,
85        int $dateType = IntlDateFormatter::FULL,
86        int $timeType = IntlDateFormatter::FULL,
87        $timezone = null,
88        IntlCalendar|int|null $calendar = null,
89        ?string $pattern = null
90    ): ?IntlDateFormatter {}
91
92    /**
93     * @tentative-return-type
94     * @alias datefmt_get_datetype
95     */
96    public function getDateType(): int|false {}
97
98    /**
99     * @tentative-return-type
100     * @alias datefmt_get_timetype
101     */
102    public function getTimeType(): int|false {}
103
104    /**
105     * @tentative-return-type
106     * @alias datefmt_get_calendar
107     */
108    public function getCalendar(): int|false {}
109
110    /**
111     * @tentative-return-type
112     * @alias datefmt_set_calendar
113     */
114    public function setCalendar(IntlCalendar|int|null $calendar): bool {}
115
116    /**
117     * @tentative-return-type
118     * @alias datefmt_get_timezone_id
119     */
120    public function getTimeZoneId(): string|false {}
121
122    /**
123     * @tentative-return-type
124     * @alias datefmt_get_calendar_object
125     */
126    public function getCalendarObject(): IntlCalendar|false|null {}
127
128    /**
129     * @tentative-return-type
130     * @alias datefmt_get_timezone
131     */
132    public function getTimeZone(): IntlTimeZone|false {}
133
134    /**
135     * @param IntlTimeZone|DateTimeZone|string|null $timezone
136     * @tentative-return-type
137     * @alias datefmt_set_timezone
138     */
139    public function setTimeZone($timezone): ?bool {} // TODO return true on success
140
141    /**
142     * @tentative-return-type
143     * @alias datefmt_set_pattern
144     */
145    public function setPattern(string $pattern): bool {}
146
147    /**
148     * @tentative-return-type
149     * @alias datefmt_get_pattern
150     */
151    public function getPattern(): string|false {}
152
153    /**
154     * @tentative-return-type
155     * @alias datefmt_get_locale
156     */
157    public function getLocale(int $type = ULOC_ACTUAL_LOCALE): string|false {}
158
159    /**
160     * @tentative-return-type
161     * @alias datefmt_set_lenient
162     */
163    public function setLenient(bool $lenient): void {}
164
165    /**
166     * @tentative-return-type
167     * @alias datefmt_is_lenient
168     */
169    public function isLenient(): bool {}
170
171    /**
172     * @param IntlCalendar|DateTimeInterface|array|string|int|float $datetime
173     * @tentative-return-type
174     * @alias datefmt_format
175     */
176    public function format($datetime): string|false {}
177
178    /**
179     * @param IntlCalendar|DateTimeInterface $datetime
180     * @param array|int|string|null $format
181     * @tentative-return-type
182     * @alias datefmt_format_object
183     */
184    public static function formatObject($datetime, $format = null, ?string $locale = null): string|false {}
185
186    /**
187     * @param int $offset
188     * @tentative-return-type
189     * @alias datefmt_parse
190     */
191    public function parse(string $string, &$offset = null): int|float|false {}
192
193    /**
194     * @param int $offset
195     * @return array<string, int>|false
196     * @tentative-return-type
197     * @alias datefmt_localtime
198     */
199    public function localtime(string $string, &$offset = null): array|false {}
200
201    /**
202     * @tentative-return-type
203     * @alias datefmt_get_error_code
204     */
205    public function getErrorCode(): int {}
206
207    /**
208     * @tentative-return-type
209     * @alias datefmt_get_error_message
210     */
211    public function getErrorMessage(): string {}
212}
213