fterrag/vscode-php-cs-fixer

php-cs-fixer removes @param from docblocks

Closed this issue · 3 comments

php-cs-fixer removes @param from docblocks f they don't have a description.
Not sure if this is a wanted behaviour but it wasn't like this a few months ago.

Initial code:

/**
 * Undocumented function
 *
 * @param array $array
 * @return boolean
 */
function test(array $array): bool {}

after fixing:

/**
 * Undocumented function.
 *
 * @return boolean
 */
function test(array $array): bool
{
}

desired:

/**
 * Undocumented function.
 *
 * @param array $array
 *
 * @return boolean
 */
function test(array $array): bool
{
}

@pvettori thanks for the issue! You may want to check out https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/3734/files as I think this PR may be what you're seeing.

Thank you @fterrag !
Adding this setting to my custom preferences resolved the issue:
"vscode-php-cs-fixer.rules": "-no_superfluous_phpdoc_tags, ...

Glad to hear it @pvettori !