- Issue created by @mondrake
- 🇳🇱Netherlands bbrala Netherlands
How to change signatures in interfaces has been documented: 🌱 Document how to add additional parameters to interface methods Fixed
https://www.php.net/manual/en/functions.arguments.php#functions.variable...
It is also possible to achieve variable-length arguments by using func_num_args(), func_get_arg(), and func_get_args() functions. This technique is not recommended as it was used prior to the introduction of the ... token.
From #3236391-15: [11.x] Replace func_get_args with variable-length argument in FormBuilder → :
There are lots of places in core that might need a similar change. To see a full list of potential places, do:
grep -rl "func_get_args" * | grep -v "vendor"
I considered whether this should be done all in one mega cleanup, or as part of a meta (plan) issue. Since it is a BC break, we should do a meta issue.
This is also too disruptive as-is for a minor branch, which is why @catch was considering this to be a D10-only change in #7. Demonstration of the BC break:
https://3v4l.org/rEU6t
However, we can deprecate the old func_get_args() pattern in 10.1.x, and convert to ...$args in the main method signature in D11. Here's how... EDIT. Previous link was some "True value is true". Here's the real snippet:
https://3v4l.org/FNdOm
Active
11.0 🔥
Last updated
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
How to change signatures in interfaces has been documented: 🌱 Document how to add additional parameters to interface methods Fixed