Skip to content
New issue

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

Skip description on same line, remove on next line as based on phpdoc-parser in RemoveUselessParamTagRector #4551

Merged
merged 2 commits into from
Jul 20, 2023

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Jul 20, 2023

Fixes #4480

Skip description on same line, remove on next line as based on phpdoc-parser, so there is not much we can do with it, unless handled there first.

This removal is based on phpdoc-parser implementation that only makes multi-line docblock those line, that start on the same line as param, see: https://github.com/phpstan/phpdoc-parser/blob/2108d702baa4883362a8824def66b96733b8cf82/tests/PHPStan/Parser/PhpDocParserTest.php#L1978-L1998

There are 2 possible fixes - move first letter to first line:

class DemoFile
{
    /**
     * @param string $primitiveValue A
     *   primitive is fine.
     */
    public function test(string $primitiveValue)
    {
    }
}

Or move the wholeparam to first line:

class DemoFile
{
    /**
     * @param string $primitiveValue A primitive is fine.
     */
    public function test(string $primitiveValue)
    {
    }
}

@TomasVotruba TomasVotruba changed the title patch 1 Skip description on same line, remove on next line as based on phpdoc-parser in RemoveUselessParamTagRector Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants