Commit Graph

115 Commits

Author SHA1 Message Date
Ilija Tovilo
e706d024b2
Fix IntlPartsIterator key off-by-one error
Closes GH-7734
Closes GH-8172
2022-03-25 13:10:55 +01:00
Ilija Tovilo
925a30979c
Allowing catching arg type deprecations in intl classes
Closes GH-8115
Closes GH-8117
2022-03-03 11:26:35 +01:00
Nikita Popov
2654c3449f Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  CLDR 40a0 uses a lowercase "temp" instead of "Temp" in ICU >= 70.1
  Accommodate changes to canonicalized forms in ICU >= 70.1
  Change UBool to bool for equality operators in ICU >= 70.1
2021-11-02 16:17:16 +01:00
Nikita Popov
a6d14f1143 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  CLDR 40a0 uses a lowercase "temp" instead of "Temp" in ICU >= 70.1
  Accommodate changes to canonicalized forms in ICU >= 70.1
  Change UBool to bool for equality operators in ICU >= 70.1
2021-11-02 16:15:25 +01:00
Ben Ramsey
81b3f95622 Change UBool to bool for equality operators in ICU >= 70.1
Refer to:
- 633438f8da
- f6325d49ba
2021-11-02 16:07:51 +01:00
Nikita Popov
410bdaba3f Fix compiler warnings in ext/intl
I don't really get why these didn't show up before.
2021-09-16 11:18:38 +02:00
Nikita Popov
a5ad9eeefa Add explicit IntlPartsIterator::getRuleStatus() method
Rather than doing a magic forward, explicitly add a forwarding
method. This must be the most frivolous use of get_method I've
ever seen.
2021-07-22 10:33:49 +02:00
Nikita Popov
9e787d51b5 Fix typo
Did not have intl enabled in this build...
2021-07-22 09:47:45 +02:00
Nikita Popov
6d505d4445 Add RETURN/RETVAL_COPY_DEREF() macros
These were missing from the set...

I think quite a few of these usages don't actually need the DEREF,
but I've just kept things as is for now.
2021-07-22 09:44:19 +02:00
Máté Kocsis
65b96397b3
Declare tentative return types for ext/intl (#6986) 2021-07-06 10:55:43 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Máté Kocsis
bf0f6aaf18
Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Máté Kocsis
c6723728df
Generate ext/intl class entries from stubs
Closes GH-6670
2021-02-09 13:37:24 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
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.
2021-01-15 12:33:06 +01:00
Nikita Popov
975735c027 Use true/false instead of TRUE/FALSE in intl
And drop the U_DEFINE_TRUE_AND_FALSE flag.
2020-11-09 14:44:11 +01:00
Máté Kocsis
186612e4d7
Improve parameter names in ext/intl
Closes GH-6309
2020-10-12 18:06:45 +02:00
Nikita Popov
f6e5cc3391 Prevent double-construction of IntlRuleBasedBreakIterator 2020-08-26 10:03:28 +02:00
Nikita Popov
647fb38d58 Ensure RuleBasedBreakIterator constructor throws on failure
Constructors must throw on failure indepdendent of the configured
intl error mode.
2020-08-25 15:28:58 +02:00
Nikita Popov
259d050a39 Clean up BreakIterator create_object handler
Use standard zend_object_alloc() function and fix the
object_init_properties() call (which works out okay because there
are no properties).
2020-08-25 13:11:43 +02:00
George Peter Banyard
f78a091014 Warning to ValueError promotion in Intl extension Part 1
Affects:
- IntlCalendar
- IntlGregorianCalendar
- IntlBreakIterator

Closes GH-5669
2020-07-31 13:27:22 +01:00
Máté Kocsis
30067894fc
Update outdated arginfo hashes 2020-06-30 16:02:11 +02:00
Nikita Popov
ff19ec2df3 Introduce InternalIterator
Userland classes that implement Traversable must do so either
through Iterator or IteratorAggregate. The same requirement does
not exist for internal classes: They can implement the internal
get_iterator mechanism, without exposing either the Iterator or
IteratorAggregate APIs. This makes them usable in get_iterator(),
but incompatible with any Iterator based APIs.

A lot of internal classes do this, because exposing the userland
APIs is simply a lot of work. This patch alleviates this issue by
providing a generic InternalIterator class, which acts as an
adapater between get_iterator and Iterator, and can be easily
used by many internal classes. At the same time, we extend the
requirement that Traversable implies Iterator or IteratorAggregate
to internal classes as well.

Closes GH-5216.
2020-06-24 15:31:41 +02:00
Nikita Popov
c9b9f525a9 Include stub hash in generated arginfo files
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.
2020-06-24 09:55:19 +02:00
Nikita Popov
15846ff115 Add ZVAL_OBJ_COPY macro
For the common ZVAL_OBJ + GC_ADDREF pattern.
This mirrors the existing ZVAL_STR_COPY API.
2020-06-17 16:36:56 +02:00
George Peter Banyard
4c6ecc820b Refactor IntlBreakIterator::next() handling 2020-06-05 22:16:33 +02:00
George Peter Banyard
7af0466044 Convert code path which should never happen to assertion 2020-06-05 22:11:06 +02:00
Máté Kocsis
f00bcfbb7d
Generate method entries for ext/intl
Closes GH-5370
2020-04-14 13:39:00 +02:00
Máté Kocsis
3709e74b5e
Store default parameter values of internal functions in arg info
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>
2020-04-08 18:37:51 +02:00
Nikita Popov
fb5bfcb75b Add a ZEND_UNCOMPARABLE value
To explicitly indicate that objects are uncomparable. For now
this has no functional difference from the usual 1 return value,
but makes intent clearer.
2020-03-31 12:36:48 +02:00
Máté Kocsis
81fee9f29f
Get rid of method mapping of BreakIterator classes 2020-02-25 23:05:24 +01:00
Máté Kocsis
bcb7847139
Add stubs for Intl BreakIterator
Closes GH-5207
2020-02-25 23:05:03 +01:00
Nikita Popov
16897aacce Remove unnecessary checks in breakpoint iterator
The result of Z_INTL_BREAKITERATOR_P() cannot be NULL. This type
of macro in general can never be NULL.
2020-02-25 10:06:13 +01:00
Máté Kocsis
019e8d438c
Throw exception for unconstructed intl objects
Closes GH-5052
2020-01-05 23:55:14 +01:00
Máté Kocsis
345703724c
Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
2019-12-31 11:46:11 +01:00
Christoph M. Becker
4008704f62 zend_parse_parameters_throw() is obsolete
Since `zend_parse_parameters()` throws now, there is no reason to
explicitly call `zend_parse_parameters_throw()` anymore, and since both
have actually the same implementation, we redefine the latter as macro.
2019-11-01 16:47:15 +01:00
Máté Kocsis
969e7a3c8b Cleanup return values for Intl when parameter parsing is unsuccessful
Closes GH-4871.
2019-10-30 13:21:40 +01:00
Dmitry Stogov
b02b81299c Comparison cleanup:
- introduce zend_compare() that returns -1,0,1 dirctly (without intermediate zval)
- remove compare_objects() object handler, and keep only compare() handler
2019-10-07 17:57:49 +03:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Dmitry Stogov
b2cdde0826 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros
2019-05-28 20:19:15 +03:00
Dmitry Stogov
83804519df Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros 2019-05-28 20:10:02 +03:00
Nikita Popov
86ef425177 Intl: Don't separately report "bad arguments" errors
zpp will be throwing for these now, don't report them in addition to
that.
2019-03-11 11:32:20 +01:00
Dmitry Stogov
91ef4124e5 Refactor zend_object_handlers API to pass zend_object* and zend_string* insted of zval(s). 2019-02-04 13:20:25 +03:00
Dmitry Stogov
0f7f1498be Use ZEND_THIS macro to hide implementation details in extensions code. 2018-11-15 19:54:19 +03:00
Dmitry Stogov
8bda22592e Eliminate useless $this related check 2018-11-14 11:33:14 +03:00
Dmitry Stogov
c6ad0b92b7 Replace getThis() by EX(This), when additional check is not necessary. 2018-11-14 02:44:25 +03:00
Anatol Belski
a04cd4b948 Remove assignment irrelevant for release build 2018-10-14 21:35:57 +02:00
Christoph M. Becker
8a4c2f1621 Require ICU ≥ 50.1
Given that ICU is a set of lively developed libraries, that ICU 50.1
has been released on 2012-11-05, and PHP 7.4 is scheduled to be
released seven years after it, we consider it appropriate to ditch
these legacy versions.

Particularly, that would be a reasonable groundwork to implement part
two of the “Deprecate and remove INTL_IDNA_VARIANT_2003” RFC[1], namely
to default idn_to_ascii()'s and idn_to_utf8()'s $variant parameter to
INTL_IDNA_VARIANT_UTS46, which is not defined in ICU < 4.6.

See also the related discussion on internals@[2].

[1] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
[2] <http://news.php.net/php.internals/101626>ff
2018-09-15 13:59:54 +02:00
Gabriel Caruso
fb966b9825
Remove unused variables 2018-07-25 22:05:41 -03:00
Dmitry Stogov
67b4c3379a Uze ZVAL_COPY_DEREF() instead of ZVAL_DEREF() and ZVAL_COPY() 2018-07-09 12:46:46 +03:00
Christoph M. Becker
1b61c3b210 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #76556: get_debug_info handler for BreakIterator shows wrong type
2018-06-30 23:22:20 +02:00