You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Class attribute gets duplicated on another class property #2436
The Deprecated attribute is being copied from the TYPES constant to the neighbouring $attributes property for some reason. I have to remove it manually whenever I format this file.
@czosel@jorgsowa Unfortunately glayzzle/php-parser#1225 does not appear to have fixed this issue. I just confirmed it with a new install against the example I gave above, and got the exact same result.
Still happening with 0.26.0 (php-parser 3.7.0): the parser resets the attribute list after methods and properties but not after class constants, so the next member inherits the constant's attributes. glayzzle/php-parser#1309 fixes it, with a test.
Activity
czosel commentedon Jul 11, 2025
Thanks for the bug report @hackel!
hackel commentedon Jul 3, 2026
@czosel @jorgsowa Unfortunately glayzzle/php-parser#1225 does not appear to have fixed this issue. I just confirmed it with a new install against the example I gave above, and got the exact same result.
@prettier/plugin-php@0.25.0
prettier@3.9.4
linguist-languages@8.2.0
php-parser@3.7.0
maoxor commentedon Oct 29, 2026
Still happening with 0.26.0 (php-parser 3.7.0): the parser resets the attribute list after methods and properties but not after class constants, so the next member inherits the constant's attributes. glayzzle/php-parser#1309 fixes it, with a test.