formatter.stub.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. /** @generate-class-entries */
  3. /** @not-serializable */
  4. class NumberFormatter
  5. {
  6. public function __construct(string $locale, int $style, ?string $pattern = null) {}
  7. /**
  8. * @tentative-return-type
  9. * @alias numfmt_create
  10. */
  11. public static function create(string $locale, int $style, ?string $pattern = null): ?NumberFormatter {}
  12. /**
  13. * @tentative-return-type
  14. * @alias numfmt_format
  15. */
  16. public function format(int|float $num, int $type = NumberFormatter::TYPE_DEFAULT): string|false {}
  17. /**
  18. * @param int $offset
  19. * @tentative-return-type
  20. * @alias numfmt_parse
  21. */
  22. public function parse(string $string, int $type = NumberFormatter::TYPE_DOUBLE, &$offset = null): int|float|false {}
  23. /**
  24. * @tentative-return-type
  25. * @alias numfmt_format_currency
  26. */
  27. public function formatCurrency(float $amount, string $currency): string|false {}
  28. /**
  29. * @param string $currency
  30. * @param int $offset
  31. * @tentative-return-type
  32. * @alias numfmt_parse_currency
  33. */
  34. public function parseCurrency(string $string, &$currency, &$offset = null): float|false {}
  35. /**
  36. * @tentative-return-type
  37. * @alias numfmt_set_attribute
  38. */
  39. public function setAttribute(int $attribute, int|float $value): bool {}
  40. /**
  41. * @tentative-return-type
  42. * @alias numfmt_get_attribute
  43. */
  44. public function getAttribute(int $attribute): int|float|false {}
  45. /**
  46. * @tentative-return-type
  47. * @alias numfmt_set_text_attribute
  48. */
  49. public function setTextAttribute(int $attribute, string $value): bool {}
  50. /**
  51. * @tentative-return-type
  52. * @alias numfmt_get_text_attribute
  53. */
  54. public function getTextAttribute(int $attribute): string|false {}
  55. /**
  56. * @tentative-return-type
  57. * @alias numfmt_set_symbol
  58. */
  59. public function setSymbol(int $symbol, string $value): bool {}
  60. /**
  61. * @tentative-return-type
  62. * @alias numfmt_get_symbol
  63. */
  64. public function getSymbol(int $symbol): string|false {}
  65. /**
  66. * @tentative-return-type
  67. * @alias numfmt_set_pattern
  68. */
  69. public function setPattern(string $pattern): bool {}
  70. /**
  71. * @tentative-return-type
  72. * @alias numfmt_get_pattern
  73. */
  74. public function getPattern(): string|false {}
  75. /**
  76. * @tentative-return-type
  77. * @alias numfmt_get_locale
  78. */
  79. public function getLocale(int $type = ULOC_ACTUAL_LOCALE): string|false {}
  80. /**
  81. * @tentative-return-type
  82. * @alias numfmt_get_error_code
  83. */
  84. public function getErrorCode(): int {}
  85. /**
  86. * @tentative-return-type
  87. * @alias numfmt_get_error_message
  88. */
  89. public function getErrorMessage(): string {}
  90. }