forked from JetBrains/phpstorm-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintl.php
7418 lines (6854 loc) · 265 KB
/
intl.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
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
// Start of intl v.1.1.0
use JetBrains\PhpStorm\Deprecated;
use JetBrains\PhpStorm\ExpectedValues as EV;
use JetBrains\PhpStorm\Internal\LanguageLevelTypeAware as TypeAware;
use JetBrains\PhpStorm\Internal\PhpStormStubsElementAvailable as ElementAvailable;
use JetBrains\PhpStorm\Pure;
class Collator
{
public const DEFAULT_VALUE = -1;
public const PRIMARY = 0;
public const SECONDARY = 1;
public const TERTIARY = 2;
public const DEFAULT_STRENGTH = 2;
public const QUATERNARY = 3;
public const IDENTICAL = 15;
public const OFF = 16;
public const ON = 17;
public const SHIFTED = 20;
public const NON_IGNORABLE = 21;
public const LOWER_FIRST = 24;
public const UPPER_FIRST = 25;
/**
* <p>
* Sort strings with different accents from the back of the string. This
* attribute is automatically set to
* On
* for the French locales and a few others. Users normally would not need
* to explicitly set this attribute. There is a string comparison
* performance cost when it is set On,
* but sort key length is unaffected. Possible values are:
* <b>Collator::ON</b>
* <b>Collator::OFF</b>(default)
* <b>Collator::DEFAULT_VALUE</b>
* </p>
* <p>
* FRENCH_COLLATION rules
* <p>
* F=OFF cote < coté < côte < côté
* F=ON cote < côte < coté < côté
* </p>
* </p>
* @link https://php.net/manual/en/class.collator.php#intl.collator-constants
*/
public const FRENCH_COLLATION = 0;
/**
* <p>
* The Alternate attribute is used to control the handling of the so called
* variable characters in the UCA: whitespace, punctuation and symbols. If
* Alternate is set to NonIgnorable
* (N), then differences among these characters are of the same importance
* as differences among letters. If Alternate is set to
* Shifted
* (S), then these characters are of only minor importance. The
* Shifted value is often used in combination with
* Strength
* set to Quaternary. In such a case, whitespace, punctuation, and symbols
* are considered when comparing strings, but only if all other aspects of
* the strings (base letters, accents, and case) are identical. If
* Alternate is not set to Shifted, then there is no difference between a
* Strength of 3 and a Strength of 4. For more information and examples,
* see Variable_Weighting in the
* UCA.
* The reason the Alternate values are not simply
* On and Off
* is that additional Alternate values may be added in the future. The UCA
* option Blanked is expressed with Strength set to 3, and Alternate set to
* Shifted. The default for most locales is NonIgnorable. If Shifted is
* selected, it may be slower if there are many strings that are the same
* except for punctuation; sort key length will not be affected unless the
* strength level is also increased.
* </p>
* <p>
* Possible values are:
* <b>Collator::NON_IGNORABLE</b>(default)
* <b>Collator::SHIFTED</b>
* <b>Collator::DEFAULT_VALUE</b>
* </p>
* <p>
* ALTERNATE_HANDLING rules
* <p>
* S=3, A=N di Silva < Di Silva < diSilva < U.S.A. < USA
* S=3, A=S di Silva = diSilva < Di Silva < U.S.A. = USA
* S=4, A=S di Silva < diSilva < Di Silva < U.S.A. < USA
* </p>
* </p>
* @link https://php.net/manual/en/class.collator.php#intl.collator-constants
*/
public const ALTERNATE_HANDLING = 1;
/**
* <p>
* The Case_First attribute is used to control whether uppercase letters
* come before lowercase letters or vice versa, in the absence of other
* differences in the strings. The possible values are
* Uppercase_First
* (U) and Lowercase_First
* (L), plus the standard Default
* and Off.
* There is almost no difference between the Off and Lowercase_First
* options in terms of results, so typically users will not use
* Lowercase_First: only Off or Uppercase_First. (People interested in the
* detailed differences between X and L should consult the Collation
* Customization). Specifying either L or U won't affect string comparison
* performance, but will affect the sort key length.
* </p>
* <p>
* Possible values are:
* <b>Collator::OFF</b>(default)
* <b>Collator::LOWER_FIRST</b>
* <b>Collator::UPPER_FIRST</b>
* <b>Collator:DEFAULT</b>
* </p>
* <p>
* CASE_FIRST rules
* <p>
* C=X or C=L "china" < "China" < "denmark" < "Denmark"
* C=U "China" < "china" < "Denmark" < "denmark"
* </p>
* </p>
* @link https://php.net/manual/en/class.collator.php#intl.collator-constants
*/
public const CASE_FIRST = 2;
/**
* <p>
* The Case_Level attribute is used when ignoring accents but not case. In
* such a situation, set Strength to be Primary,
* and Case_Level to be On.
* In most locales, this setting is Off by default. There is a small
* string comparison performance and sort key impact if this attribute is
* set to be On.
* </p>
* <p>
* Possible values are:
* <b>Collator::OFF</b>(default)
* <b>Collator::ON</b>
* <b>Collator::DEFAULT_VALUE</b>
* </p>
* <p>
* CASE_LEVEL rules
* <p>
* S=1, E=X role = Role = rôle
* S=1, E=O role = rôle < Role
* </p>
* </p>
* @link https://php.net/manual/en/class.collator.php#intl.collator-constants
*/
public const CASE_LEVEL = 3;
/**
* <p>
* The Normalization setting determines whether text is thoroughly
* normalized or not in comparison. Even if the setting is off (which is
* the default for many locales), text as represented in common usage will
* compare correctly (for details, see UTN #5). Only if the accent marks
* are in noncanonical order will there be a problem. If the setting is
* On,
* then the best results are guaranteed for all possible text input.
* There is a medium string comparison performance cost if this attribute
* is On,
* depending on the frequency of sequences that require normalization.
* There is no significant effect on sort key length. If the input text is
* known to be in NFD or NFKD normalization forms, there is no need to
* enable this Normalization option.
* </p>
* <p>
* Possible values are:
* <b>Collator::OFF</b>(default)
* <b>Collator::ON</b>
* <b>Collator::DEFAULT_VALUE</b>
* </p>
* @link https://php.net/manual/en/class.collator.php#intl.collator-constants
*/
public const NORMALIZATION_MODE = 4;
/**
* <p>
* The ICU Collation Service supports many levels of comparison (named
* "Levels", but also known as "Strengths"). Having these categories
* enables ICU to sort strings precisely according to local conventions.
* However, by allowing the levels to be selectively employed, searching
* for a string in text can be performed with various matching conditions.
* For more detailed information, see
* <b>collator_set_strength</b> chapter.
* </p>
* <p>
* Possible values are:
* <b>Collator::PRIMARY</b>
* <b>Collator::SECONDARY</b>
* <b>Collator::TERTIARY</b>(default)
* <b>Collator::QUATERNARY</b>
* <b>Collator::IDENTICAL</b>
* <b>Collator::DEFAULT_VALUE</b>
* </p>
* @link https://php.net/manual/en/class.collator.php#intl.collator-constants
*/
public const STRENGTH = 5;
/**
* <p>
* Compatibility with JIS x 4061 requires the introduction of an additional
* level to distinguish Hiragana and Katakana characters. If compatibility
* with that standard is required, then this attribute should be set
* On,
* and the strength set to Quaternary. This will affect sort key length
* and string comparison string comparison performance.
* </p>
* <p>
* Possible values are:
* <b>Collator::OFF</b>(default)
* <b>Collator::ON</b>
* <b>Collator::DEFAULT_VALUE</b>
* </p>
* @link https://php.net/manual/en/class.collator.php#intl.collator-constants
*/
public const HIRAGANA_QUATERNARY_MODE = 6;
/**
* <p>
* When turned on, this attribute generates a collation key for the numeric
* value of substrings of digits. This is a way to get '100' to sort AFTER
* '2'.
* </p>
* <p>
* Possible values are:
* <b>Collator::OFF</b>(default)
* <b>Collator::ON</b>
* <b>Collator::DEFAULT_VALUE</b>
* </p>
* @link https://php.net/manual/en/class.collator.php#intl.collator-constants
*/
public const NUMERIC_COLLATION = 7;
public const SORT_REGULAR = 0;
public const SORT_STRING = 1;
public const SORT_NUMERIC = 2;
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Create a collator
* @link https://php.net/manual/en/collator.construct.php
* @param string $locale
*/
#[Pure]
public function __construct(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Create a collator
* @link https://php.net/manual/en/collator.create.php
* @param string $locale <p>
* The locale containing the required collation rules. Special values for
* locales can be passed in - if null is passed for the locale, the
* default locale collation rules will be used. If empty string ("") or
* "root" are passed, UCA rules will be used.
* </p>
* @return Collator|null Return new instance of <b>Collator</b> object, or <b>NULL</b>
* on error.
*/
public static function create(#[TypeAware(['8.0' => 'string'], default: '')] $locale) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Compare two Unicode strings
* @link https://php.net/manual/en/collator.compare.php
* @param string $string1 <p>
* The first string to compare.
* </p>
* @param string $string2 <p>
* The second string to compare.
* </p>
* @return int Return comparison result:</p>
* <p>
* <p>
* 1 if <i>str1</i> is greater than
* <i>str2</i> ;
* </p>
* <p>
* 0 if <i>str1</i> is equal to
* <i>str2</i>;
* </p>
* <p>
* -1 if <i>str1</i> is less than
* <i>str2</i> .
* </p>
* On error
* boolean
* <b>FALSE</b>
* is returned.
*/
#[Pure]
public function compare(
#[TypeAware(['8.0' => 'string'], default: '')] $string1,
#[TypeAware(['8.0' => 'string'], default: '')] $string2
) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Sort array using specified collator
* @link https://php.net/manual/en/collator.sort.php
* @param string[] &$array <p>
* Array of strings to sort.
* </p>
* @param int $flags [optional] <p>
* Optional sorting type, one of the following:
* </p>
* <p>
* <b>Collator::SORT_REGULAR</b>
* - compare items normally (don't change types)
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function sort(
array &$array,
#[TypeAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null
) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Sort array using specified collator and sort keys
* @link https://php.net/manual/en/collator.sortwithsortkeys.php
* @param string[] &$array <p>Array of strings to sort</p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function sortWithSortKeys(array &$array) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Sort array maintaining index association
* @link https://php.net/manual/en/collator.asort.php
* @param string[] &$array <p>Array of strings to sort.</p>
* @param int $flags [optional] <p>
* Optional sorting type, one of the following:
* <b>Collator::SORT_REGULAR</b>
* - compare items normally (don't change types)
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function asort(
array &$array,
#[TypeAware(['8.0' => 'int'], default: '')] #[EV([Collator::SORT_REGULAR])] $flags = null
) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Get collation attribute value
* @link https://php.net/manual/en/collator.getattribute.php
* @param int $attribute <p>
* Attribute to get value for.
* </p>
* @return int|false Attribute value, or boolean <b>FALSE</b> on error.
*/
#[Pure]
public function getAttribute(#[TypeAware(['8.0' => 'int'], default: '')] $attribute) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Set collation attribute
* @link https://php.net/manual/en/collator.setattribute.php
* @param int $attribute <p>Attribute.</p>
* @param int $value <p>
* Attribute value.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function setAttribute(
#[TypeAware(['8.0' => 'int'], default: '')] $attribute,
#[TypeAware(['8.0' => 'int'], default: '')] $value
) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Get current collation strength
* @link https://php.net/manual/en/collator.getstrength.php
* @return int|false current collation strength, or boolean <b>FALSE</b> on error.
*/
#[Pure]
public function getStrength() {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Set collation strength
* @link https://php.net/manual/en/collator.setstrength.php
* @param int $strength <p>Strength to set.</p>
* <p>
* Possible values are:
* <b>Collator::PRIMARY</b>
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
public function setStrength(#[TypeAware(['8.0' => 'int'], default: '')] #[EV([Collator::PRIMARY])] $strength) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Get collator's last error code
* @link https://php.net/manual/en/collator.geterrorcode.php
* @return int Error code returned by the last Collator API function call.
*/
#[Pure]
public function getErrorCode() {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Get the locale name of the collator
* @link https://php.net/manual/en/collator.getlocale.php
* @param int $type [optional] <p>
* You can choose between valid and actual locale (
* <b>Locale::VALID_LOCALE</b> and
* <b>Locale::ACTUAL_LOCALE</b>,
* respectively). The default is the actual locale.
* </p>
* @return string Real locale name from which the collation data comes. If the collator was
* instantiated from rules or an error occurred, returns
* boolean <b>FALSE</b>.
*/
#[Pure]
public function getLocale(
#[TypeAware(['8.0' => 'int'], default: '')]
#[EV([Locale::VALID_LOCALE, Locale::ACTUAL_LOCALE])]
$type = null
) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Get text for collator's last error code
* @link https://php.net/manual/en/collator.geterrormessage.php
* @return string Description of an error occurred in the last Collator API function call.
*/
#[Pure]
public function getErrorMessage() {}
/**
* (No version information available, might only be in SVN)<br/>
* Get sorting key for a string
* @link https://php.net/manual/en/collator.getsortkey.php
* @param string $string <p>
* The string to produce the key from.
* </p>
* @return string the collation key for the string. Collation keys can be compared directly instead of strings.
*/
#[Pure]
public function getSortKey(#[TypeAware(['8.0' => 'string'], default: '')] $string) {}
}
class NumberFormatter
{
public const CURRENCY_ACCOUNTING = 12;
/**
* Decimal format defined by pattern
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PATTERN_DECIMAL = 0;
/**
* Decimal format
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const DECIMAL = 1;
/**
* Currency format
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const CURRENCY = 2;
/**
* Percent format
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PERCENT = 3;
/**
* Scientific format
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const SCIENTIFIC = 4;
/**
* Spellout rule-based format
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const SPELLOUT = 5;
/**
* Ordinal rule-based format
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const ORDINAL = 6;
/**
* Duration rule-based format
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const DURATION = 7;
/**
* Rule-based format defined by pattern
* @link https://php.net/manual/en/class.locale.php#intl.locale-constants
*/
public const PATTERN_RULEBASED = 9;
/**
* Alias for PATTERN_DECIMAL
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const IGNORE = 0;
/**
* Default format for the locale
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const DEFAULT_STYLE = 1;
/**
* Rounding mode to round towards positive infinity.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const ROUND_CEILING = 0;
/**
* Rounding mode to round towards negative infinity.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const ROUND_FLOOR = 1;
/**
* Rounding mode to round towards zero.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const ROUND_DOWN = 2;
/**
* Rounding mode to round away from zero.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const ROUND_UP = 3;
/**
* Rounding mode to round towards the "nearest neighbor" unless both
* neighbors are equidistant, in which case, round towards the even
* neighbor.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const ROUND_HALFEVEN = 4;
/**
* Rounding mode to round towards "nearest neighbor" unless both neighbors
* are equidistant, in which case round down.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const ROUND_HALFDOWN = 5;
/**
* Rounding mode to round towards "nearest neighbor" unless both neighbors
* are equidistant, in which case round up.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const ROUND_HALFUP = 6;
/**
* Pad characters inserted before the prefix.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PAD_BEFORE_PREFIX = 0;
/**
* Pad characters inserted after the prefix.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PAD_AFTER_PREFIX = 1;
/**
* Pad characters inserted before the suffix.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PAD_BEFORE_SUFFIX = 2;
/**
* Pad characters inserted after the suffix.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PAD_AFTER_SUFFIX = 3;
/**
* Parse integers only.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PARSE_INT_ONLY = 0;
/**
* Use grouping separator.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const GROUPING_USED = 1;
/**
* Always show decimal point.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const DECIMAL_ALWAYS_SHOWN = 2;
/**
* Maximum integer digits.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const MAX_INTEGER_DIGITS = 3;
/**
* Minimum integer digits.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const MIN_INTEGER_DIGITS = 4;
/**
* Integer digits.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const INTEGER_DIGITS = 5;
/**
* Maximum fraction digits.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const MAX_FRACTION_DIGITS = 6;
/**
* Minimum fraction digits.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const MIN_FRACTION_DIGITS = 7;
/**
* Fraction digits.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const FRACTION_DIGITS = 8;
/**
* Multiplier.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const MULTIPLIER = 9;
/**
* Grouping size.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const GROUPING_SIZE = 10;
/**
* Rounding Mode.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const ROUNDING_MODE = 11;
/**
* Rounding increment.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const ROUNDING_INCREMENT = 12;
/**
* The width to which the output of format() is padded.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const FORMAT_WIDTH = 13;
/**
* The position at which padding will take place. See pad position
* constants for possible argument values.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PADDING_POSITION = 14;
/**
* Secondary grouping size.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const SECONDARY_GROUPING_SIZE = 15;
/**
* Use significant digits.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const SIGNIFICANT_DIGITS_USED = 16;
/**
* Minimum significant digits.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const MIN_SIGNIFICANT_DIGITS = 17;
/**
* Maximum significant digits.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const MAX_SIGNIFICANT_DIGITS = 18;
/**
* Lenient parse mode used by rule-based formats.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const LENIENT_PARSE = 19;
/**
* Positive prefix.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const POSITIVE_PREFIX = 0;
/**
* Positive suffix.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const POSITIVE_SUFFIX = 1;
/**
* Negative prefix.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const NEGATIVE_PREFIX = 2;
/**
* Negative suffix.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const NEGATIVE_SUFFIX = 3;
/**
* The character used to pad to the format width.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PADDING_CHARACTER = 4;
/**
* The ISO currency code.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const CURRENCY_CODE = 5;
/**
* The default rule set. This is only available with rule-based
* formatters.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const DEFAULT_RULESET = 6;
/**
* The public rule sets. This is only available with rule-based
* formatters. This is a read-only attribute. The public rulesets are
* returned as a single string, with each ruleset name delimited by ';'
* (semicolon).
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PUBLIC_RULESETS = 7;
/**
* The decimal separator.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const DECIMAL_SEPARATOR_SYMBOL = 0;
/**
* The grouping separator.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const GROUPING_SEPARATOR_SYMBOL = 1;
/**
* The pattern separator.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PATTERN_SEPARATOR_SYMBOL = 2;
/**
* The percent sign.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PERCENT_SYMBOL = 3;
/**
* Zero.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const ZERO_DIGIT_SYMBOL = 4;
/**
* Character representing a digit in the pattern.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const DIGIT_SYMBOL = 5;
/**
* The minus sign.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const MINUS_SIGN_SYMBOL = 6;
/**
* The plus sign.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PLUS_SIGN_SYMBOL = 7;
/**
* The currency symbol.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const CURRENCY_SYMBOL = 8;
/**
* The international currency symbol.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const INTL_CURRENCY_SYMBOL = 9;
/**
* The monetary separator.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const MONETARY_SEPARATOR_SYMBOL = 10;
/**
* The exponential symbol.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const EXPONENTIAL_SYMBOL = 11;
/**
* Per mill symbol.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PERMILL_SYMBOL = 12;
/**
* Escape padding character.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const PAD_ESCAPE_SYMBOL = 13;
/**
* Infinity symbol.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const INFINITY_SYMBOL = 14;
/**
* Not-a-number symbol.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const NAN_SYMBOL = 15;
/**
* Significant digit symbol.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const SIGNIFICANT_DIGIT_SYMBOL = 16;
/**
* The monetary grouping separator.
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const MONETARY_GROUPING_SEPARATOR_SYMBOL = 17;
/**
* Derive the type from variable type
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const TYPE_DEFAULT = 0;
/**
* Format/parse as 32-bit integer
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const TYPE_INT32 = 1;
/**
* Format/parse as 64-bit integer
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const TYPE_INT64 = 2;
/**
* Format/parse as floating point value
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const TYPE_DOUBLE = 3;
/**
* Format/parse as currency value
* @link https://php.net/manual/en/class.numberformatter.php#intl.numberformatter-constants
*/
public const TYPE_CURRENCY = 4;
/**
* @link https://www.php.net/manual/en/class.numberformatter.php
* @param string $locale
* @param int $style
* @param string $pattern [optional]
*/
#[Pure]
public function __construct(
#[TypeAware(['8.0' => 'string'], default: '')] $locale,
#[TypeAware(['8.0' => 'int'], default: '')] $style,
#[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = null
) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Create a number formatter
* @link https://php.net/manual/en/numberformatter.create.php
* @param string $locale <p>
* Locale in which the number would be formatted (locale name, e.g. en_CA).
* </p>
* @param int $style <p>
* Style of the formatting, one of the
* format style constants. If
* <b>NumberFormatter::PATTERN_DECIMAL</b>
* or <b>NumberFormatter::PATTERN_RULEBASED</b>
* is passed then the number format is opened using the given pattern,
* which must conform to the syntax described in
* ICU DecimalFormat
* documentation or
* ICU RuleBasedNumberFormat
* documentation, respectively.
* </p>
* @param string $pattern [optional] <p>
* Pattern string if the chosen style requires a pattern.
* </p>
* @return NumberFormatter|false <b>NumberFormatter</b> object or <b>FALSE</b> on error.
*/
public static function create(
#[TypeAware(['8.0' => 'string'], default: '')] $locale,
#[TypeAware(['8.0' => 'int'], default: '')] #[EV([NumberFormatter::PATTERN_DECIMAL, NumberFormatter::PATTERN_RULEBASED])] $style,
#[TypeAware(['8.0' => 'string|null'], default: '')] $pattern = null
) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Format a number
* @link https://php.net/manual/en/numberformatter.format.php
* @param int|float $num <p>
* The value to format. Can be integer or float,
* other values will be converted to a numeric value.
* </p>
* @param int $type [optional] <p>
* The
* formatting type to use.
* </p>
* @return string|false the string containing formatted value, or <b>FALSE</b> on error.
*/
#[Pure]
public function format(
#[TypeAware(['8.0' => 'int|float'], default: '')] $num,
#[TypeAware(['8.0' => 'int'], default: '')] $type = null
) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Parse a number
* @link https://php.net/manual/en/numberformatter.parse.php
* @param string $string
* @param int $type [optional] <p>
* The
* formatting type to use. By default,
* <b>NumberFormatter::TYPE_DOUBLE</b> is used.
* </p>
* @param int &$offset [optional] <p>
* Offset in the string at which to begin parsing. On return, this value
* will hold the offset at which parsing ended.
* </p>
* @return mixed The value of the parsed number or <b>FALSE</b> on error.
*/
public function parse(
#[TypeAware(['8.0' => 'string'], default: '')] $string,
#[TypeAware(['8.0' => 'int'], default: '')] $type = NumberFormatter::TYPE_DOUBLE,
&$offset = null
) {}
/**
* (PHP 5 >= 5.3.0, PECL intl >= 1.0.0)<br/>
* Format a currency value
* @link https://php.net/manual/en/numberformatter.formatcurrency.php
* @param float $amount <p>
* The numeric currency value.
* </p>
* @param string $currency <p>
* The 3-letter ISO 4217 currency code indicating the currency to use.
* </p>
* @return string String representing the formatted currency value.
*/
#[Pure]
public function formatCurrency(
#[TypeAware(['8.0' => 'float'], default: '')] $amount,