-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add various stubs for Intl - part 2 #4826
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
class Collator | ||
{ | ||
public function __construct(string $locale) {} | ||
|
||
/** @return Collator|null */ | ||
public static function create(string $locale) {} | ||
|
||
/** @return int|false */ | ||
public function compare(string $str1, string $str2) {} | ||
|
||
/** @return bool */ | ||
public function sort(array &$arr, $sort_flag = Collator::SORT_REGULAR) {} | ||
|
||
/** @return bool */ | ||
public function sortWithSortKeys(array &$arr) {} | ||
|
||
/** @return bool */ | ||
public function asort(array &$arr, int $sort_flag = Collator::SORT_REGULAR) {} | ||
|
||
/** @return int|false */ | ||
public function getAttribute(int $attr) {} | ||
|
||
/** @return bool */ | ||
public function setAttribute(int $attr, int $val) {} | ||
|
||
/** @return int */ | ||
public function getStrength() {} | ||
|
||
/** @return bool */ | ||
public function setStrength(int $strength) {} | ||
|
||
/** @return string|false */ | ||
public function getLocale(int $type) {} | ||
|
||
/** @return int|false */ | ||
public function getErrorCode() {} | ||
|
||
/** @return string|false */ | ||
public function getErrorMessage() {} | ||
|
||
/** @return string|false */ | ||
public function getSortKey(string $str) {} | ||
} | ||
|
||
function collator_create(string $locale): ?Collator {} | ||
|
||
function collator_compare(Collator $object, string $str1, string $str2): int|false {} | ||
|
||
function collator_get_attribute(Collator $object, int $attr): int|false {} | ||
|
||
function collator_set_attribute(Collator $object, int $attr, int $val): bool {} | ||
|
||
function collator_get_strength(Collator $object): int {} | ||
|
||
function collator_set_strength(Collator $object, int $strength): bool {} | ||
|
||
function collator_sort(Collator $object, array &$arr, int $sort_flag = Collator::SORT_REGULAR): bool {} | ||
|
||
function collator_sort_with_sort_keys(Collator $object, array &$arr): bool {} | ||
|
||
function collator_asort(Collator $object, array &$arr, int $sort_flag = Collator::SORT_REGULAR): bool {} | ||
|
||
function collator_get_locale(Collator $object, int $type): string|false {} | ||
|
||
function collator_get_error_code(Collator $object): int|false {} | ||
|
||
function collator_get_error_message(Collator $object): string|false {} | ||
|
||
function collator_get_sort_key(Collator $object, string $str): string|false {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
/* This is a generated file, edit the .stub.php file instead. */ | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator___construct, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
#define arginfo_class_Collator_create arginfo_class_Collator___construct | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_compare, 0, 0, 2) | ||
ZEND_ARG_TYPE_INFO(0, str1, IS_STRING, 0) | ||
ZEND_ARG_TYPE_INFO(0, str2, IS_STRING, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_sort, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(1, arr, IS_ARRAY, 0) | ||
ZEND_ARG_INFO(0, sort_flag) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_sortWithSortKeys, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(1, arr, IS_ARRAY, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_asort, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(1, arr, IS_ARRAY, 0) | ||
ZEND_ARG_TYPE_INFO(0, sort_flag, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_getAttribute, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_setAttribute, 0, 0, 2) | ||
ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) | ||
ZEND_ARG_TYPE_INFO(0, val, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_getStrength, 0, 0, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_setStrength, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(0, strength, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_getLocale, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
#define arginfo_class_Collator_getErrorCode arginfo_class_Collator_getStrength | ||
|
||
#define arginfo_class_Collator_getErrorMessage arginfo_class_Collator_getStrength | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator_getSortKey, 0, 0, 1) | ||
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_collator_create, 0, 1, Collator, 1) | ||
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_collator_compare, 0, 3, MAY_BE_LONG|MAY_BE_FALSE) | ||
ZEND_ARG_OBJ_INFO(0, object, Collator, 0) | ||
ZEND_ARG_TYPE_INFO(0, str1, IS_STRING, 0) | ||
ZEND_ARG_TYPE_INFO(0, str2, IS_STRING, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_collator_get_attribute, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) | ||
ZEND_ARG_OBJ_INFO(0, object, Collator, 0) | ||
ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_collator_set_attribute, 0, 3, _IS_BOOL, 0) | ||
ZEND_ARG_OBJ_INFO(0, object, Collator, 0) | ||
ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0) | ||
ZEND_ARG_TYPE_INFO(0, val, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_collator_get_strength, 0, 1, IS_LONG, 0) | ||
ZEND_ARG_OBJ_INFO(0, object, Collator, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_collator_set_strength, 0, 2, _IS_BOOL, 0) | ||
ZEND_ARG_OBJ_INFO(0, object, Collator, 0) | ||
ZEND_ARG_TYPE_INFO(0, strength, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_collator_sort, 0, 2, _IS_BOOL, 0) | ||
ZEND_ARG_OBJ_INFO(0, object, Collator, 0) | ||
ZEND_ARG_TYPE_INFO(1, arr, IS_ARRAY, 0) | ||
ZEND_ARG_TYPE_INFO(0, sort_flag, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_collator_sort_with_sort_keys, 0, 2, _IS_BOOL, 0) | ||
ZEND_ARG_OBJ_INFO(0, object, Collator, 0) | ||
ZEND_ARG_TYPE_INFO(1, arr, IS_ARRAY, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
#define arginfo_collator_asort arginfo_collator_sort | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_collator_get_locale, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) | ||
ZEND_ARG_OBJ_INFO(0, object, Collator, 0) | ||
ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_collator_get_error_code, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) | ||
ZEND_ARG_OBJ_INFO(0, object, Collator, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_collator_get_error_message, 0, 1, MAY_BE_STRING|MAY_BE_FALSE) | ||
ZEND_ARG_OBJ_INFO(0, object, Collator, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_collator_get_sort_key, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) | ||
ZEND_ARG_OBJ_INFO(0, object, Collator, 0) | ||
ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) | ||
ZEND_END_ARG_INFO() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
class IntlIterator implements Iterator | ||
{ | ||
public function current() {} | ||
|
||
public function key() {} | ||
|
||
public function next() {} | ||
|
||
public function rewind() {} | ||
|
||
public function valid() {} | ||
} | ||
|
||
function intl_get_error_code(): int {} | ||
|
||
function intl_get_error_message(): string {} | ||
|
||
function intl_is_failure(int $error_code): bool {} | ||
|
||
function intl_error_name(int $error_code): string {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* This is a generated file, edit the .stub.php file instead. */ | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlIterator_current, 0, 0, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
#define arginfo_class_IntlIterator_key arginfo_class_IntlIterator_current | ||
|
||
#define arginfo_class_IntlIterator_next arginfo_class_IntlIterator_current | ||
|
||
#define arginfo_class_IntlIterator_rewind arginfo_class_IntlIterator_current | ||
|
||
#define arginfo_class_IntlIterator_valid arginfo_class_IntlIterator_current | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_intl_get_error_code, 0, 0, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_intl_get_error_message, 0, 0, IS_STRING, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_intl_is_failure, 0, 1, _IS_BOOL, 0) | ||
ZEND_ARG_TYPE_INFO(0, error_code, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_intl_error_name, 0, 1, IS_STRING, 0) | ||
ZEND_ARG_TYPE_INFO(0, error_code, IS_LONG, 0) | ||
ZEND_END_ARG_INFO() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL. I wanted to add this as general core functionality, didn't know it exists in intl.