Commit graph

443 commits

Author SHA1 Message Date
Nikita Popov
a9efcb1561 gen_stub: Also verify implementation-alias
This makes --verify also check @implementation-alias. Failures are
ignored using @no-verify instead. Some mistakes have been made that
would have been caught by this...

Closes GH-6615.
2021-01-19 09:48:33 +01:00
Nikita Popov
f0d6151918 gen_stub: Don't use $aliasMap during verification
Some functions have multiple aliases, while the $aliasMap can
only record one.

Methodsynopsis generation probably shouldn't use it either, but
at least that case seems to only be interested in whether there
is an alias at all.
2021-01-18 16:04:14 +01:00
Nikita Popov
496e4741a3 gen_stub: Compare phpdoc return type in --verify 2021-01-18 14:41:53 +01:00
Nikita Popov
85bfa2243a gen_stub: Allow additional text after @return
In case the stub file also contains documentation.
2021-01-18 13:13:32 +01:00
Nikita Popov
43d5cef448 gen_stub: Automatically add function name to exceptions
This makes sure that it's present even on exceptions from deeper
down the stack, where we can't add it manually.
2021-01-18 13:13:32 +01:00
Nikita Popov
45a4d07dd0 Merge branch 'PHP-8.0'
* PHP-8.0:
  Add support for union types for internal functions
2021-01-12 10:15:13 +01:00
Nikita Popov
973138f39d Add support for union types for internal functions
This closes the last hole in the supported types for internal
function arginfo types. It's now possible to represent unions of
multiple classes. This is done by storing them as TypeA|TypeB and
PHP will then convert this into an appropriate union type list.

Closes GH-6581.
2021-01-12 10:14:41 +01:00
Máté Kocsis
dc4d8400b4
Merge branch 'PHP-8.0' 2020-12-30 18:28:33 +01:00
Máté Kocsis
446ad04524
Fix refentry attribute replacing 2020-12-30 18:26:24 +01:00
Máté Kocsis
74e39ce06c
Merge branch 'PHP-8.0' 2020-12-28 14:46:00 +01:00
Máté Kocsis
9cec093b7f
Add support for generating methodsynopses from stubs
Closes GH-6367
2020-12-28 14:44:43 +01:00
Nikita Popov
08006e8337 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix bug #80402: Don't strip -lpthread
2020-11-26 11:56:07 +01:00
Nikita Popov
6132389d1c Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #80402: Don't strip -lpthread
2020-11-26 11:56:00 +01:00
Nikita Popov
ea372e7463 Fix bug #80402: Don't strip -lpthread
The current behavior has been introduced 20 years ago in
f9e375f493 as part of a larger change.
It's not clear to me why special treatement of -lpthread is necessary
here.
2020-11-26 11:54:20 +01:00
Nikita Popov
14eabd9523 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80393
2020-11-24 15:27:50 +01:00
Nikita Popov
ae6e56fb98 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80393
2020-11-24 15:27:43 +01:00
Nikita Popov
d016434ad3 Fixed bug #80393
Handle macos versions that don't start with 10.* in libtool.

Patch by kir dot morozov at gmail dot com.
2020-11-24 15:26:40 +01:00
Nikita Popov
b6a93c38bf Merge branch 'PHP-8.0'
* PHP-8.0:
  Use true/false instead of TRUE/FALSE in intl
2020-11-09 14:44:46 +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
Nikita Popov
5143b4d8aa Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80310: Support for icu4c 68.1.
2020-11-09 14:35:48 +01:00
Nikita Popov
4cd393453a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80310: Support for icu4c 68.1.
2020-11-09 14:35:40 +01:00
Nikita Popov
96b725122d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #80310: Support for icu4c 68.1.
2020-11-09 14:34:24 +01:00
Nikita Popov
e1cbfb38f6 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix another implicit function declaration in configure
2020-11-03 10:39:33 +01:00
Nikita Popov
53c417d81c Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix another implicit function declaration in configure
2020-11-03 10:39:26 +01:00
Nikita Popov
4e68c53a21 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix another implicit function declaration in configure
2020-11-03 10:39:13 +01:00
Nikita Popov
00ba784a2c Fix another implicit function declaration in configure
As mentioned on bug #80171. This one is in libtool.m4, might get
lost on libtool updates.
2020-11-03 10:38:16 +01:00
Jakub Zelenka
c3a6debc08 Bump minimal OpenSSL version to 1.0.2 2020-11-01 20:10:37 +00:00
Nikita Popov
1c868b186e Fix parameter stats generation
[ci skip]
2020-10-26 09:05:25 +01:00
Máté Kocsis
47bbfe1fc0
Require stubs to declare return types for magic methods when possible
Closes GH-6376
2020-10-23 16:33:16 +02:00
Máté Kocsis
d6264b0966
Verify parameter names of function aliases
Closes GH-6335
2020-10-16 10:56:33 +02:00
Nikita Popov
c96d884d91 Avoid namespaced class symbol clashes in gen_stub
Add the namespace prefix (using underscores) to both the arginfo
name and the method declaration name.
2020-10-07 12:13:52 +02:00
Nikita Popov
9c710b1d11 Support "static" type in gen_stub 2020-10-07 11:34:14 +02:00
Nikita Popov
47ef51cb45 Add @generate-legacy-arginfo tag 2020-10-05 16:33:54 +02:00
Remi Collet
dba6715598 Improve gen_stub.php - drop --legacy option, generate file is exists - add --help option - add debug "Saved ..." message 2020-10-05 15:41:08 +02:00
Nikita Popov
d3cf597328 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix -Wimplicit-function-declaration in configure
2020-10-05 10:48:04 +02:00
Nikita Popov
9ad5381a2f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix -Wimplicit-function-declaration in configure
2020-10-05 10:46:46 +02:00
Nikita Popov
dfa6d1c22e Support specifying linkage for generate-function-entries
The linkage can be specified as the argument to the
@generate-function-entries tag. Test this on zend_test.
2020-10-02 17:21:16 +02:00
Nikita Popov
924ac2b98a Add partial namespace support to gen_stub 2020-10-02 17:08:50 +02:00
Nikita Popov
2e32a09541 Add gen_stub --legacy flag
This flag generates an arginfo file that discards all type and
default value information. As such, it is compatible with old
(and very old) PHP versions.

Intended for use by extensions to generate one arginfo file for
PHP 8 and one for older versions.
2020-10-02 15:14:02 +02:00
George Peter Banyard
07a2f30417 Extensions should have the final say on their compiler flags
Currently compiler flags passed by extensions using the standard
``PHP_NEW_EXTENSION`` and ``PHP_ADD_SOURCES`` m4 macros are prepended
before the ones defined by ``Zend/Zend.m4``.

This was not really an issue before as ``Zend.m4`` only included
``-Wall`` but since the addition of ``-Wextra`` various issue about
disabling flags have been brought up.

A preliminary attempt was done in commit 5c1cf7669b
but this turns out to be more or less irrelevant.

The root issue is that  ``PHP_NEW_EXTENSION`` and ``PHP_ADD_SOURCES`` call the
``PHP_ADD_SOURCES_X`` macro and pass their flags as the 3rd argument which prepends
the flags. There exists a 6th argument for this macro which appends them but from a
cursory look at https://heap.space/search?full=PHP_ADD_SOURCES_X&project=php-src
this is not used. Moreover, the comment describing this macro explicitly informs
that this macro should not be used directly.

As such we drop the 6th argument of ``PHP_ADD_SOURCES_X`` and move the `special-flags`
argument to be appended instead of prepended.

Closes GH-6204
2020-09-28 13:18:47 +01:00
Nikita Popov
9428e161a8 Add option to print parameter name stats to gen_stub 2020-09-24 15:16:29 +02:00
Máté Kocsis
64af12d13b
Add support for @implementation-alias in stubs
Closes GH-6170
2020-09-21 10:08:45 +02:00
Nikita Popov
93745a242f Only check linking in PHP_TEST_BUILD
Given that this executes a random function with zero parameters,
actually executing the code doesn't make sense.

This should fix the imap + asan build.
2020-09-20 10:24:54 +02:00
Dmitry Stogov
aae50328e2 decbin/decoct/dechex optimization. 2020-09-08 10:34:29 +03:00
Levi Morrison
94fd52dd09 Add Z_PARAM_ITERABLE and co 2020-09-03 07:03:12 -06:00
Tyson Andre
e056e2dae9 Check for duplicate names in gen_stub.php
With named arguments in php 8.0, it's important that php's modules
or PECL extensions using gen_stub.php don't generate functions
with duplicate names.

Warn if a parameter name is repeated,
even if the last occurrence is a variadic parameter

Closes GH-6035
2020-08-24 09:31:46 -04:00
Máté Kocsis
118406a31c
Remove custom hacks from gen_stub.php after PHP-Parser upgrade 2020-08-23 21:17:05 +02:00
Tyson Andre
4bba59d491 Update PHP-Parser from 4.3.0 to 4.9.0
PHP-Parser 4.3.0 failed to recognize that the `match` keyword could be
used as a class constant name.
4.9.0 also adds support for keywords in namespaced names.
See https://github.com/nikic/PHP-Parser/releases

So forcing regeneration of spl_iterators.stub.php failed.

PECL extensions using gen_stub.php would also be affected
by the same issue.

```
ext/spl/spl_iterators.stub.php
    public function __construct(Iterator $iterator, string $regex,
    int $mode = self::MATCH, int $flags = 0, int $preg_flags = 0) {}
```

Testing: I successfully regenerated stubs by setting forceRegeneration to true
and running `touch **/*.stub.php; make`.
The stubs did not change, as expected.

Closes GH-6036
2020-08-23 11:51:57 -04:00
Máté Kocsis
a10f8876ef
Check missing parameter types in stubs
[skip ci] Closes GH-5627
2020-08-13 15:17:31 +02:00
Nikita Popov
b480e6841e Recognize gnu-libiconv location on alpine 2020-08-12 15:32:11 +02:00