Ilija Tovilo
e23440e5a6
Implement reflection constant
...
Fixes GH-13570
Closes GH-13669
2024-04-17 22:53:09 +02:00
Gina Peter Banyard
1f8c899dcb
ext/reflection: Add test for ReflectionParameter::getDeclaringFunction() with a ReflectionMethod creation from a Closure ( #13987 )
2024-04-17 20:36:17 +01:00
Tim Düsterhus
08b2ab22f4
Include the source location in Closure names ( #13550 )
...
* Include the source location in Closure names
This change makes stack traces involving Closures, especially multiple
different Closures, much more useful, because it's more easily visible *which*
closure was called for a given stack frame.
The implementation is similar to that of anonymous classes which already
include the file name and line number within their generated classname.
* Update scripts/dev/bless_tests.php for closure naming
* Adjust existing tests for closure naming
* Adjust tests for closure naming that were not caught locally
* Drop the namespace from closure names
This is redundant with the included filename.
* Include filename and line number as separate keys in Closure debug info
* Fix test
* Fix test
* Include the surrounding class and function name in closure names
* Fix test
* Relax test expecations
* Fix tests after merge
* NEWS / UPGRADING
2024-04-12 18:21:13 +02:00
Máté Kocsis
be2f454d6e
Add dedicated StreamBucket class ( #13111 )
...
RFC: https://wiki.php.net/rfc/dedicated_stream_bucket
2024-04-11 20:11:40 +02:00
Máté Kocsis
2079da0158
Fix #13865 Improve parameter and return value related deprecation messages ( #13913 )
...
I added the function/method name to some compile-time deprecation messages which are related to parameters/return values. Consistently with the other similar error messages, I included the function/method name at the start of the message.
2024-04-08 22:20:32 +02:00
Máté Kocsis
330cc5cdb2
Deprecate implicit nullable parameter types ( #12959 )
...
RFC: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
Co-authored-by: Gina Peter Banyard <girgias@php.net >
2024-03-13 21:40:26 +01:00
Niels Dossche
4799321740
Merge branch 'PHP-8.3'
...
* PHP-8.3:
Fix GH-13517: Multiple test failures when building with --with-expat
2024-02-27 21:49:47 +01:00
Niels Dossche
8bb2a15d01
Merge branch 'PHP-8.2' into PHP-8.3
...
* PHP-8.2:
Fix GH-13517: Multiple test failures when building with --with-expat
2024-02-27 21:49:39 +01:00
Niels Dossche
552ea62e1f
Fix GH-13517: Multiple test failures when building with --with-expat
...
The reflection failure is because the XML extension is used to check the
module dependency information, but that extension can be configured to
not depend on ext/libxml, resulting in a different output. The solution
is to check another extension instead.
The test failures in ext/xml/tests are because of different behaviour
between libxml2 and Expat error handling. These are expected differences
and the solution is to split the tests.
Closes GH-13522.
2024-02-27 21:49:01 +01:00
Máté Kocsis
4b405d8520
Display class constant and property doc comments via reflection ( #13499 )
2024-02-25 08:39:41 +01:00
Niels Dossche
3b5986db69
Implement GH-12908: Show attribute name/class in ReflectionAttribute dump
...
This is consistent with how many other Reflection classes have a name
field, and it makes debugging easier.
Closes GH-12908.
Closes GH-12917.
2024-02-04 23:02:02 +01:00
Máté Kocsis
688c6f373c
Deprecate calling ReflectionMethod::__construct() with 1 argument
2023-12-04 22:27:59 +01:00
Ilija Tovilo
f39b5c4c25
Close PHP tags in tests
...
Closes GH-12422
2023-10-18 17:34:10 +02:00
Niels Dossche
0ba24a5ed9
Merge branch 'PHP-8.3'
...
* PHP-8.3:
Fix GH-12392: Segmentation fault on SoapClient::__getTypes
Fix GH-11121: ReflectionFiber segfault
[ci skip] NEWS
2023-10-11 17:32:22 +02:00
Niels Dossche
124c812542
Merge branch 'PHP-8.2' into PHP-8.3
...
* PHP-8.2:
Fix GH-12392: Segmentation fault on SoapClient::__getTypes
Fix GH-11121: ReflectionFiber segfault
[ci skip] NEWS
2023-10-11 17:27:54 +02:00
Niels Dossche
d8cd0f4ba0
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Fix GH-12392: Segmentation fault on SoapClient::__getTypes
Fix GH-11121: ReflectionFiber segfault
[ci skip] NEWS
2023-10-11 17:23:17 +02:00
Daniil Gentili
71f14510f6
Fix GH-11121: ReflectionFiber segfault
...
Closes GH-12391.
Co-authored-by: Aaron Piotrowski <aaron@trowski.com >
2023-10-11 17:19:01 +02:00
Christian Clauss
886bf820c9
[skip ci] Fix typos discovered by codespell ( #12228 )
2023-09-18 11:07:17 +01:00
Ilija Tovilo
3433dab5f7
Revert 479e659331
...
There were 4 different reports of this breaking behavior. This is higher than I
expected. This bug fix may still be desirable, but should be discussed on the
list beforehand.
Closes GH-12127
2023-09-05 16:14:28 +02:00
Ilija Tovilo
48ede64506
Merge branch 'PHP-8.2'
...
* PHP-8.2:
Fix segfault in format_default_value due to unexpected enum/object
2023-08-17 18:44:37 +02:00
Ilija Tovilo
9437aa9a8e
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Fix segfault in format_default_value due to unexpected enum/object
2023-08-17 18:43:49 +02:00
Ilija Tovilo
f78d1d0d10
Fix segfault in format_default_value due to unexpected enum/object
...
Evaluating constants at comptime can result in arrays that contain objects. This
is problematic for printing the default value of constant ASTs containing
objects, because we don't actually know what the constructor arguments were.
Avoid this by not propagating array constants.
Fixes GH-11937
Closes GH-11947
2023-08-17 18:43:11 +02:00
Máté Kocsis
d9a7f6741e
Deprecate ReflectionProperty::setValue() with an incorrect 1st arg type
2023-07-18 12:59:21 +02:00
Máté Kocsis
f41220fe5d
Implement ReflectionMethod::createFromMethodName()
2023-07-18 12:59:21 +02:00
George Peter Banyard
d8696f9216
[RFC] Path to Saner Increment/Decrement operators ( #10358 )
...
* Add behavioural tests for incdec operators
* Add support to ++/-- for objects castable to _IS_NUMBER
* Add str_increment() function
* Add str_decrement() function
RFC: https://wiki.php.net/rfc/saner-inc-dec-operators
Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com >
Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com >
2023-07-17 15:51:24 +01:00
Ilija Tovilo
0b1d750d91
Allow arbitrary expressions in static variable initializer
...
Closes GH-9301
2023-05-24 20:17:31 +02:00
Máté Kocsis
414f71a902
Typed class constants ( #10444 )
...
RFC: https://wiki.php.net/rfc/typed_class_constants
Co-Authored-By: Ben <7127204+moliata@users.noreply.github.com >
Co-Authored-By: Bob Weinand <3154871+bwoebi@users.noreply.github.com >
Co-Authored-By: Ilija Tovilo <ilija.tovilo@me.com >
2023-04-16 22:20:26 +02:00
Ilija Tovilo
ab99072608
Merge branch 'PHP-8.2'
...
* PHP-8.2:
Fix segfault when using ReflectionFiber (fixes #10439 )
2023-02-23 23:28:31 +01:00
Ilija Tovilo
f1818d726f
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Fix segfault when using ReflectionFiber (fixes #10439 )
2023-02-23 23:27:55 +01:00
Daniil Gentili
8d1c0a1403
Fix segfault when using ReflectionFiber ( fixes #10439 )
...
Closes GH-10478
2023-02-23 23:20:27 +01:00
David Carlier
33f8d67177
Merge branch 'PHP-8.2'
2023-02-19 20:31:53 +00:00
David Carlier
2f4ba1b1fb
Merge branch 'PHP-8.1' into PHP-8.2
2023-02-19 20:30:59 +00:00
Niels Dossche
ae16471628
Fix GH-10623: ReflectionFunction::getClosureUsedVariables() returns empty array in presence of variadic arguments
...
The code was missing the handling for the RECV_VARIADIC instruction.
Additional regression test for GH-10623
Co-authored-by: Fabio Ivona <fabio.ivona@defstudio.it >
2023-02-19 20:18:28 +00:00
Máté Kocsis
016160800c
Fix GH-10259 ReflectionClass::getStaticProperties doesn't need null return type ( #10418 )
2023-01-24 22:26:52 +01:00
Máté Kocsis
7936c8085e
Fix GH-8329 Print true/false instead of bool in error and debug messages ( #8385 )
2023-01-23 10:52:14 +01:00
Ilija Tovilo
adfdfb2e1e
Improvements in modifier parsing ( #9926 )
...
Use a shared non-terminal for all class modifiers. This avoids conflicts when
adding modifiers that are only valid for certain targets. This change is
necessary for asymmetric visibility but might be useful for other future
additions.
Closes GH-9926
2022-11-17 16:20:27 +01:00
George Peter Banyard
6e8f2ba6b8
Merge branch 'PHP-8.2'
...
* PHP-8.2:
Revert 01eb06a0de
Convert Implicitly nullable pure intersection types to DNF
2022-10-24 11:42:41 +01:00
George Peter Banyard
0b0259a418
Convert Implicitly nullable pure intersection types to DNF
...
If we don't then Reflection would give us a ReflectionIntersectionType even if the type is currently displayed as (X&Y)|null
2022-10-24 11:39:54 +01:00
Ilija Tovilo
e186765a4d
Throw in ReflectionMethod::__construct() when initialized with private parent method
...
Fixes GH-9470
Closes GH-9640
2022-10-10 00:49:10 +02:00
Ilija Tovilo
a85c757dcb
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Private method incorrectly marked as "overwrites" in reflection
2022-09-08 10:44:32 +02:00
Ilija Tovilo
a795f3ebc6
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
Private method incorrectly marked as "overwrites" in reflection
2022-09-08 10:44:13 +02:00
Ilija Tovilo
1435fc6262
Private method incorrectly marked as "overwrites" in reflection
...
Fix GH-9409
Closes GH-9469
2022-09-08 10:43:25 +02:00
Arnaud Le Blanc
dcde9b85a6
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
[ci skip] NEWS
[ci skip] NEWS
Add tests
Fix GH-8932: Provide a way to get the called-scope of closures (#9299 )
2022-09-02 13:55:57 +02:00
Arnaud Le Blanc
409baac29c
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
[ci skip] NEWS
Add tests
Fix GH-8932: Provide a way to get the called-scope of closures (#9299 )
2022-09-02 13:53:14 +02:00
Arnaud Le Blanc
db1ef97209
Add tests
2022-09-02 13:33:21 +02:00
Nicolas Grekas
93f11d8429
Fix GH-8932: Provide a way to get the called-scope of closures ( #9299 )
...
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de >
2022-09-02 13:32:50 +02:00
Ilija Tovilo
d36874d002
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Fix class name FQN when AST dumping new and class const
2022-09-02 08:58:27 +02:00
Ilija Tovilo
2cfb028e22
Fix class name FQN when AST dumping new and class const
...
Fixes GH-9447
Closes GH-9462
2022-09-02 08:57:26 +02:00
Ilija Tovilo
2152bb2dfa
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Fix attribute target validation on fake closures
2022-07-29 12:15:38 +02:00
Ilija Tovilo
565a416e87
Fix attribute target validation on fake closures
...
Fixes GH-8982
Closes GH-9173
2022-07-29 12:14:44 +02:00