-
Notifications
You must be signed in to change notification settings - Fork 7.8k
/
Copy pathphp_date.stub.php
503 lines (386 loc) · 13.8 KB
/
php_date.stub.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
<?php
/** @generate-class-entries */
function strtotime(string $datetime, ?int $baseTimestamp = null): int|false {}
/** @refcount 1 */
function date(string $format, ?int $timestamp = null): string {}
function idate(string $format, ?int $timestamp = null): int|false {}
/** @refcount 1 */
function gmdate(string $format, ?int $timestamp = null): string {}
function mktime(
int $hour, ?int $minute = null, ?int $second = null,
?int $month = null, ?int $day = null, ?int $year = null): int|false {}
function gmmktime(
int $hour, ?int $minute = null, ?int $second = null,
?int $month = null, ?int $day = null, ?int $year = null): int|false {}
function checkdate(int $month, int $day, int $year): bool {}
/**
* @refcount 1
* @deprecated
*/
function strftime(string $format, ?int $timestamp = null): string|false {}
/**
* @refcount 1
* @deprecated
*/
function gmstrftime(string $format, ?int $timestamp = null): string|false {}
function time(): int {}
/**
* @return array<int|string, int>
* @refcount 1
*/
function localtime(?int $timestamp = null, bool $associative = false): array {}
/**
* @return array<int|string, int|string>
* @refcount 1
*/
function getdate(?int $timestamp = null): array {}
/** @refcount 1 */
function date_create(string $datetime = "now", ?DateTimeZone $timezone = null): DateTime|false {}
/** @refcount 1 */
function date_create_immutable(
string $datetime = "now", ?DateTimeZone $timezone = null): DateTimeImmutable|false {}
/** @refcount 1 */
function date_create_from_format(
string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false {}
/** @refcount 1 */
function date_create_immutable_from_format(
string $format, string $datetime, ?DateTimeZone $timezone = null): DateTimeImmutable|false {}
/**
* @return array<string, mixed>
* @refcount 1
*/
function date_parse(string $datetime): array {}
/**
* @return array<string, mixed>
* @refcount 1
*/
function date_parse_from_format(string $format, string $datetime): array {}
/**
* @return array<string, int|array>|false
* @refcount 1
*/
function date_get_last_errors(): array|false {}
/** @refcount 1 */
function date_format(DateTimeInterface $object, string $format): string {}
function date_modify(DateTime $object, string $modifier): DateTime|false {}
function date_add(DateTime $object, DateInterval $interval): DateTime {}
function date_sub(DateTime $object, DateInterval $interval): DateTime {}
/** @refcount 1 */
function date_timezone_get(DateTimeInterface $object): DateTimeZone|false {}
function date_timezone_set(DateTime $object, DateTimeZone $timezone): DateTime {}
function date_offset_get(DateTimeInterface $object): int {}
/** @refcount 1 */
function date_diff(
DateTimeInterface $baseObject, DateTimeInterface $targetObject, bool $absolute = false): DateInterval {}
function date_time_set(
DateTime $object, int $hour, int $minute, int $second = 0, int $microsecond = 0): DateTime {}
function date_date_set(DateTime $object, int $year, int $month, int $day): DateTime {}
function date_isodate_set(DateTime $object, int $year, int $week, int $dayOfWeek = 1): DateTime {}
function date_timestamp_set(DateTime $object, int $timestamp): DateTime {}
function date_timestamp_get(DateTimeInterface $object): int {}
/** @refcount 1 */
function timezone_open(string $timezone): DateTimeZone|false {}
/** @refcount 1 */
function timezone_name_get(DateTimeZone $object): string {}
/** @refcount 1 */
function timezone_name_from_abbr(string $abbr, int $utcOffset = -1, int $isDST = -1): string|false {}
function timezone_offset_get(DateTimeZone $object, DateTimeInterface $datetime): int {}
/**
* @return array<int, array>|false
* @refcount 1
*/
function timezone_transitions_get(
DateTimeZone $object, int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false {}
/**
* @return array<string, float|string>|false
* @refcount 1
*/
function timezone_location_get(DateTimeZone $object): array|false {}
/**
* @return array<int, string>
* @refcount 1
*/
function timezone_identifiers_list(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array {}
/**
* @return array<string, array>
* @refcount 1
*/
function timezone_abbreviations_list(): array {}
/** @refcount 1 */
function timezone_version_get(): string {}
/** @refcount 1 */
function date_interval_create_from_date_string(string $datetime): DateInterval|false {}
/** @refcount 1 */
function date_interval_format(DateInterval $object, string $format): string {}
function date_default_timezone_set(string $timezoneId): bool {}
/** @refcount 1 */
function date_default_timezone_get(): string {}
/**
* @refcount 1
* @deprecated
*/
function date_sunrise(
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,
?float $utcOffset = null): string|int|float|false {}
/**
* @refcount 1
* @deprecated
*/
function date_sunset(
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,
?float $utcOffset = null): string|int|float|false {}
/**
* @return array<string, bool|int>
* @refcount 1
*/
function date_sun_info(int $timestamp, float $latitude, float $longitude): array {}
interface DateTimeInterface
{
/** @tentative-return-type */
public function format(string $format): string;
/** @tentative-return-type */
public function getTimezone(): DateTimeZone|false;
/** @tentative-return-type */
public function getOffset(): int;
/** @tentative-return-type */
public function getTimestamp(): int;
/** @tentative-return-type */
public function diff(DateTimeInterface $targetObject, bool $absolute = false): DateInterval;
/** @tentative-return-type */
public function __wakeup(): void;
}
class DateTime implements DateTimeInterface
{
public function __construct(string $datetime = "now", ?DateTimeZone $timezone = null) {}
/** @tentative-return-type */
public function __wakeup(): void {}
/** @tentative-return-type */
public static function __set_state(array $array): DateTime {}
/** @tentative-return-type */
public static function createFromImmutable(DateTimeImmutable $object): DateTime {}
public static function createFromInterface(DateTimeInterface $object): DateTime {}
/**
* @tentative-return-type
* @alias date_create_from_format
*/
public static function createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false {}
/**
* @return array<string, int|array>|false
* @tentative-return-type
* @alias date_get_last_errors
*/
public static function getLastErrors(): array|false {}
/**
* @tentative-return-type
* @alias date_format
*/
public function format(string $format): string {}
/**
* @tentative-return-type
* @alias date_modify
*/
public function modify(string $modifier): DateTime|false {}
/**
* @tentative-return-type
* @alias date_add
*/
public function add(DateInterval $interval): DateTime {}
/**
* @tentative-return-type
* @alias date_sub
*/
public function sub(DateInterval $interval): DateTime {}
/**
* @tentative-return-type
* @alias date_timezone_get
*/
public function getTimezone(): DateTimeZone|false {}
/**
* @tentative-return-type
* @alias date_timezone_set
*/
public function setTimezone(DateTimeZone $timezone): DateTime {}
/**
* @tentative-return-type
* @alias date_offset_get
*/
public function getOffset(): int {}
/**
* @tentative-return-type
* @alias date_time_set
*/
public function setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0): DateTime {}
/**
* @tentative-return-type
* @alias date_date_set
*/
public function setDate(int $year, int $month, int $day): DateTime {}
/**
* @tentative-return-type
* @alias date_isodate_set
*/
public function setISODate(int $year, int $week, int $dayOfWeek = 1): DateTime {}
/**
* @tentative-return-type
* @alias date_timestamp_set
*/
public function setTimestamp(int $timestamp): DateTime {}
/**
* @tentative-return-type
* @alias date_timestamp_get
*/
public function getTimestamp(): int {}
/**
* @tentative-return-type
* @alias date_diff
*/
public function diff(DateTimeInterface $targetObject, bool $absolute = false): DateInterval {}
}
class DateTimeImmutable implements DateTimeInterface
{
public function __construct(string $datetime = "now", ?DateTimeZone $timezone = null) {}
/** @tentative-return-type */
public function __wakeup(): void {}
/** @tentative-return-type */
public static function __set_state(array $array): DateTimeImmutable {}
/**
* @tentative-return-type
* @alias date_create_immutable_from_format
*/
public static function createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTimeImmutable|false {}
/**
* @return array<string, int|array>|false
* @tentative-return-type
* @alias date_get_last_errors
*/
public static function getLastErrors(): array|false {}
/**
* @tentative-return-type
* @alias date_format
*/
public function format(string $format): string {}
/**
* @tentative-return-type
* @alias date_timezone_get
*/
public function getTimezone(): DateTimeZone|false {}
/**
* @tentative-return-type
* @alias date_offset_get
*/
public function getOffset(): int {}
/**
* @tentative-return-type
* @alias date_timestamp_get
*/
public function getTimestamp(): int {}
/**
* @tentative-return-type
* @alias date_diff
*/
public function diff(DateTimeInterface $targetObject, bool $absolute = false): DateInterval {}
/** @tentative-return-type */
public function modify(string $modifier): DateTimeImmutable|false {}
/** @tentative-return-type */
public function add(DateInterval $interval): DateTimeImmutable {}
/** @tentative-return-type */
public function sub(DateInterval $interval): DateTimeImmutable {}
/** @tentative-return-type */
public function setTimezone(DateTimeZone $timezone): DateTimeImmutable {}
/** @tentative-return-type */
public function setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0): DateTimeImmutable {}
/** @tentative-return-type */
public function setDate(int $year, int $month, int $day): DateTimeImmutable {}
/** @tentative-return-type */
public function setISODate(int $year, int $week, int $dayOfWeek = 1): DateTimeImmutable {}
/** @tentative-return-type */
public function setTimestamp(int $timestamp): DateTimeImmutable {}
/** @tentative-return-type */
public static function createFromMutable(DateTime $object): DateTimeImmutable {}
public static function createFromInterface(DateTimeInterface $object): DateTimeImmutable {}
}
class DateTimeZone
{
public function __construct(string $timezone) {}
/**
* @tentative-return-type
* @alias timezone_name_get
*/
public function getName(): string {}
/**
* @tentative-return-type
* @alias timezone_offset_get
*/
public function getOffset(DateTimeInterface $datetime): int {}
/**
* @return array<int, array>|false
* @tentative-return-type
* @alias timezone_transitions_get
*/
public function getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false {}
/**
* @return array<string, float|string>|false
* @tentative-return-type
* @alias timezone_location_get
*/
public function getLocation(): array|false {}
/**
* @return array<string, array>
* @tentative-return-type
* @alias timezone_abbreviations_list
*/
public static function listAbbreviations(): array {}
/**
* @return array<int, string>
* @tentative-return-type
* @alias timezone_identifiers_list
*/
public static function listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array {}
/** @tentative-return-type */
public function __wakeup(): void {}
/** @tentative-return-type */
public static function __set_state(array $array): DateTimeZone {}
}
class DateInterval
{
public function __construct(string $duration) {}
/**
* @tentative-return-type
* @alias date_interval_create_from_date_string
*/
public static function createFromDateString(string $datetime): DateInterval|false {}
/**
* @tentative-return-type
* @alias date_interval_format
*/
public function format(string $format): string {}
/** @tentative-return-type */
public function __wakeup(): void {}
/** @tentative-return-type */
public static function __set_state(array $array): DateInterval {}
}
class DatePeriod implements IteratorAggregate
{
/**
* @param DateTimeInterface|string $start
* @param DateInterval|int $interval
* @param DateTimeInterface|int $end
* @param int $options
*/
public function __construct($start, $interval = UNKNOWN, $end = UNKNOWN, $options = UNKNOWN) {}
/** @tentative-return-type */
public function getStartDate(): DateTimeInterface {}
/** @tentative-return-type */
public function getEndDate(): ?DateTimeInterface {}
/** @tentative-return-type */
public function getDateInterval(): DateInterval {}
/** @tentative-return-type */
public function getRecurrences(): ?int {}
/** @tentative-return-type */
public function __wakeup(): void {}
/** @tentative-return-type */
public static function __set_state(array $array): DatePeriod {}
public function getIterator(): Iterator {}
}