Skip to content

Should PHPStan support reporting deprecated PHP code? #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Jun 18, 2024 · 2 comments
Closed

Should PHPStan support reporting deprecated PHP code? #115

ghost opened this issue Jun 18, 2024 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 18, 2024

PHPStan is a static analyzer that reports bugs in code. A deprecation can be considered a bug that will occur in the future. Could PHPStan report deprecated PHP code?

Example:
PHP 8.3 deprecated ${var} string interpolation. It could be reported when running PHPStan in PHP 8.3 environment or with phpVersion: 80300. This way we can prepare our code now for the change that will be required in one or more years.

@ondrejmirtes
Copy link
Member

PHPStan core does this for selected errors. What matters is that the error can be detected from the AST. I'm not sure if this one can, feel free to test it.

You can open this with relevant information as a feature request in phpstan/phpstan (provided it's not a duplicate already).

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant