Skip to content

Fix parsing of multiple identical tags in docblocks#24

Merged
akirk merged 1 commit intomainfrom
fix/multiple-array-tags
Jan 30, 2026
Merged

Fix parsing of multiple identical tags in docblocks#24
akirk merged 1 commit intomainfrom
fix/multiple-array-tags

Conversation

@akirk
Copy link
Copy Markdown
Owner

@akirk akirk commented Jan 30, 2026

Summary

  • Fixes issue where docblocks with multiple @type tags would cause the second tag to overwrite the data structure instead of appending to it
  • Handles edge case of multiple @return tags in documentation generation
  • Adds unit tests for multiple @type and @return tag scenarios

Fixes #23

Test plan

  • Run vendor/bin/phpunit tests/ArrayTagsTest.php - all 6 new tests pass
  • Run vendor/bin/phpunit - all 48 tests pass
  • Run vendor/bin/phpcs - no style violations

Fixes issue where docblocks with multiple @type tags (common in
WordPress documentation for array parameters) would cause the second
tag to overwrite the data structure instead of appending to it.

Also handles edge case of multiple @return tags in documentation
generation.

Fixes #23
@akirk akirk merged commit 56456e6 into main Jan 30, 2026
2 checks passed
@akirk akirk deleted the fix/multiple-array-tags branch January 30, 2026 12:13
akirk added a commit that referenced this pull request Jan 30, 2026
The previous fix (#24) prevented the fatal error when parsing multiple
@type tags, but the tag information was not being rendered in the
generated documentation.

This change:
- Renders @type tags as sub-items in the Parameters section
- Handles generic type syntax like array<string, string>
- Fixes namespace prefixing for generic types

Closes #23
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.

How are arrays handled?

1 participant