Skip to content

Conversation

@samsonasik
Copy link
Member

LNumber is deprecated, use Int_ instead, ref #510 (review)

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit a2c2427 into main Aug 19, 2025
6 checks passed
@samsonasik samsonasik deleted the use-int-over-lnumber branch August 19, 2025 11:33
@TomasVotruba
Copy link
Member

I wonder why PHPStan didn't pick it up

@samsonasik
Copy link
Member Author

samsonasik commented Aug 19, 2025

We have rector-php-parser repo for php-parser 4 to 5 migration, just not registered as extension

see these config:

https://github.com/rectorphp/rector-php-parser/blob/0cfdb1c1f9bec91ba6dd60406405d9893ebd3153/config/sets/php-parser-50.php#L18-L19

if we use old class, it won't be supported by native Printer method, afaik, eg:

protected function pScalar_Int(Int_ $int): string

@TomasVotruba
Copy link
Member

I mean phsptan deprecation rules, that pick up elements with @deprecated annotation and report them.

I see the class is not deprecated, rather hidden with magic :)

Screenshot From 2025-08-19 15-40-06

@samsonasik
Copy link
Member Author

@TomasVotruba
Copy link
Member

That's another magic not supported. PHPStan can pick up only annotation right above the class.

@samsonasik
Copy link
Member Author

I may can see if I have a chance to create PR to nikic/php-parser to add @deprecated above the LNumber class and other flagged as @deprecated so PHPStan can pick it up.

@samsonasik
Copy link
Member Author

nikic/PHP-Parser#1103

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