Skip to content
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

Constants deprecation depends on php version in comment #2967

Merged
merged 2 commits into from Mar 13, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Mar 13, 2024

since support for @deprecated on constants was added into BetterReflection with this PR we now take care of interpreting the phpdoc comment and decide per phpversion when a constant is deprecated or not.

this also makes sure that the deprecation message depends on phpstan.neon phpVersion.

closes phpstan/phpstan#10700

@clxmstaab clxmstaab force-pushed the fail-test branch 2 times, most recently from ae2841d to 8623b12 Compare March 13, 2024 09:55
@staabm staabm marked this pull request as ready for review March 13, 2024 09:58
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

// filter raw version number messages like in
// https://github.com/JetBrains/phpstorm-stubs/blob/9608c953230b08f07b703ecfe459cc58d5421437/filter/filter.php#L478
if (Strings::match($deprecatedMessage ?? '', '#^\d+\.\d+(\.\d+)?$#') === null) {
$matches = Strings::match($deprecatedMessage ?? '', '#^(\d+)\.(\d+)(?:\.(\d+))?$#');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this duplicates the logic which should already have happened in BetterReflection.. I think it is wrong

@ondrejmirtes ondrejmirtes merged commit 709f1d0 into phpstan:1.10.x Mar 13, 2024
438 of 440 checks passed
@ondrejmirtes
Copy link
Member

Thank you.

@staabm staabm deleted the fail-test branch March 13, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants