Skip to content

Strip leading @ from InvalidTag name#458

Open
lacatoire wants to merge 1 commit intophpDocumentor:6.xfrom
lacatoire:fix/invalid-tag-name-leading-at
Open

Strip leading @ from InvalidTag name#458
lacatoire wants to merge 1 commit intophpDocumentor:6.xfrom
lacatoire:fix/invalid-tag-name-leading-at

Conversation

@lacatoire
Copy link
Copy Markdown

Tag names are normally exposed without their leading @, but when an InvalidTag is built from the name PHPStan's phpdoc-parser advertises (e.g. for a malformed @var $self SomeClass), the name is passed through as-is and getName() ends up returning @var instead of var. Normalizing the name at the single entry point (InvalidTag::create) keeps the behaviour consistent with every other tag in the library regardless of the upstream parser's convention.

Fixes #449

Tag names are normally exposed without their leading "@", but when an InvalidTag is built from the name PHPStan's phpdoc-parser advertises (e.g. for a malformed `@var $self SomeClass`), the name is passed through as-is and `getName()` ends up returning "@var" instead of "var". Normalizing the name at the single entry point (`InvalidTag::create`) keeps the behaviour consistent with every other tag in the library regardless of the upstream parser's convention.

Fixes phpDocumentor#449
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.

InvalidTag name with leading @

1 participant