phpstan / phpstan-deprecation-rules

PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.
MIT License
378 stars 18 forks source link

Should PHPStan support reporting deprecated PHP code? #115

Closed javaDeveloperKid closed 3 months ago

javaDeveloperKid commented 3 months ago

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 commented 3 months ago

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).

github-actions[bot] commented 2 months ago

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.