xref: /php-src/ext/intl/calendar/calendar.stub.php (revision b06c95b6)
1<?php
2
3/** @generate-class-entries */
4
5/** @not-serializable */
6class IntlCalendar
7{
8    /** @cvalue UCAL_ERA */
9    public const int FIELD_ERA = UNKNOWN;
10    /** @cvalue UCAL_YEAR */
11    public const int FIELD_YEAR = UNKNOWN;
12    /** @cvalue UCAL_MONTH */
13    public const int FIELD_MONTH = UNKNOWN;
14    /** @cvalue UCAL_WEEK_OF_YEAR */
15    public const int FIELD_WEEK_OF_YEAR = UNKNOWN;
16    /** @cvalue UCAL_WEEK_OF_MONTH */
17    public const int FIELD_WEEK_OF_MONTH = UNKNOWN;
18    /** @cvalue UCAL_DATE */
19    public const int FIELD_DATE = UNKNOWN;
20    /** @cvalue UCAL_DAY_OF_YEAR */
21    public const int FIELD_DAY_OF_YEAR = UNKNOWN;
22    /** @cvalue UCAL_DAY_OF_WEEK */
23    public const int FIELD_DAY_OF_WEEK = UNKNOWN;
24    /** @cvalue UCAL_DAY_OF_WEEK_IN_MONTH */
25    public const int FIELD_DAY_OF_WEEK_IN_MONTH = UNKNOWN;
26    /** @cvalue UCAL_AM_PM */
27    public const int FIELD_AM_PM = UNKNOWN;
28    /** @cvalue UCAL_HOUR */
29    public const int FIELD_HOUR = UNKNOWN;
30    /** @cvalue UCAL_HOUR_OF_DAY */
31    public const int FIELD_HOUR_OF_DAY = UNKNOWN;
32    /** @cvalue UCAL_MINUTE */
33    public const int FIELD_MINUTE = UNKNOWN;
34    /** @cvalue UCAL_SECOND */
35    public const int FIELD_SECOND = UNKNOWN;
36    /** @cvalue UCAL_MILLISECOND */
37    public const int FIELD_MILLISECOND = UNKNOWN;
38    /** @cvalue UCAL_ZONE_OFFSET */
39    public const int FIELD_ZONE_OFFSET = UNKNOWN;
40    /** @cvalue UCAL_DST_OFFSET */
41    public const int FIELD_DST_OFFSET = UNKNOWN;
42    /** @cvalue UCAL_YEAR_WOY */
43    public const int FIELD_YEAR_WOY = UNKNOWN;
44    /** @cvalue UCAL_DOW_LOCAL */
45    public const int FIELD_DOW_LOCAL = UNKNOWN;
46    /** @cvalue UCAL_EXTENDED_YEAR */
47    public const int FIELD_EXTENDED_YEAR = UNKNOWN;
48    /** @cvalue UCAL_JULIAN_DAY */
49    public const int FIELD_JULIAN_DAY = UNKNOWN;
50    /** @cvalue UCAL_MILLISECONDS_IN_DAY */
51    public const int FIELD_MILLISECONDS_IN_DAY = UNKNOWN;
52    /** @cvalue UCAL_IS_LEAP_MONTH */
53    public const int FIELD_IS_LEAP_MONTH = UNKNOWN;
54    /** @cvalue UCAL_FIELD_COUNT */
55    public const int FIELD_FIELD_COUNT = UNKNOWN;
56    /** @cvalue UCAL_DAY_OF_MONTH */
57    public const int FIELD_DAY_OF_MONTH = UNKNOWN;
58
59    /** @cvalue UCAL_SUNDAY */
60    public const int DOW_SUNDAY = UNKNOWN;
61    /** @cvalue UCAL_MONDAY */
62    public const int DOW_MONDAY = UNKNOWN;
63    /** @cvalue UCAL_TUESDAY */
64    public const int DOW_TUESDAY = UNKNOWN;
65    /** @cvalue UCAL_WEDNESDAY */
66    public const int DOW_WEDNESDAY = UNKNOWN;
67    /** @cvalue UCAL_THURSDAY */
68    public const int DOW_THURSDAY = UNKNOWN;
69    /** @cvalue UCAL_FRIDAY */
70    public const int DOW_FRIDAY = UNKNOWN;
71    /** @cvalue UCAL_SATURDAY */
72    public const int DOW_SATURDAY = UNKNOWN;
73
74    /** @cvalue UCAL_WEEKDAY */
75    public const int DOW_TYPE_WEEKDAY = UNKNOWN;
76    /** @cvalue UCAL_WEEKEND */
77    public const int DOW_TYPE_WEEKEND = UNKNOWN;
78    /** @cvalue UCAL_WEEKEND_ONSET */
79    public const int DOW_TYPE_WEEKEND_OFFSET = UNKNOWN;
80    /** @cvalue UCAL_WEEKEND_CEASE */
81    public const int DOW_TYPE_WEEKEND_CEASE = UNKNOWN;
82
83    /** @cvalue UCAL_WALLTIME_FIRST */
84    public const int WALLTIME_FIRST = UNKNOWN;
85    /** @cvalue UCAL_WALLTIME_LAST */
86    public const int WALLTIME_LAST = UNKNOWN;
87    /** @cvalue UCAL_WALLTIME_NEXT_VALID */
88    public const int WALLTIME_NEXT_VALID = UNKNOWN;
89
90    private function __construct() {}
91
92    /**
93     * @param IntlTimeZone|DateTimeZone|string|null $timezone
94     * @tentative-return-type
95     * @alias intlcal_create_instance
96     */
97    public static function createInstance($timezone = null, ?string $locale = null): ?IntlCalendar {}
98
99    /**
100     * @tentative-return-type
101     * @alias intlcal_equals
102     */
103    public function equals(IntlCalendar $other): bool {}
104
105    /**
106     * @tentative-return-type
107     * @alias intlcal_field_difference
108     */
109    public function fieldDifference(float $timestamp, int $field): int|false {}
110
111    /**
112     * @tentative-return-type
113     * @alias intlcal_add
114     */
115    public function add(int $field, int $value): bool {}
116
117    /**
118     * @tentative-return-type
119     * @alias intlcal_after
120     */
121    public function after(IntlCalendar $other): bool {}
122
123    /**
124     * @tentative-return-type
125     * @alias intlcal_before
126     */
127    public function before(IntlCalendar $other): bool {}
128
129    /**
130     * @tentative-return-type
131     * @alias intlcal_clear
132     */
133    public function clear(?int $field = null): true {}
134
135    /**
136     * @tentative-return-type
137     * @alias intlcal_from_date_time
138     */
139    public static function fromDateTime(DateTime|string $datetime, ?string $locale = null): ?IntlCalendar {}
140
141    /**
142     * @tentative-return-type
143     * @alias intlcal_get
144     */
145    public function get(int $field): int|false {}
146
147    /**
148     * @tentative-return-type
149     * @alias intlcal_get_actual_maximum
150     */
151    public function getActualMaximum(int $field): int|false {}
152
153    /**
154     * @tentative-return-type
155     * @alias intlcal_get_actual_minimum
156     */
157    public function getActualMinimum(int $field): int|false {}
158
159    /**
160     * @return array<int, string>
161     * @tentative-return-type
162     * @alias intlcal_get_available_locales
163     */
164    public static function getAvailableLocales(): array {}
165
166    /**
167     * @tentative-return-type
168     * @alias intlcal_get_day_of_week_type
169     */
170    public function getDayOfWeekType(int $dayOfWeek): int|false {}
171
172    /**
173     * @tentative-return-type
174     * @alias intlcal_get_error_code
175     */
176    public function getErrorCode(): int|false {}
177
178    /**
179     * @tentative-return-type
180     * @alias intlcal_get_error_message
181     */
182    public function getErrorMessage(): string|false {}
183
184    /**
185     * @tentative-return-type
186     * @alias intlcal_get_first_day_of_week
187     */
188    public function getFirstDayOfWeek(): int|false {}
189
190    /**
191     * @tentative-return-type
192     * @alias intlcal_get_greatest_minimum
193     */
194    public function getGreatestMinimum(int $field): int|false {}
195
196    /**
197     * @tentative-return-type
198     * @alias intlcal_get_keyword_values_for_locale
199     */
200    public static function getKeywordValuesForLocale(string $keyword, string $locale, bool $onlyCommon): IntlIterator|false {}
201
202    /**
203     * @tentative-return-type
204     * @alias intlcal_get_least_maximum
205     */
206    public function getLeastMaximum(int $field): int|false {}
207
208    /**
209     * @tentative-return-type
210     * @alias intlcal_get_locale
211     */
212    public function getLocale(int $type): string|false {}
213
214    /**
215     * @tentative-return-type
216     * @alias intlcal_get_maximum
217     */
218    public function getMaximum(int $field): int|false {}
219
220    /**
221     * @tentative-return-type
222     * @alias intlcal_get_minimal_days_in_first_week
223     */
224    public function getMinimalDaysInFirstWeek(): int|false {}
225
226    /**
227     * @tentative-return-type
228     * @alias intlcal_set_minimal_days_in_first_week
229     */
230    public function setMinimalDaysInFirstWeek(int $days): true {}
231
232    /**
233     * @tentative-return-type
234     * @alias intlcal_get_minimum
235     */
236    public function getMinimum(int $field): int|false {}
237
238    /**
239     * @tentative-return-type
240     * @alias intlcal_get_now
241     */
242    public static function getNow(): float {}
243
244    /**
245     * @tentative-return-type
246     * @alias intlcal_get_repeated_wall_time_option
247     */
248    public function getRepeatedWallTimeOption(): int {}
249
250    /**
251     * @tentative-return-type
252     * @alias intlcal_get_skipped_wall_time_option
253     */
254    public function getSkippedWallTimeOption(): int {}
255
256    /**
257     * @tentative-return-type
258     * @alias intlcal_get_time
259     */
260    public function getTime(): float|false {}
261
262    /**
263     * @tentative-return-type
264     * @alias intlcal_get_time_zone
265     */
266    public function getTimeZone(): IntlTimeZone|false {}
267
268    /**
269     * @tentative-return-type
270     * @alias intlcal_get_type
271     */
272    public function getType(): string {}
273
274    /**
275     * @tentative-return-type
276     * @alias intlcal_get_weekend_transition
277     */
278    public function getWeekendTransition(int $dayOfWeek): int|false {}
279
280    /**
281     * @tentative-return-type
282     * @alias intlcal_in_daylight_time
283     */
284    public function inDaylightTime(): bool {}
285
286    /**
287     * @tentative-return-type
288     * @alias intlcal_is_equivalent_to
289     */
290    public function isEquivalentTo(IntlCalendar $other): bool {}
291
292    /**
293     * @tentative-return-type
294     * @alias intlcal_is_lenient
295     */
296    public function isLenient(): bool {}
297
298    /**
299     * @tentative-return-type
300     * @alias intlcal_is_weekend
301     */
302    public function isWeekend(?float $timestamp = null): bool {}
303
304    /**
305     * @param int|bool $value
306     * @alias intlcal_roll
307     * @tentative-return-type
308     */
309    public function roll(int $field, $value): bool {}
310
311    /**
312     * @tentative-return-type
313     * @alias intlcal_is_set
314     */
315    public function isSet(int $field): bool {}
316
317    /**
318     * @tentative-return-type
319     * @implementation-alias intlcal_set
320     */
321    public function set(int $year, int $month, int $dayOfMonth = UNKNOWN, int $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN): true {}
322
323    public function setDate(int $year, int $month, int $dayOfMonth): void {}
324
325    public function setDateTime(int $year, int $month, int $dayOfMonth, int $hour, int $minute, ?int $second = null): void {}
326
327    /**
328     * @tentative-return-type
329     * @alias intlcal_set_first_day_of_week
330     */
331    public function setFirstDayOfWeek(int $dayOfWeek): true {}
332
333    /**
334     * @tentative-return-type
335     * @alias intlcal_set_lenient
336     */
337    public function setLenient(bool $lenient): true {}
338
339    /**
340     * @tentative-return-type
341     * @alias intlcal_set_repeated_wall_time_option
342     */
343    public function setRepeatedWallTimeOption(int $option): true {}
344
345    /**
346     * @tentative-return-type
347     * @alias intlcal_set_skipped_wall_time_option
348     */
349    public function setSkippedWallTimeOption(int $option): true {}
350
351    /**
352     * @tentative-return-type
353     * @alias intlcal_set_time
354     */
355    public function setTime(float $timestamp): bool {}
356
357    /**
358     * @param IntlTimeZone|DateTimeZone|string|null $timezone
359     * @tentative-return-type
360     * @alias intlcal_set_time_zone
361     */
362    public function setTimeZone($timezone): bool {}
363
364    /**
365     * @tentative-return-type
366     * @alias intlcal_to_date_time
367     */
368    public function toDateTime(): DateTime|false {}
369}
370
371/** @not-serializable */
372class IntlGregorianCalendar extends IntlCalendar
373{
374    public static function createFromDate(int $year, int $month, int $dayOfMonth): static {}
375
376    public static function createFromDateTime(int $year, int $month, int $dayOfMonth, int $hour, int $minute, ?int $second = null): static {}
377
378    /**
379     * @param DateTimeZone|IntlTimeZone|string|int|null $timezoneOrYear
380     * @param string|int|null $localeOrMonth
381     * @param int $day
382     * @param int $hour
383     * @param int $minute
384     * @param int $second
385     */
386    public function __construct($timezoneOrYear = UNKNOWN, $localeOrMonth = UNKNOWN, $day = UNKNOWN, $hour = UNKNOWN, $minute = UNKNOWN, $second = UNKNOWN) {}
387
388    /**
389     * @tentative-return-type
390     * @alias intlgregcal_set_gregorian_change
391     */
392    public function setGregorianChange(float $timestamp): bool {}
393
394    /**
395     * @tentative-return-type
396     * @alias intlgregcal_get_gregorian_change
397     */
398    public function getGregorianChange(): float {}
399
400    /**
401     * @tentative-return-type
402     * @alias intlgregcal_is_leap_year
403     */
404    public function isLeapYear(int $year): bool {}
405}
406