dateformat.stub.php 3.8 KB

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