summaryrefslogtreecommitdiff
path: root/ext/intl/formatter
Commit message (Collapse)AuthorAgeFilesLines
* Improve class entry generationMáté Kocsis2021-02-161-2/+1
| | | | Related to GH-6701
* Merge branch 'PHP-8.0'Nikita Popov2021-02-093-5/+5
|\ | | | | | | | | | | | | * 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-093-5/+5
| | | | | | | | | | | | | | | | 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
* | Generate ext/intl class entries from stubsMáté Kocsis2021-02-093-7/+15
| | | | | | | | Closes GH-6670
* | Make convert_to_*_ex simple aliases of convert_to_*Nikita Popov2021-01-141-2/+2
|/ | | | | | | | | | | | | 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.
* Improve parameter names in ext/intlMáté Kocsis2020-10-122-24/+29
| | | | Closes GH-6309
* Promote warnings to exceptions in ext/intlMáté Kocsis2020-09-072-11/+13
| | | | Closes GH-5972
* Use ZPP instead of custom type checksMáté Kocsis2020-09-043-5/+4
| | | | We can add these types as a native type declaration to stubs as a side-effect. Closes GH-6068
* Prevent double-construction of NumberFormatterNikita Popov2020-08-261-0/+4
|
* Add another round of missing parameter types to stubsMáté Kocsis2020-08-072-1/+4
| | | | Closes GH-5950
* Remove proto comments from C filesMax Semenik2020-07-064-83/+17
| | | | Closes GH-5758
* Include stub hash in generated arginfo filesNikita Popov2020-06-241-1/+2
| | | | | | | | | | | | The hash is used to check whether the arginfo file needs to be regenerated. PHP-Parser will only be downloaded if this is actually necessary. This ensures that release artifacts will never try to regenerate stubs and thus fetch PHP-Parser, as long as you do not modify any files. Closes GH-5739.
* Generate method entries for ext/intlMáté Kocsis2020-04-149-127/+105
| | | | Closes GH-5370
* Store default parameter values of internal functions in arg infoMáté Kocsis2020-04-081-7/+7
| | | | | | | Closes GH-5353. From now on, PHP will have reflection information about default values of parameters of internal functions. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* Do not include the same stub multiple timesMáté Kocsis2020-04-033-113/+81
| | | | Closes GH-5322
* Revert "Replace @param annotations with type declarations"Christoph M. Becker2020-02-172-4/+6
| | | | This reverts commit c31029f335ca1b453af799805c43c37e959ad555.
* Replace @param annotations with type declarationsChristoph M. Becker2020-02-162-6/+4
|
* Constrain number parameter of numfmt_format to int|floatChristoph M. Becker2020-02-163-11/+5
| | | | | | | | | | | This is inline with similar changes to the math functions. Especially, array to number conversion makes no sense here, and is likely to hide a programming error. To make that feasible, we introduce the `n` specifier for classic ZPP so we can stick with `zend_parse_method_parameters()`. We also remove a test case, which has been degenerated to a ZPP test.
* Add stubs for NumberFormatterMáté Kocsis2020-02-093-72/+254
| | | | Closes GH-4827
* Merge branch 'PHP-7.4'Christoph M. Becker2020-02-031-15/+15
|\ | | | | | | | | * PHP-7.4: Fix #79212: NumberFormatter::format() may detect wrong type
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-02-031-15/+15
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #79212: NumberFormatter::format() may detect wrong type
| | * Fix #79212: NumberFormatter::format() may detect wrong typeChristoph M. Becker2020-02-031-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to convert to number *before* detecting the type, to cater to internal objects implementing `cast_object`. We also get rid of the fallback behavior of using `FORMAT_TYPE_INT32`, because that can no longer happen; after `convert_scalar_to_number_ex` the type is either `IS_LONG` or `IS_DOUBLE`. We cater explicitly to the `IS_ARRAY` case what also avoids triggering a type confusion when `::TYPE_INT64` is passed as `$type`.
* | | Fix #74063: NumberFormatter fails after retrieval from sessionChristoph M. Becker2020-01-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While it would be desireable to actually support unserialization of NumberFormatter instances, at least we should not allow serialization for now. We also remove some doubtful tests, which have been added[1] claiming that they would crash the intl extension, but apparently no fix has been applied, and the test cases have not been marked as XFAIL. [1] <http://git.php.net/?p=php-src.git;a=commit;h=ed793b2a3f857fd49c0c1b036062140da5b3e674>
* | | Throw exception for unconstructed intl objectsMáté Kocsis2020-01-051-3/+2
| | | | | | | | | | | | Closes GH-5052
* | | Use RETURN_THROWS() after zend_parse_method_parameters()Máté Kocsis2020-01-024-15/+15
| | |
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-12-091-1/+3
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78912: INTL Support for accounting format
| * | Fix #78912: INTL Support for accounting formatChristoph M. Becker2019-12-091-1/+3
| | | | | | | | | | | | | | | | | | | | | We provide `NumberFormatter::CURRENCY_ACCOUNTING` to wrap `UNUM_CURRENCY_ACCOUNTING `[1]. [1] <https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/unum_8h.html#a4eb4d3ff13bd506e7078b2be4052266dae97cdd7ed612d07d251021c076efb1c5>
| * | Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function ↵Dmitry Stogov2019-04-241-2/+2
| | | | | | | | | | | | by reference
* | | Cleanup return values for Intl when parameter parsing is unsuccessfulMáté Kocsis2019-10-304-15/+15
| | | | | | | | | | | | Closes GH-4871.
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-2514-28/+0
| | | | | | | | | | | | Closes GH-4732.
* | | Remove unused is_constructor argumentsNikita Popov2019-07-151-3/+3
| | |
* | | Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function ↵Dmitry Stogov2019-04-241-2/+2
|\ \ \ | | | | | | | | | | | | by reference
| * | | Use ZEND_TRA_ASSIGN_REF_... macros for by reference arguments of internal ↵Dmitry Stogov2019-04-241-2/+2
| |/ / | | | | | | | | | functions.
* | | Intl: Don't separately report "bad arguments" errorsNikita Popov2019-03-114-47/+0
| | | | | | | | | | | | | | | zpp will be throwing for these now, don't report them in addition to that.
* | | Make zpp failures always throw, independent of strict_typesNikita Popov2019-03-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously zend_parse_parameters (and FastZPP) would handle invalid arguments depending on strict_types: With strict_types=1, a TypeError is thrown, with strict_types=0 a warning is thrown and (usually) NULL is returned. Additionally, some functions (constructors always and other methods sometimes) opt-it to throwing regardless of strict_types. This commit changes zpp to always generate a TypeError exception in PHP 8.
* | | Refactor zend_object_handlers API to pass zend_object* and zend_string* ↵Dmitry Stogov2019-02-041-3/+3
|/ / | | | | | | insted of zval(s).
* | Remove local variablesPeter Kokot2019-02-037-63/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* | Implement typed propertiesNikita Popov2019-01-111-14/+10
| | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/typed_properties_v2 This is a squash of PR #3734, which is a squash of PR #3313. Co-authored-by: Bob Weinand <bobwei9@hotmail.com> Co-authored-by: Joe Watkins <krakjoe@php.net> Co-authored-by: Dmitry Stogov <dmitry@zend.com>
* | Use ZEND_THIS macro to hide implementation details in extensions code.Dmitry Stogov2018-11-151-1/+1
| |
* | Replace getThis() by EX(This), when additional check is not necessary.Dmitry Stogov2018-11-141-1/+1
| |
* | Get rid of ZEND_ACC_CTOR, ZEND_ACC_DTOR and ZEND_ACC_IMPLEMENTED_ABSTRACTDmitry Stogov2018-09-051-1/+1
| |
* | Remove needless version checksChristoph M. Becker2018-08-011-9/+0
|/ | | | | | | As of PHP 5.5.3, we're requiring ICU ≥ 4.0[1] anyway, so there's no need to check for ICU 3.x. [1] <http://git.php.net/?p=php-src.git;a=commit;h=8831b00>
* Fixed incorrrecr zval_dtor() usage to replace value of argument passed by ↵Dmitry Stogov2018-07-051-3/+3
| | | | reference, that may lead to memory leaks.
* Export standard object handlers, to avoid indirect accessDmitry Stogov2018-05-311-1/+1
|
* Remove return types from some magic method in protosGabriel Caruso2018-03-091-1/+1
| | | | __construct, __destruct, __wakeup does not have return types defined.
* [ci skip] Fix reference notation in protosChristoph M. Becker2018-03-061-2/+2
|
* [ci skip] Use float instead of double in protoGabriel Caruso2018-03-061-2/+2
|
* Move constants into read-only data segmentDmitry Stogov2017-12-141-1/+1
|
* Cleanup type conversionDmitry Stogov2017-12-072-8/+4
|
* Add zend_object_alloc() APINikita Popov2017-11-251-1/+1
| | | | | | | | | | | Using ecalloc() to create objects is expensive, because the dynamic-size memset() is unreasonably slow. Make sure we only zero the main object structure with known size, as the properties are intialized separately anyway. Technically we do not need to zero the embedded zend_object structure either, but as long as the memset argument is constant, a couple more bytes don't really matter.