Skip to content

Commit 9ad7844

Browse files
authored
Typed constants in Intl extenstion (#12360)
1 parent dff8679 commit 9ad7844

27 files changed

+2801
-5562
lines changed

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ PHP 8.4 UPGRADE NOTES
140140
9. Other Changes to Extensions
141141
========================================
142142

143+
- Intl:
144+
. The class constants are typed now.
145+
143146
- PDO:
144147
. The class constants are typed now.
145148

ext/intl/breakiterator/breakiterator.stub.php

Lines changed: 41 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -5,104 +5,47 @@
55
/** @not-serializable */
66
class IntlBreakIterator implements IteratorAggregate
77
{
8-
/**
9-
* @var int
10-
* @cvalue BreakIterator::DONE
11-
*/
12-
public const DONE = UNKNOWN;
13-
14-
/**
15-
* @var int
16-
* @cvalue UBRK_WORD_NONE
17-
*/
18-
public const WORD_NONE = UNKNOWN;
19-
/**
20-
* @var int
21-
* @cvalue UBRK_WORD_NONE_LIMIT
22-
*/
23-
public const WORD_NONE_LIMIT = UNKNOWN;
24-
/**
25-
* @var int
26-
* @cvalue UBRK_WORD_NUMBER
27-
*/
28-
public const WORD_NUMBER = UNKNOWN;
29-
/**
30-
* @var int
31-
* @cvalue UBRK_WORD_NUMBER_LIMIT
32-
*/
33-
public const WORD_NUMBER_LIMIT = UNKNOWN;
34-
/**
35-
* @var int
36-
* @cvalue UBRK_WORD_LETTER
37-
*/
38-
public const WORD_LETTER = UNKNOWN;
39-
/**
40-
* @var int
41-
* @cvalue UBRK_WORD_LETTER_LIMIT
42-
*/
43-
public const WORD_LETTER_LIMIT = UNKNOWN;
44-
/**
45-
* @var int
46-
* @cvalue UBRK_WORD_KANA
47-
*/
48-
public const WORD_KANA = UNKNOWN;
49-
/**
50-
* @var int
51-
* @cvalue UBRK_WORD_KANA_LIMIT
52-
*/
53-
public const WORD_KANA_LIMIT = UNKNOWN;
54-
/**
55-
* @var int
56-
* @cvalue UBRK_WORD_IDEO
57-
*/
58-
public const WORD_IDEO = UNKNOWN;
59-
/**
60-
* @var int
61-
* @cvalue UBRK_WORD_IDEO_LIMIT
62-
*/
63-
public const WORD_IDEO_LIMIT = UNKNOWN;
64-
65-
/**
66-
* @var int
67-
* @cvalue UBRK_LINE_SOFT
68-
*/
69-
public const LINE_SOFT = UNKNOWN;
70-
/**
71-
* @var int
72-
* @cvalue UBRK_LINE_SOFT_LIMIT
73-
*/
74-
public const LINE_SOFT_LIMIT = UNKNOWN;
75-
/**
76-
* @var int
77-
* @cvalue UBRK_LINE_HARD
78-
*/
79-
public const LINE_HARD = UNKNOWN;
80-
/**
81-
* @var int
82-
* @cvalue UBRK_LINE_HARD_LIMIT
83-
*/
84-
public const LINE_HARD_LIMIT = UNKNOWN;
85-
86-
/**
87-
* @var int
88-
* @cvalue UBRK_SENTENCE_TERM
89-
*/
90-
public const SENTENCE_TERM = UNKNOWN;
91-
/**
92-
* @var int
93-
* @cvalue UBRK_SENTENCE_TERM_LIMIT
94-
*/
95-
public const SENTENCE_TERM_LIMIT = UNKNOWN;
96-
/**
97-
* @var int
98-
* @cvalue UBRK_SENTENCE_SEP
99-
*/
100-
public const SENTENCE_SEP = UNKNOWN;
101-
/**
102-
* @var int
103-
* @cvalue UBRK_SENTENCE_SEP_LIMIT
104-
*/
105-
public const SENTENCE_SEP_LIMIT = UNKNOWN;
8+
/** @cvalue BreakIterator::DONE */
9+
public const int DONE = UNKNOWN;
10+
11+
/** @cvalue UBRK_WORD_NONE */
12+
public const int WORD_NONE = UNKNOWN;
13+
/** @cvalue UBRK_WORD_NONE_LIMIT */
14+
public const int WORD_NONE_LIMIT = UNKNOWN;
15+
/** @cvalue UBRK_WORD_NUMBER */
16+
public const int WORD_NUMBER = UNKNOWN;
17+
/** @cvalue UBRK_WORD_NUMBER_LIMIT */
18+
public const int WORD_NUMBER_LIMIT = UNKNOWN;
19+
/** @cvalue UBRK_WORD_LETTER */
20+
public const int WORD_LETTER = UNKNOWN;
21+
/** @cvalue UBRK_WORD_LETTER_LIMIT */
22+
public const int WORD_LETTER_LIMIT = UNKNOWN;
23+
/** @cvalue UBRK_WORD_KANA */
24+
public const int WORD_KANA = UNKNOWN;
25+
/** @cvalue UBRK_WORD_KANA_LIMIT */
26+
public const int WORD_KANA_LIMIT = UNKNOWN;
27+
/** @cvalue UBRK_WORD_IDEO */
28+
public const int WORD_IDEO = UNKNOWN;
29+
/** @cvalue UBRK_WORD_IDEO_LIMIT */
30+
public const int WORD_IDEO_LIMIT = UNKNOWN;
31+
32+
/** @cvalue UBRK_LINE_SOFT */
33+
public const int LINE_SOFT = UNKNOWN;
34+
/** @cvalue UBRK_LINE_SOFT_LIMIT */
35+
public const int LINE_SOFT_LIMIT = UNKNOWN;
36+
/** @cvalue UBRK_LINE_HARD */
37+
public const int LINE_HARD = UNKNOWN;
38+
/** @cvalue UBRK_LINE_HARD_LIMIT */
39+
public const int LINE_HARD_LIMIT = UNKNOWN;
40+
41+
/** @cvalue UBRK_SENTENCE_TERM */
42+
public const int SENTENCE_TERM = UNKNOWN;
43+
/** @cvalue UBRK_SENTENCE_TERM_LIMIT */
44+
public const int SENTENCE_TERM_LIMIT = UNKNOWN;
45+
/** @cvalue UBRK_SENTENCE_SEP */
46+
public const int SENTENCE_SEP = UNKNOWN;
47+
/** @cvalue UBRK_SENTENCE_SEP_LIMIT */
48+
public const int SENTENCE_SEP_LIMIT = UNKNOWN;
10649

10750
/** @tentative-return-type */
10851
public static function createCharacterInstance(?string $locale = null): ?IntlBreakIterator {}

ext/intl/breakiterator/breakiterator_arginfo.h

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/intl/breakiterator/breakiterator_iterators.stub.php

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,12 @@
55
/** @not-serializable */
66
class IntlPartsIterator extends IntlIterator
77
{
8-
/**
9-
* @var int
10-
* @cvalue PARTS_ITERATOR_KEY_SEQUENTIAL
11-
*/
12-
public const KEY_SEQUENTIAL = UNKNOWN;
13-
/**
14-
* @var int
15-
* @cvalue PARTS_ITERATOR_KEY_LEFT
16-
*/
17-
public const KEY_LEFT = UNKNOWN;
18-
/**
19-
* @var int
20-
* @cvalue PARTS_ITERATOR_KEY_RIGHT
21-
*/
22-
public const KEY_RIGHT = UNKNOWN;
8+
/** @cvalue PARTS_ITERATOR_KEY_SEQUENTIAL */
9+
public const int KEY_SEQUENTIAL = UNKNOWN;
10+
/** @cvalue PARTS_ITERATOR_KEY_LEFT */
11+
public const int KEY_LEFT = UNKNOWN;
12+
/** @cvalue PARTS_ITERATOR_KEY_RIGHT */
13+
public const int KEY_RIGHT = UNKNOWN;
2314

2415
/** @tentative-return-type */
2516
public function getBreakIterator(): IntlBreakIterator {}

ext/intl/breakiterator/breakiterator_iterators_arginfo.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)