Skip to content

Typed constants in Intl extenstion #12360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ PHP 8.4 UPGRADE NOTES
9. Other Changes to Extensions
========================================

- Intl:
. The class constants are typed now.

- PDO:
. The class constants are typed now.

Expand Down
139 changes: 41 additions & 98 deletions ext/intl/breakiterator/breakiterator.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,104 +5,47 @@
/** @not-serializable */
class IntlBreakIterator implements IteratorAggregate
{
/**
* @var int
* @cvalue BreakIterator::DONE
*/
public const DONE = UNKNOWN;

/**
* @var int
* @cvalue UBRK_WORD_NONE
*/
public const WORD_NONE = UNKNOWN;
/**
* @var int
* @cvalue UBRK_WORD_NONE_LIMIT
*/
public const WORD_NONE_LIMIT = UNKNOWN;
/**
* @var int
* @cvalue UBRK_WORD_NUMBER
*/
public const WORD_NUMBER = UNKNOWN;
/**
* @var int
* @cvalue UBRK_WORD_NUMBER_LIMIT
*/
public const WORD_NUMBER_LIMIT = UNKNOWN;
/**
* @var int
* @cvalue UBRK_WORD_LETTER
*/
public const WORD_LETTER = UNKNOWN;
/**
* @var int
* @cvalue UBRK_WORD_LETTER_LIMIT
*/
public const WORD_LETTER_LIMIT = UNKNOWN;
/**
* @var int
* @cvalue UBRK_WORD_KANA
*/
public const WORD_KANA = UNKNOWN;
/**
* @var int
* @cvalue UBRK_WORD_KANA_LIMIT
*/
public const WORD_KANA_LIMIT = UNKNOWN;
/**
* @var int
* @cvalue UBRK_WORD_IDEO
*/
public const WORD_IDEO = UNKNOWN;
/**
* @var int
* @cvalue UBRK_WORD_IDEO_LIMIT
*/
public const WORD_IDEO_LIMIT = UNKNOWN;

/**
* @var int
* @cvalue UBRK_LINE_SOFT
*/
public const LINE_SOFT = UNKNOWN;
/**
* @var int
* @cvalue UBRK_LINE_SOFT_LIMIT
*/
public const LINE_SOFT_LIMIT = UNKNOWN;
/**
* @var int
* @cvalue UBRK_LINE_HARD
*/
public const LINE_HARD = UNKNOWN;
/**
* @var int
* @cvalue UBRK_LINE_HARD_LIMIT
*/
public const LINE_HARD_LIMIT = UNKNOWN;

/**
* @var int
* @cvalue UBRK_SENTENCE_TERM
*/
public const SENTENCE_TERM = UNKNOWN;
/**
* @var int
* @cvalue UBRK_SENTENCE_TERM_LIMIT
*/
public const SENTENCE_TERM_LIMIT = UNKNOWN;
/**
* @var int
* @cvalue UBRK_SENTENCE_SEP
*/
public const SENTENCE_SEP = UNKNOWN;
/**
* @var int
* @cvalue UBRK_SENTENCE_SEP_LIMIT
*/
public const SENTENCE_SEP_LIMIT = UNKNOWN;
/** @cvalue BreakIterator::DONE */
public const int DONE = UNKNOWN;

/** @cvalue UBRK_WORD_NONE */
public const int WORD_NONE = UNKNOWN;
/** @cvalue UBRK_WORD_NONE_LIMIT */
public const int WORD_NONE_LIMIT = UNKNOWN;
/** @cvalue UBRK_WORD_NUMBER */
public const int WORD_NUMBER = UNKNOWN;
/** @cvalue UBRK_WORD_NUMBER_LIMIT */
public const int WORD_NUMBER_LIMIT = UNKNOWN;
/** @cvalue UBRK_WORD_LETTER */
public const int WORD_LETTER = UNKNOWN;
/** @cvalue UBRK_WORD_LETTER_LIMIT */
public const int WORD_LETTER_LIMIT = UNKNOWN;
/** @cvalue UBRK_WORD_KANA */
public const int WORD_KANA = UNKNOWN;
/** @cvalue UBRK_WORD_KANA_LIMIT */
public const int WORD_KANA_LIMIT = UNKNOWN;
/** @cvalue UBRK_WORD_IDEO */
public const int WORD_IDEO = UNKNOWN;
/** @cvalue UBRK_WORD_IDEO_LIMIT */
public const int WORD_IDEO_LIMIT = UNKNOWN;

/** @cvalue UBRK_LINE_SOFT */
public const int LINE_SOFT = UNKNOWN;
/** @cvalue UBRK_LINE_SOFT_LIMIT */
public const int LINE_SOFT_LIMIT = UNKNOWN;
/** @cvalue UBRK_LINE_HARD */
public const int LINE_HARD = UNKNOWN;
/** @cvalue UBRK_LINE_HARD_LIMIT */
public const int LINE_HARD_LIMIT = UNKNOWN;

/** @cvalue UBRK_SENTENCE_TERM */
public const int SENTENCE_TERM = UNKNOWN;
/** @cvalue UBRK_SENTENCE_TERM_LIMIT */
public const int SENTENCE_TERM_LIMIT = UNKNOWN;
/** @cvalue UBRK_SENTENCE_SEP */
public const int SENTENCE_SEP = UNKNOWN;
/** @cvalue UBRK_SENTENCE_SEP_LIMIT */
public const int SENTENCE_SEP_LIMIT = UNKNOWN;

/** @tentative-return-type */
public static function createCharacterInstance(?string $locale = null): ?IntlBreakIterator {}
Expand Down
40 changes: 20 additions & 20 deletions ext/intl/breakiterator/breakiterator_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 6 additions & 15 deletions ext/intl/breakiterator/breakiterator_iterators.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@
/** @not-serializable */
class IntlPartsIterator extends IntlIterator
{
/**
* @var int
* @cvalue PARTS_ITERATOR_KEY_SEQUENTIAL
*/
public const KEY_SEQUENTIAL = UNKNOWN;
/**
* @var int
* @cvalue PARTS_ITERATOR_KEY_LEFT
*/
public const KEY_LEFT = UNKNOWN;
/**
* @var int
* @cvalue PARTS_ITERATOR_KEY_RIGHT
*/
public const KEY_RIGHT = UNKNOWN;
/** @cvalue PARTS_ITERATOR_KEY_SEQUENTIAL */
public const int KEY_SEQUENTIAL = UNKNOWN;
/** @cvalue PARTS_ITERATOR_KEY_LEFT */
public const int KEY_LEFT = UNKNOWN;
/** @cvalue PARTS_ITERATOR_KEY_RIGHT */
public const int KEY_RIGHT = UNKNOWN;

/** @tentative-return-type */
public function getBreakIterator(): IntlBreakIterator {}
Expand Down
8 changes: 4 additions & 4 deletions ext/intl/breakiterator/breakiterator_iterators_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading