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

Fix tags parser #17

Merged
merged 1 commit into from
Apr 2, 2021
Merged

Conversation

cristianoc72
Copy link
Collaborator

Fix tag parser when there's a blank line between tags.
I added a test which fails without this commit.

Fix tags parser when there's a blank line between tags.
@@ -184,7 +184,7 @@ protected function parseTags(string $tags): void {
foreach (explode("\n", $tags) as $line) {
if ($this->isTagLine($line) || count($result) == 0) {
$result[] = $line;
} else {
} elseif ($line !== '') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be trimmed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, because we lose indentation spaces for multiline comments. I.e. parsing and re-writing a comment like the following

/**
 * @var    Awesome and shiny clear description
 *         of the variable.
 * /

results in the(exactly)same docblock.
If we trim, the result will be:

/**
 * @var Awesome  and shiny clear description
 * of the variable.
 * /

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok... just wanted to be sure, when a check for empty string happens, that usually goes with trim, so we are good 👍

@cristianoc72 cristianoc72 merged commit 363d370 into phpowermove:master Apr 2, 2021
@cristianoc72 cristianoc72 deleted the blank-line branch April 2, 2021 17:02
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.

None yet

2 participants