Skip to content

Add Attribute linking#127

Merged
Girgias merged 1 commit into
php:masterfrom
haszi:Add-Attribute-linking
May 20, 2024
Merged

Add Attribute linking#127
Girgias merged 1 commit into
php:masterfrom
haszi:Add-Attribute-linking

Conversation

@haszi
Copy link
Copy Markdown
Contributor

@haszi haszi commented May 17, 2024

This PR adds support for attributes in the format described in this comment and generates links to the documentation pages of known predefined attributes.

Edit:
As a side note, there are 129 additional attributes in php-src stub files that are not documented in doc-en.

@kocsismate
Copy link
Copy Markdown
Member

Do you plan to add support for displaying other types of attributes? Or is there any technical limitation?

@kocsismate
Copy link
Copy Markdown
Member

gen_stub.php counterpart: php/php-src#14270

@haszi
Copy link
Copy Markdown
Contributor Author

haszi commented May 19, 2024

Do you plan to add support for displaying other types of attributes? Or is there any technical limitation?

This PR supports 'known' attributes on method and function parameters. 'Known' in this context means an attribute that has been declared in the documentation with an ID in the class.attribute_name format (all current predefined attributes are supported).

As far as this PRs limitation, this implementation doesn't support namespaced attributes and does not support linking an attribute on a return type either. It wouldn't be hard to add these though.

Copy link
Copy Markdown
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

LGTM thank you!

@Girgias Girgias merged commit dda2c63 into php:master May 20, 2024
@haszi haszi deleted the Add-Attribute-linking branch May 20, 2024 11:53
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.

3 participants