We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ParameterGenerator
The ParameterGenerator always considers ReflectionParameter#isOptional() when checking for default parameter values.
ReflectionParameter#isOptional()
A variadic argument is, though, always optional and never has a default value.
Originally posted by @Ocramius at zendframework/zend-code#6
The text was updated successfully, but these errors were encountered:
@michalbundyra I would like to take care of this issue.
Sorry, something went wrong.
@michalbundyra
Maybe I do not understand the issue, but according to the source code: https://github.com/laminas/laminas-code/blob/4.1.x/src/Generator/ParameterGenerator.php#L59-L65
And according to the tests: https://github.com/laminas/laminas-code/blob/4.1.x/test/Generator/ParameterGeneratorTest.php#L506-L556
It seems like everything works as expected.
Am I missing something here?
@mchekin the test checks ->isVariadic(), but not ->isOptional(), I think?
->isVariadic()
->isOptional()
@Ocramius @michalbundyra
I created a pull request which prevents generating variadic parameters with default value + an accompanying unit test #72
Handled in #72
Ocramius
mchekin
No branches or pull requests
The
ParameterGenerator
always considersReflectionParameter#isOptional()
when checking for default parameter values.A variadic argument is, though, always optional and never has a default value.
Originally posted by @Ocramius at zendframework/zend-code#6
The text was updated successfully, but these errors were encountered: