Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Apr 17, 2025

Description

Previously, only tokens of type T_DOC_COMMENT_OPEN_TAG would receive a comment_closer index and tokens of type T_DOC_COMMENT_CLOSE_TAG would receive a comment_opener index (asymmetrically).

This commit changes this to set both the comment_opener as well as the comment_closer indexes on all docblock tokens. This should allow for more flexibility for sniffs examining docblocks.

Includes updated tests to safeguard this change.

Suggested changelog entry

Changed:
All T_DOC_COMMENT_* tokens will now have the comment_opener and comment_closer indexes set.

Related issues/external references

Fixes #484

Previously, only tokens of type `T_DOC_COMMENT_OPEN_TAG ` would receive a `comment_closer` index and tokens of type `T_DOC_COMMENT_CLOSE_TAG ` would receive a `comment_opener` index (asymmetrically).

This commit changes this to set both the `comment_opener` as well as the `comment_closer` indexes on all docblock tokens.
This should allow for more flexibility for sniffs examining docblocks.

Includes updated tests to safeguard this change.

Fixes 484
@jrfnl jrfnl merged commit f78bb64 into 4.x Apr 17, 2025
62 checks passed
@jrfnl jrfnl deleted the phpcs-4.0/feature/484-tokenizer-docblock-improvements branch April 17, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants