Skip to content

Commit a827db2

Browse files
committed
Add stubs for IntlCalendar
Closes GH-4846
1 parent 2236638 commit a827db2

File tree

6 files changed

+739
-337
lines changed

6 files changed

+739
-337
lines changed

ext/intl/calendar/calendar.stub.php

Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
<?php
2+
3+
class IntlCalendar
4+
{
5+
private function __construct() {}
6+
7+
/**
8+
* @param IntlTimeZone|DateTimeZone|string|null $timeZone
9+
* @return IntlCalendar|null
10+
*/
11+
public static function createInstance($timeZone = null, ?string $locale = null) {}
12+
13+
/** @return bool */
14+
public function equals(IntlCalendar $calendar) {}
15+
16+
/** @return int|false */
17+
public function fieldDifference(float $when, int $field) {}
18+
19+
/** @return bool */
20+
public function add(int $field, int $amount) {}
21+
22+
/** @return bool */
23+
public function after(IntlCalendar $calendar) {}
24+
25+
/** @return bool */
26+
public function before(IntlCalendar $calendar) {}
27+
28+
/** @return bool */
29+
public function clear(?int $field = null) {}
30+
31+
/**
32+
* @param DateTime|string $dateTime
33+
* @return IntlCalendar|null
34+
*/
35+
public static function fromDateTime($dateTime, ?string $locale = null) {}
36+
37+
/** @return int|false */
38+
public function get(int $field) {}
39+
40+
/** @return int|false */
41+
public function getActualMaximum(int $field) {}
42+
43+
/** @return int|false */
44+
public function getActualMinimum(int $field) {}
45+
46+
/** @return array */
47+
public static function getAvailableLocales() {}
48+
49+
/** @return int|false */
50+
public function getDayOfWeekType(int $dayOfWeek) {}
51+
52+
/** @return int|false */
53+
public function getErrorCode() {}
54+
55+
/** @return string|false */
56+
public function getErrorMessage() {}
57+
58+
/** @return int|false */
59+
public function getFirstDayOfWeek() {}
60+
61+
/** @return int|false */
62+
public function getGreatestMinimum(int $field) {}
63+
64+
/** @return IntlIterator|false */
65+
public static function getKeywordValuesForLocale(string $key, string $locale, bool $commonlyUsed) {}
66+
67+
/** @return int|false */
68+
public function getLeastMaximum(int $field) {}
69+
70+
/** @return string|false */
71+
public function getLocale(int $localeType) {}
72+
73+
/** @return int|false */
74+
public function getMaximum(int $field) {}
75+
76+
/** @return int|false */
77+
public function getMinimalDaysInFirstWeek() {}
78+
79+
/** @return bool */
80+
public function setMinimalDaysInFirstWeek(int $numberOfDays) {}
81+
82+
/** @return int|false */
83+
public function getMinimum(int $field) {}
84+
85+
/** @return float */
86+
public static function getNow() {}
87+
88+
/** @return int */
89+
public function getRepeatedWallTimeOption() {}
90+
91+
/** @return int */
92+
public function getSkippedWallTimeOption() {}
93+
94+
/** @return float|false */
95+
public function getTime() {}
96+
97+
/** @return IntlTimeZone|false */
98+
public function getTimeZone() {}
99+
100+
/** @return string */
101+
public function getType() {}
102+
103+
/** @return int|false */
104+
public function getWeekendTransition(int $dayOfWeek) {}
105+
106+
/** @return bool */
107+
public function inDaylightTime() {}
108+
109+
/** @return bool */
110+
public function isEquivalentTo(IntlCalendar $calendar) {}
111+
112+
/** @return bool */
113+
public function isLenient() {}
114+
115+
/** @return bool */
116+
public function isWeekend(?float $date = null) {}
117+
118+
/**
119+
* @param int|bool $amountOrUpOrDown
120+
* @return bool
121+
*/
122+
public function roll(int $field, $amountOrUpOrDown) {}
123+
124+
/** @return bool */
125+
public function isSet(int $field) {}
126+
127+
/** @return bool */
128+
public function set(int $year, int $month, int $dayOfMonth = UNKNOWN, $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN) {}
129+
130+
/** @return bool */
131+
public function setFirstDayOfWeek(int $dayOfWeek) {}
132+
133+
/** @return bool */
134+
public function setLenient(bool $isLenient) {}
135+
136+
/** @return bool */
137+
public function setRepeatedWallTimeOption(int $wallTimeOption) {}
138+
139+
/** @return bool */
140+
public function setSkippedWallTimeOption(int $wallTimeOption) {}
141+
142+
/** @return bool */
143+
public function setTime(float $date) {}
144+
145+
/**
146+
* @param IntlTimeZone|DateTimeZone|string|null $timeZone
147+
* @return bool
148+
*/
149+
public function setTimeZone($timeZone) {}
150+
151+
/** @return DateTime|false */
152+
public function toDateTime() {}
153+
}
154+
155+
class IntlGregorianCalendar extends IntlCalendar
156+
{
157+
public function __construct() {}
158+
159+
/**
160+
* @param IntlTimeZone|DateTimeZone|string|null $timeZone
161+
* @return IntlGregorianCalendar|null
162+
*/
163+
public static function createInstance($timeZone = null, ?string $locale = null) {}
164+
165+
/** @return bool */
166+
public function setGregorianChange(float $change) {}
167+
168+
/** @return float|false */
169+
public function getGregorianChange() {}
170+
171+
/** @return bool */
172+
public function isLeapYear(int $year) {}
173+
}
174+
175+
/** @param IntlTimeZone|DateTimeZone|string|null $timeZone */
176+
function intlcal_create_instance($timeZone = null, ?string $locale = null): IntlCalendar|null {}
177+
178+
function intlcal_get_keyword_values_for_locale(string $key, string $locale, bool $commonlyUsed): IntlIterator|false {}
179+
180+
function intlcal_get_now(): float {}
181+
182+
function intlcal_get_available_locales(): array {}
183+
184+
function intlcal_get(IntlCalendar $calendar, int $field): int|false {}
185+
186+
function intlcal_get_time(IntlCalendar $calendar): float|false {}
187+
188+
function intlcal_set_time(IntlCalendar $calendar, float $date): bool {}
189+
190+
function intlcal_add(IntlCalendar $calendar, int $field, int $amount): bool {}
191+
192+
/** @param IntlTimeZone|DateTimeZone|string|null $timeZone */
193+
function intlcal_set_time_zone(IntlCalendar $calendar, $timeZone): bool {}
194+
195+
function intlcal_after(IntlCalendar $calendarObject, IntlCalendar $calendar): bool {}
196+
197+
function intlcal_before(IntlCalendar $calendarObject, IntlCalendar $calendar): bool {}
198+
199+
function intlcal_set(IntlCalendar $calendar, int $year, int $month, int $dayOfMonth = UNKNOWN, $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN): bool {}
200+
201+
/** @param int|bool $amountOrUpOrDown */
202+
function intlcal_roll(IntlCalendar $calendar, int $field, $amountOrUpOrDown): bool {}
203+
204+
function intlcal_clear(IntlCalendar $calendar, ?int $field = null): bool {}
205+
206+
function intlcal_field_difference(IntlCalendar $calendar, float $when, int $field): int|false {}
207+
208+
function intlcal_get_actual_maximum(IntlCalendar $calendar, int $field): int|false {}
209+
210+
function intlcal_get_actual_minimum(IntlCalendar $calendar, int $field): int|false {}
211+
212+
function intlcal_get_day_of_week_type(IntlCalendar $calendar, int $dayOfWeek): int|false {}
213+
214+
function intlcal_get_first_day_of_week(IntlCalendar $calendar): int|false {}
215+
216+
function intlcal_greatest_minimum(IntlCalendar $calendar, int $field): int|false {}
217+
218+
function intlcal_get_least_maximum(IntlCalendar $calendar, int $field): int|false {}
219+
220+
function intlcal_get_greatest_minimum(IntlCalendar $calendar, int $field): int|false {}
221+
222+
function intlcal_get_locale(IntlCalendar $calendar, int $localeType): string|false {}
223+
224+
function intlcal_get_maximum(IntlCalendar $calendar, int $field): int|false {}
225+
226+
function intlcal_get_minimal_days_in_first_week(IntlCalendar $calendar): int|false {}
227+
228+
function intlcal_set_minimal_days_in_first_week(IntlCalendar $calendar, int $numberOfDays): bool {}
229+
230+
function intlcal_get_minimum(IntlCalendar $calendar, int $field): int|false {}
231+
232+
function intlcal_get_time_zone(IntlCalendar $calendar): IntlTimeZone|false {}
233+
234+
function intlcal_get_type(IntlCalendar $calendar): string {}
235+
236+
function intlcal_get_weekend_transition(IntlCalendar $calendar, int $dayOfWeek): int|false {}
237+
238+
function intlcal_in_daylight_time(IntlCalendar $calendar): bool {}
239+
240+
function intlcal_is_lenient(IntlCalendar $calendar): bool {}
241+
242+
function intlcal_is_set(IntlCalendar $calendar, int $field): bool {}
243+
244+
function intlcal_is_equivalent_to(IntlCalendar $calendarObject, IntlCalendar $calendar): bool {}
245+
246+
function intlcal_is_weekend(IntlCalendar $calendar, ?float $date = null): bool {}
247+
248+
function intlcal_set_first_day_of_week(IntlCalendar $calendar, int $dayOfWeek): bool {}
249+
250+
function intlcal_set_lenient(IntlCalendar $calendar, bool $isLenient): bool {}
251+
252+
function intlcal_get_repeated_wall_time_option(IntlCalendar $calendar): int {}
253+
254+
function intlcal_equals(IntlCalendar $calendarObject, IntlCalendar $calendar): bool {}
255+
256+
function intlcal_get_skipped_wall_time_option(IntlCalendar $calendar): int {}
257+
258+
function intlcal_set_repeated_wall_time_option(IntlCalendar $calendar, int $wallTimeOption): bool {}
259+
260+
function intlcal_set_skipped_wall_time_option(IntlCalendar $calendar, int $wallTimeOption): bool {}
261+
262+
/** @param DateTime|string $dateTime */
263+
function intlcal_from_date_time($dateTime, ?string $locale = null): ?IntlCalendar {}
264+
265+
function intlcal_to_date_time(IntlCalendar $calendar): DateTime|false {}
266+
267+
function intlcal_get_error_code(IntlCalendar $calendar): int|false {}
268+
269+
function intlcal_get_error_message(IntlCalendar $calendar): string|false {}
270+
271+
/** @param IntlTimeZone|DateTimeZone|string|null $timeZone */
272+
function intlgregcal_create_instance($timeZone = null, ?string $locale = null): ?IntlGregorianCalendar {}
273+
274+
function intlgregcal_set_gregorian_change(IntlGregorianCalendar $calendar, float $change): bool {}
275+
276+
function intlgregcal_get_gregorian_change(IntlGregorianCalendar $calendar): float|false {}
277+
278+
function intlgregcal_is_leap_year(IntlGregorianCalendar $calendar, int $year): bool {}

0 commit comments

Comments
 (0)