Roave / BetterReflection

:crystal_ball: Better Reflection is a reflection API that aims to improve and provide more features than PHP's built-in reflection API.
MIT License
1.18k stars 131 forks source link

Implement PHP Version dependent deprecations for constants #1396

Closed staabm closed 6 months ago

staabm commented 6 months ago

with this PR we strip the @deprecated phpdoc tag on constant definitions, in case the current php version does not match the declared min version.

motivation: report deprecation errors for constants only when the phpversion matches the @deprecated $version we find in the jetbrains/phpstorm-stubs in PHPStan

example: https://github.com/JetBrains/phpstorm-stubs/blob/9608c953230b08f07b703ecfe459cc58d5421437/filter/filter.php#L478