Skip to content

Treat leading $variable as a valid @see reference#456

Open
lacatoire wants to merge 2 commits intophpDocumentor:6.xfrom
lacatoire:fix/see-variable-reference
Open

Treat leading $variable as a valid @see reference#456
lacatoire wants to merge 2 commits intophpDocumentor:6.xfrom
lacatoire:fix/see-variable-reference

Conversation

@lacatoire
Copy link
Copy Markdown

Previously @see $varname failed FQSEN resolution and was surfaced as an InvalidTag. The See factory now detects a bare variable identifier and wraps it in a new Reference\\Variable alongside the existing Reference\\Fqsen and Reference\\Url, so global-variable references survive parsing and round-trip through __toString.

Fixes #335

Previously `@see $varname` failed FQSEN resolution and was surfaced as an InvalidTag (and in the PHP 8.0/8.1 versions mentioned in phpDocumentor#335 it even aborted parsing). The `See` factory now detects a bare variable identifier and wraps it in a new `Reference\\Variable` alongside the existing `Reference\\Fqsen` and `Reference\\Url`, so global-variable references survive parsing and round-trip.

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

Referring a global variable with @see $varname in a docblock causes

1 participant