Skip to content

Add support for attributes on constants - #1082

Merged
nikic merged 1 commit into
nikic:masterfrom
DanielEScherzer:attributes-on-constants
Apr 29, 2025
Merged

Add support for attributes on constants#1082
nikic merged 1 commit into
nikic:masterfrom
DanielEScherzer:attributes-on-constants

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Contributor

Just merged in php/php-src@3f03f7e, updating this parser is needed to be able to use attributes on constants in the stub files.

@nikic nikic left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please also add pretty printer support and a pretty printer test.

This will also need an extra resolveAttrGroups call in NameResolver.

(See https://github.com/nikic/PHP-Parser/blob/master/CONTRIBUTING.md#adding-support-for-new-php-syntax for the full checklist.)

Comment thread lib/PhpParser/Node/Stmt/Const_.php Outdated
@DanielEScherzer
DanielEScherzer force-pushed the attributes-on-constants branch from 75d5451 to 3f6f8a4 Compare April 29, 2025 20:37
@DanielEScherzer

Copy link
Copy Markdown
Contributor Author

Please also add pretty printer support and a pretty printer test.

This will also need an extra resolveAttrGroups call in NameResolver.

(See https://github.com/nikic/PHP-Parser/blob/master/CONTRIBUTING.md#adding-support-for-new-php-syntax for the full checklist.)

Done, thanks for the pointer

@nikic nikic left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This should fix the phpstan errors I believe.

Comment thread grammar/php.y Outdated
Comment thread grammar/php.y Outdated
Comment thread lib/PhpParser/PrettyPrinterAbstract.php Outdated
@nikic

nikic commented Apr 29, 2025

Copy link
Copy Markdown
Owner

Also need to regenerate the parsers.

Just merged in php/php-src@3f03f7e, updating
this parser is needed to be able to use attributes on constants in the stub
files.
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.

2 participants