1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 06:51:18 +02:00
Commit Graph

178 Commits

Author SHA1 Message Date
Remi Collet 13d3564a51 Fix #12063 convert PHP single-quote to C double-quote string 2023-08-28 14:48:49 +02:00
Máté Kocsis c934e24197 Fix GH-9967 Add support for generating custom function, class const, and property attributes in stubs 2023-08-26 21:35:31 +02:00
Ayesh Karunaratne e6627ccb52 gen_stub: fix regexps with unintentional range due to - character placement (#12004) 2023-08-20 14:20:56 +02:00
Máté Kocsis 566cf37ec3 Use new class synopsis generating markup (#11809) 2023-07-28 15:42:32 +02:00
Ilija Tovilo 7b355e8d34 Revert "Merge branch 'PHP-8.2'"
This reverts commit 45a3f178dc, reversing
changes made to b2a54bc6af.
2023-07-04 09:18:49 +02:00
Máté Kocsis 4db4f0ba00 Display the readonly modifier for readonly classes 2023-07-03 16:02:25 +02:00
Máté Kocsis 3c6590a391 Add support for extending multiple interfaces in the manual
After https://github.com/php/phd/pull/75/
2023-07-03 16:02:25 +02:00
Máté Kocsis 45a3f178dc Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-9967 Add support for generating custom function, class const, and property attributes in stubs

Closes GH-10170
2023-07-03 11:17:08 +02:00
Máté Kocsis d7ab0ff0c8 Fix GH-9967 Add support for generating custom function, class const, and property attributes in stubs 2023-07-03 08:32:58 +02:00
Máté Kocsis 3906bccc00 Add support for typed class constants in stubs 2023-07-01 11:50:04 +02:00
Máté Kocsis 6dd62fb3d6 Upgrade to PHP-Parser 5.0
Since it supports typed class constants. Using the alpha 3 version for now.
2023-06-25 22:54:01 +02:00
Máté Kocsis 281669aeb4 Add support for true standalone type when generating methodsynopsis 2023-05-07 19:34:09 +02:00
Derick Rethans 78937c93ef Merge branch 'PHP-8.2' 2023-03-09 13:39:31 +00:00
Derick Rethans a45bef0ac6 Merge branch 'PHP-8.1' into PHP-8.2 2023-03-09 13:37:19 +00:00
Derick Rethans 717335ec63 Fixed macro generation for variadics, which don't have a default value 2023-03-09 11:39:22 +00:00
Máté Kocsis 368febbf89 Remove unnecessary workaround for the true type 2023-03-07 09:08:16 +01:00
Bob Weinand 145602f38e Fix bug in zend_test assuming null not being the first type
(I agree that null should come last, but then it should rather throw with a proper message than emit an undefined key warning.)

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2023-02-28 12:01:41 +01:00
Bob Weinand 81abd8dc37 Allow gen_stub.php to parse and ignore extended docblock types
Extended docblock types, according to psalm or phpstan conventions may include array shapes, callable signatures etc.. These are now ignored by ignoring any nested parenthesized expression (followed by optional :type) at the end of the type.
2023-02-27 17:30:28 +01:00
Máté Kocsis a981ad7ad2 Merge branch 'PHP-8.2'
* PHP-8.2:
  Add support for generating namespaced constant
2023-02-23 10:49:40 +01:00
SATO Kentaro 7fccdf72a4 Add support for generating namespaced constant
Closes GH-10552
2023-02-23 10:05:30 +01:00
Bob Weinand cf1d21edbd Add a couple clarifying comments 2023-01-22 21:24:54 +01:00
Bob Weinand 1fbe855971 Honor constant expressions instead of just taking the last constant encountered in stubs
As an example:
should be translated to:
ZVAL_LONG(&attribute_Attribute_class_test_arg0, ZEND_ATTRIBUTE_TARGET_FUNCTION | ZEND_ATTRIBUTE_TARGET_METHOD);
2023-01-22 21:24:54 +01:00
Máté Kocsis c90c944126 Merge branch 'PHP-8.2'
* PHP-8.2:
  Better document constructors
  Do not display non-existent constructors
  Do not list private constructors as inherited
2023-01-01 10:49:39 +01:00
Máté Kocsis 7b08fe9f2d Do not list private constructors as inherited 2023-01-01 10:47:16 +01:00
Máté Kocsis 38e138798d Do not display non-existent constructors 2023-01-01 10:47:16 +01:00
Máté Kocsis eebf3bc0ba Better document constructors
Until https://github.com/php/php-src/pull/10098 default constructors were sometimes documented, sometimes omitted. The above PR made adding documentation for constructor of all non-abstract classes required. However, this is not desired when such a class inherits a constructor from its parent. The current PR fixes the behavior the following way:
- documents inherited constructors (along with destructors)
- makes it possible to generate/replace the methodsynopsis of implicit default constructors which don't have a stub counterpart
2023-01-01 10:47:16 +01:00
Máté Kocsis dc54e04ed4 Merge branch 'PHP-8.2'
* PHP-8.2:
  Only include the default constructor for non-abstract class synopses
2022-12-16 17:03:22 +01:00
Máté Kocsis d832125b8e Only include the default constructor for non-abstract class synopses 2022-12-16 17:02:35 +01:00
Máté Kocsis 8afc55870e Merge branch 'PHP-8.2'
* PHP-8.2:
  Replace another root XML element format to the "canonical" one
  Remove the superfluous closing parentheses from class synopsis page includes
  Always include the constructor on the class manual pages
  Backport methodsynopsis role attributes changes from master
2022-12-16 13:21:39 +01:00
Máté Kocsis 6aa5e58414 Backport methodsynopsis role attributes changes from master
Commits https://github.com/php/php-src/commit/93605f286d11876da44d2ecd41c13d7e3f0aae66 and https://github.com/php/php-src/commit/d6651426f405342f74cdfe930448912ef68e23c4
2022-12-16 13:18:12 +01:00
Máté Kocsis 0fc60fab72 Always include the constructor on the class manual pages 2022-12-16 13:18:12 +01:00
Máté Kocsis b4df038cee Remove the superfluous closing parentheses from class synopsis page includes 2022-12-16 13:18:12 +01:00
Máté Kocsis 60cf9fbee0 Replace another root XML element format to the "canonical" one 2022-12-16 13:18:12 +01:00
Máté Kocsis d6651426f4 Escape the role attribute of namespaced classes (#9952) 2022-11-15 18:13:29 +01:00
Máté Kocsis 93605f286d Make the usage of the role attribute more clear (#9901)
Currently, the role attribute is mainly used to differentiate OO and procedural "aliases" when they are documented on the same page (e.g. https://www.php.net/manual/en/datetime.diff.php). However, these function-method counterparts are not always aliases in fact according to the stubs (#9491). That's why sometimes the usage of the role attribute is ambiguous, thus syncing the manual with the stubs results in false positive diffs.

This change fixes the problem by a very obtrusive way: by changing the value of all role="oop" attributes to the actual class name, like role="DateTime", and by getting rid of all role="procedural" attributes as they became unnecessary. This way, class synopsis pages can clearly reference methods, and skip functions. Additionally, gen_stub.php will be able to generate the correct methodsynopsis role even though a single page describes multiple methods, like `DateTime/DateTimeImmutable/DateTimeInterface::diff()`.
2022-11-10 08:35:46 +01:00
Máté Kocsis a14e125baf Merge branch 'PHP-8.2'
* PHP-8.2:
  Do not display the value of UNKNOWN constants in the manual (#9843)
2022-10-30 14:58:58 +01:00
Máté Kocsis 721e604a69 Do not display the value of UNKNOWN constants in the manual (#9843) 2022-10-30 14:58:16 +01:00
Máté Kocsis aba11b670c Merge branch 'PHP-8.2'
* PHP-8.2:
  Generate constant declarations with the CONST_CS flag for PHP 7.x
2022-10-10 11:13:00 +02:00
Máté Kocsis 69ef3247fd Generate constant declarations with the CONST_CS flag for PHP 7.x 2022-10-10 11:12:20 +02:00
Máté Kocsis c153ec877f Merge branch 'PHP-8.2'
* PHP-8.2:
  Improve string class constant code generation
2022-09-26 23:13:31 +02:00
Máté Kocsis e4f2376919 Improve string class constant code generation (#9577)
Using strlen() will make sure that non-constant values can also be used.
2022-09-26 23:12:34 +02:00
Máté Kocsis ab6d449b3a Merge branch 'PHP-8.2'
* PHP-8.2:
  Use PHP 7.4 syntax in gen_stub.php
2022-09-11 07:51:52 +02:00
Máté Kocsis 8b632749d7 Use PHP 7.4 syntax in gen_stub.php 2022-09-11 07:51:28 +02:00
Nikita Popov 36fdc6fdc0 Check that all preprocessor conditions are terminated 2022-09-10 18:17:51 +02:00
Máté Kocsis e0422979f6 Validate if the refpurpose and the description is in sync (#9510) 2022-09-09 11:54:38 +02:00
Máté Kocsis ce058273ba Add support for validation of missing method synopses (#9491) 2022-09-07 17:40:36 +02:00
Máté Kocsis 05aa3b3e0a Upgrade PHP parser to 4.15.1
It contains some useful fixes
2022-09-06 14:09:47 +02:00
Máté Kocsis c547fc183c Add support for validation of missing class synopses (#9472) 2022-09-05 14:21:15 +02:00
Andreas Braun f7d42f646b Update gen_stub to avoid compile errors on duplicate function names
Closes GH-9406
2022-08-30 11:33:45 +02:00
Máté Kocsis b4ec3e9bc0 Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00