summaryrefslogtreecommitdiff
path: root/ext/intl
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-8.0'Christoph M. Becker2021-02-172-0/+20
|\ | | | | | | | | * PHP-8.0: Fix #80763: msgfmt_format() does not accept DateTime references
| * Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-02-172-0/+20
| |\ | | | | | | | | | | | | * PHP-7.4: Fix #80763: msgfmt_format() does not accept DateTime references
| | * Fix #80763: msgfmt_format() does not accept DateTime referencesChristoph M. Becker2021-02-172-0/+20
| | | | | | | | | | | | | | | | | | `intl_zval_to_millis()` needs to cater to references. Closes GH-6707.
| * | Add missing classes to stubsMáté Kocsis2021-02-092-1/+10
| | |
* | | Improve class entry generationMáté Kocsis2021-02-1617-37/+20
| | | | | | | | | | | | Related to GH-6701
* | | Use typed proprety for Transliterator::$idNikita Popov2021-02-153-31/+11
| | | | | | | | | | | | | | | | | | | | | This is a read-only property for which Transliterator internally assigns a string value. Also clean up the code handling this property a bit.
* | | Deprecate passing null to non-nullable arg of internal functionNikita Popov2021-02-119-16/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deprecates passing null to non-nullable scale arguments of internal functions, with the eventual goal of making the behavior consistent with userland functions, where null is never accepted for non-nullable arguments. This change is expected to cause quite a lot of fallout. In most cases, calling code should be adjusted to avoid passing null. In some cases, PHP should be adjusted to make some function arguments nullable. I have already fixed a number of functions before landing this, but feel free to file a bug if you encounter a function that doesn't accept null, but probably should. (The rule of thumb for this to be applicable is that the function must have special behavior for 0 or "", which is distinct from the natural behavior of the parameter.) RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg Closes GH-6475.
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-097-15/+15
|\ \ \ | |/ / | | | | | | | | | | | | | | | * PHP-8.0: Use E_ERROR to report arginfo/zpp mismatch Make NumberFormatter ctor $pattern nullable Make IntlDateFormatter ctor $pattern nullable
| * | Make NumberFormatter ctor $pattern nullableNikita Popov2021-02-095-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Whether the pattern is needed depends on the used style. If no pattern is needed, null is a more sensible value than an empty string. fixup
| * | Make IntlDateFormatter ctor $pattern nullableNikita Popov2021-02-094-8/+8
| | | | | | | | | | | | | | | The implementation already made this argument nullable, but it was not reflected in the stub.
* | | Generate ext/intl class entries from stubsMáté Kocsis2021-02-0944-157/+276
| | | | | | | | | | | | Closes GH-6670
* | | Implicitly enable function entry generation when class entry generation is ↵Máté Kocsis2021-02-096-15/+6
| | | | | | | | | | | | | | | | | | enabled Closes GH-6675
* | | Add support for generating class entries from stubsMáté Kocsis2021-01-269-41/+67
| | | | | | | | | | | | | | | | | | Closes GH-6289 Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | | Merge branch 'PHP-8.0'Nikita Popov2021-01-192-1/+8
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fixed bug #80644: ResourceBundle::get() doesn't reset error state
| * | Fixed bug #80644: ResourceBundle::get() doesn't reset error stateNikita Popov2021-01-192-1/+8
| | |
* | | Merge branch 'PHP-8.0'Nikita Popov2021-01-184-4/+4
|\ \ \ | |/ / | | | | | | | | | | | | | | | * PHP-8.0: Sync datefmt_get_calendar_object signature Sync intlcal_create_instance() and IntlCalendar::createInstance() Sync date_diff and DateTime::diff return type
| * | Sync datefmt_get_calendar_object signatureNikita Popov2021-01-182-2/+2
| | | | | | | | | | | | | | | In this case, it's only a matter of using the same type order in both cases.
| * | Sync intlcal_create_instance() and IntlCalendar::createInstance()Nikita Popov2021-01-182-2/+2
| | | | | | | | | | | | | | | | | | Remove the explicit mention of IntlGregorianCalendar in the latter. It is a subclass of IntlCalendar, and as such covered if only IntlCalendar is used as the return type.
* | | Replace zend_bool uses with boolNikita Popov2021-01-1516-31/+31
| | | | | | | | | | | | | | | | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* | | Make convert_to_*_ex simple aliases of convert_to_*Nikita Popov2021-01-142-3/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Historically, the _ex variants separated the zval first, if a conversion was necessary. This distinction no longer makes sense since PHP 7. The only difference that was still left is that _ex checked whether the type is the same first, but the usage of these macros did not actually distinguish on whether such an inlined check is valuable or not in a given context. Also drop the unused convert_to_explicit_type macros.
* | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-11-271-10/+11
|\ \ | |/ | | | | | | * PHP-7.4: Fixed bug #80425
| * Fixed bug #80425Nikita Popov2020-11-271-10/+11
| | | | | | | | | | | | Rename the methods in MessageFormatAdapter to make sure they don't clash with anything defined by icu itself, which may be a problem if icu is linked statically.
* | Use true/false instead of TRUE/FALSE in intlNikita Popov2020-11-097-18/+18
| | | | | | | | And drop the U_DEFINE_TRUE_AND_FALSE flag.
* | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2020-11-068-4/+701
|\ \ | |/ | | | | | | * PHP-7.4: Split tests for compatibility with ICU 68.1
| * Split tests for compatibility with ICU 68.1Christoph M. Becker2020-11-068-4/+701
| |
* | Verify parameter names of function aliasesMáté Kocsis2020-10-166-17/+14
| | | | | | | | Closes GH-6335
* | Initialize calendar_long variableNikita Popov2020-10-141-1/+1
| | | | | | | | | | | | | | As reported by cmb, this results a VC runtime warning. I don't believe there's a problem here, as we only use calendar_long if both calendar_is_null and calendar_obj are not set, but it doesn't hurt to initialize it either...
* | Improve parameter names in ext/intlMáté Kocsis2020-10-1252-509/+523
| | | | | | | | Closes GH-6309
* | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2020-10-123-11/+44
|\ \ | |/ | | | | | | * PHP-7.4: intl: report more information about message pattern parse errors
| * intl: report more information about message pattern parse errorsPhilip Hofstetter2020-10-123-11/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The message patterns can be pretty complex, so reporting a generic U_PARSE_ERROR without any additional information makes it needlessly hard to fix erroneous patterns. This commit makes use of the additional UParseError* parameter to umsg_open to retrieve more details about the parse error to report that to the user via intl_get_error_message() Additional improve error reporting from the IntlMessage constructor. Previously, all possible failures when calling IntlMessage::__construct() would be masked away with a generic "Constructor failed" message. This would include invalid patterns. This commit makes sure that the underlying error that caused the constructor failure is reported as part of the IntlException error message. Closes GH-6325.
| * Update intl test suite for ICU 67.1Christoph M. Becker2020-06-054-3/+469
| | | | | | | | Cherry-picked from c915c601710e2a44e6c7f89fcb12b8047c968108.
* | More precise type information for datefmt_format()Máté Kocsis2020-10-094-4/+4
| |
* | Fix out of bounds offset handling with empty needleNikita Popov2020-10-012-2/+54
| | | | | | | | For strrpos with positive out of bounds offsets was not detected.
* | Allow empty needle in grapheme_str*pos, grapheme_str*strChristian Schneider2020-10-013-101/+59
| | | | | | | | | | | | | | For consistency with str* and mb_str* functions. Closes GH-6245. Closes php/php-tasks#20.
* | Skip test with ICU version < 58Matteo Beccati2020-09-261-1/+5
| |
* | Promote warning to ValueError for Spoofchecker::setRestrictionLevel()George Peter Banyard2020-09-252-2/+22
| | | | | | | | Closes GH-6197
* | Normalize substr() behaviorNikita Popov2020-09-256-114/+114
| | | | | | | | | | | | | | | | | | | | | | | | Make the behavior of substr(), mb_substr(), iconv_substr() and grapheme_substr() consistent when it comes to the handling of out of bounds offsets. substr() will now always clamp out of bounds offsets to the string boundary. Cases that previously returned false will now return an empty string. This means that substr() itself *always* returns a string now (like mb_substr() already did before.) Closes GH-6182.
* | Try to fix testNikita Popov2020-09-221-2/+1
| |
* | Handle out-of-bounds offset consistently in grapheme_* APINikita Popov2020-09-223-32/+97
| | | | | | | | | | | | Make sure we throw the same kind of error regardless of whether the offset is out-of-bounds in the fast path or in the slow path.
* | Fix grapheme out of bounds checkNikita Popov2020-09-223-2/+97
| | | | | | | | An offset equal to the string length is not out of bounds.
* | Drop -1 mode for collator_is_numeric()George Peter Banyard2020-09-213-7/+4
| | | | | | | | It is used only once with allow_errors enabled
* | Drop Hex support in numeric strings for Intl collatorGeorge Peter Banyard2020-09-211-12/+1
| | | | | | | | | | | | Support for this was removed in PHP 7.0. See: https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings
* | Consolidate the usage of "either" and "one of" in error messagesMáté Kocsis2020-09-202-2/+2
| | | | | | | | Closes GH-6173
* | Run tidyNikita Popov2020-09-18196-210/+210
| | | | | | | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* | Display types in stubs more uniformlyMáté Kocsis2020-09-162-2/+2
| | | | | | | | | | | | In preparation for generating method signatures for the manual. This change gets rid of bogus false|null return types, a few unnecessary trailing backslashes, and settles on using ? when possible for nullable types.
* | Declare array|int and object-of-class|int types in stubsMáté Kocsis2020-09-1412-80/+85
| | | | | | | | | | | | Closes GH-6081 Co-Authored-By: Nikita Popov <nikic@php.net>
* | Consolidate new union type ZPP macro namesMáté Kocsis2020-09-112-2/+2
| | | | | | | | | | | | | | They will now follow the canonical order of types. Older macros are left intact due to maintaining BC. Closes GH-6112
* | Improve error messages mentioning parameters instead of argumentsMáté Kocsis2020-09-0912-35/+35
| | | | | | | | Closes GH-5999
* | Promote warnings to exceptions in ext/intlMáté Kocsis2020-09-0718-146/+272
| | | | | | | | Closes GH-5972
* | Use ZPP instead of custom type checksMáté Kocsis2020-09-045-9/+7
| | | | | | | | We can add these types as a native type declaration to stubs as a side-effect. Closes GH-6068