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

enum:annotate command breaks existing docblock descriptions #310

Closed
tamiroh opened this issue May 8, 2023 · 0 comments · Fixed by #311
Closed

enum:annotate command breaks existing docblock descriptions #310

tamiroh opened this issue May 8, 2023 · 0 comments · Fixed by #311
Labels

Comments

@tamiroh
Copy link
Contributor

tamiroh commented May 8, 2023

Problem

The enum:annotate command breaks existing docblock descriptions. For example, when the command is executed for an enum like the following,

/**
 * This is a test enum with multiple line comments.
 *
 * Test enum with multiple line comments. Test enum
 * with multiple line comments. Test enum with multiple line comments.
 *
 * Test enum with multiple line comments.
 *
 * @method static static A()
 * @method static static B()
 * @method static static C()
 * @extends Enum<int>
 */
final class EnumWithMultipleLineComments extends Enum
{
    const A = 1;
    const B = 2;
    const C = 3;
}

I expect docblock to remain the same, but as shown below, line breaks are lost from the description and the formatting is broken.

/**
 * This is a test enum with multiple line comments.
 *
 * Test enum with multiple line comments. Test enum with multiple line comments. Test enum with multiple line comments. Test enum with multiple line comments.
 *
 * @method static static A()
 * @method static static B()
 * @method static static C()
 * @extends Enum<int>
 */
final class EnumWithMultipleLineComments extends Enum
{
    const A = 1;
    const B = 2;
    const C = 3;
}

Survey

I have tried to determine the cause of the above behavior. As a result, I found that the laminas-code on which the docblock generation process depends is causing the problem. For more information, please refer to the following Issue I submitted.

laminas/laminas-code#177

I reported it as a bug, but it will probably never be fixed. This is because fixing it would be a breaking change. Therefore, to fix the enum:annotate problem, we would have to rewrite the logic above so that it does not depend on laminas-code.

@tamiroh tamiroh changed the title enum:annotate command breaks existing DocBlock descriptions enum:annotate command breaks existing docblock descriptions May 8, 2023
@spawnia spawnia added the bug label May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants