1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00
Commit Graph

27 Commits

Author SHA1 Message Date
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
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 1f8a93abaa Support class+mask union for internal argument 2020-07-24 16:40:14 +02:00
Máté Kocsis d8dfb21b51 Add support for forcing regeneration of arginfo files
Closes GH-5795
2020-07-02 14:54:52 +02:00
Nikita Popov 1ed5a63c86 Check that "tokenizer" extension is available in gen_stub.php 2020-07-02 10:37:14 +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
Máté Kocsis b3718430de Annotate internal functions with the mixed type
Closes GH-5618
2020-05-25 17:30:57 +02:00
Remi Collet c3d6a0ac02 manage ZEND_DEP_FALIAS in gen_stub 2020-04-29 14:37:06 +02:00
Nikita Popov fa4bdf1cda Make gen_stub parallelism safe
If PHP-Parser is not yet installed, make sure we don't try to
install it N times in parallel.
2020-04-21 10:20:51 +02:00
Nikita Popov 110e6e4f95 Make gen_stub.php compatible with PHP 7.1 again
Not worth bumping requirements over this...
2020-04-14 17:55:27 +02:00
Máté Kocsis dfd0acf0d7 Generate method entries for ext/dom
Closes GH-5374
2020-04-13 00:13:11 +02:00
Tyson Andre 047d814704 Fix an undefined class error running gen_stub in php8
For whatever reason, php 8 would not have loaded the subsequent classes when
running `php build/gen_stub.php path/to/filename.php`.
I assume it didn't load the classes immediately because there's a possibility
the code before it would throw.
(Probably because __toString was added recently and prevents early binding)

Also, fix a typo

Closes GH-5369
2020-04-11 17:17:28 -04:00
Máté Kocsis 3fe49d81f8 Generate method entries from stubs for a couple of extensions
Closes GH-5368
2020-04-11 13:28:53 +02:00
Máté Kocsis 1d05771a70 Add support for generating method entries from stubs
Closes GH-5363
2020-04-11 09:15:14 +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
Máté Kocsis d5bbb28f7d Move variable declaration closer to its usage 2020-04-05 00:03:08 +02:00
Máté Kocsis 610815c0ce Improve gen_stub.php
Closes GH-5350
Add support for generating deprecated function entries, as well as forward declaration
of function aliases.
2020-04-04 23:52:33 +02:00
Máté Kocsis a43bc33fb2 Annotate function aliases in stubs 2020-04-04 13:03:16 +02:00
Nikita Popov 2bcc4ab8f4 Verify that all stubs have a return type 2020-04-03 17:59:30 +02:00
Nikita Popov d2c92d7fd3 Stubs: Store information per-class
We'll need this if we want to generate method entries.
2020-04-03 16:20:47 +02:00
Nikita Popov 51bc6233b2 Generate function entries from stubs
If @generate-function-entries is specified in the stub file,
also generate function entries for the extension.

Currently limited to free functions only.
2020-04-03 15:41:41 +02:00
Remi Collet e11d3b1690 Move gen_stub.php to build directory and install it so phpize can take care of it, and thus extension can use it as it is already in Makefile 2020-04-03 10:48:20 +02:00