Open levacic opened 3 years ago
For exactly that reason, I'm still using php-fmt (slightly modified for php7+).
Thanks for the tip, I'm actually already doing the same thing, but using PHP Sniffer as a formatter, which is convenient because it relies on the sniffs in my PHPCS configuration (a lot of which are also implemented so as to be able to fix the issues they detect) - thus making everything consistent.
However, it would be more convenient if the docblock was already aligned correctly as soon as it is generated, which seems like a pretty easy feature to implement (basically pad all items in each group with spaces on the right-hand side up to the length of the longest item in that group).
P.S. This would be particularly helpful if #1101 was implemented, and worked correctly with this feature (although the combo of these features does seem like slightly more work).
There are some considerations like very long lines and line breaks, also probably someone might be not happy with such feature (messing with version control). As option for sure, anyway I wouldn't hope for that in the near future, since author is inactive lately.
Feature description or problem with existing feature
By default, an example generated docblock is formatted something like this:
Describe the solution you'd like
I would like automatically generated
@param
annotations to have the types, variable names, and descriptions aligned, based on the longest of each group. So the example above should be formatted like this:Additional context
This is enforced by the Symfony.Commenting.FunctionComment sniff, which is part of my team's coding standards.