Closed jfcherng closed 5 years ago
Thanks for reporting,
As the current generated comment match no recommendation, I have implemented your suggestion ("old" PhpStorm syntax)...
But the syntax seems tools dependant (discussed here on StackOverflow )
PhpDoc documentation defines:
/**
* @param mixed $args,... The arguments
*/
This option seem to be a better choice... What is your opinion about this syntax ? Is it compliant with your editor ?
Yes, it's okay in my use case as well. Either way, it's better than the current one. Thanks!
Thanks
0.71.0 is now released on the evolution branch Will be pushed in the regular branch next week
Works for me. Thanks.
It looks like my static analyzer (phan) doesn't like this syntax. I have to check with the author.
I check some most famous PHP static analysis tools.
All of them are using @param <type> ...$args
as the doc of a variadic funciton.
Since PHPStorm also accepts that form, I suggest we use it as the default one for best compatibility.
Or, hopefully make it configurable as an user preference.
Thanks again,
0.71.1 is now released. On comment update the "...$args" notation will be applied
LGTM. Thanks!
Problem
Variadic function is introduced in PHP 5.6. Here's a simple example.
The generated PHPDoc looks like the following.
It looks like the
...
is treated as the variable type of$arg
but actually it is not and no type is declared here.Expected Result
Just a note. Here, the
<type>
is the type of the element of$args
rather than$args
itself.Reference: https://github.com/phpDocumentor/fig-standards/issues/121#issuecomment-429202033
Another Problem that May Be Related
Say, now I have my doc edited manually as the following.
Now I press Alt+Q(
doxy_comment_nearest_entity
). The doc becomesThe
...
is removed by plugin.