Support variadic parameters #28
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So far, PhD does not support variadic parameters. Instead the manual
follows the convention to use
...as parameter name, which is thenrendered as
$...in the docs. However, as of PHP 5.6.0 variadicparameters are supported using the syntax
...$args; therefore, we aregoing to support this notation for PhD.
While DocBook supports a
<varargs>element, this cannot be used incombination with named parameters. Therefore, we use the
roleattribute of the
<parameter>element to declare variadic parameters.Since the
roleattribute is already used to designate referenceparameters, we support the following values now:
"reference","variadic"and"reference variadic"; additional whitespace as wellas swapping the order of the words is supported.
After applying this patch to the docs:
We get the following output for the


sscanf()page:Old-style pseudo-variadics (i.e.
...) are rendered like before, but of course the manual should be updated to use proper variadic parameters.