Skip to content

Report FILTER_SANITIZE_STRING as deprecated in PHP8.1+#112

Closed
staabm wants to merge 5 commits intophpstan:1.2.xfrom
staabm:test-const
Closed

Report FILTER_SANITIZE_STRING as deprecated in PHP8.1+#112
staabm wants to merge 5 commits intophpstan:1.2.xfrom
staabm:test-const

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Mar 2, 2024

regression test for phpstan/phpstan#10662

requires a fix in phpstan-src

todo: raise min phpstan version in composer.json

@staabm staabm marked this pull request as ready for review March 3, 2024 07:54
@staabm staabm marked this pull request as draft March 3, 2024 08:45
Comment on lines +59 to +61
// handle `@deprecated 7.3` as a min php version constraint.
// this notation is used in jetbrains/phpstorm-stubs
sscanf($deprecatedMessage ?? '', '%d.%d', $phpMajor, $phpMinor);
Copy link
Copy Markdown
Contributor Author

@staabm staabm Mar 3, 2024

Choose a reason for hiding this comment

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

we interpret the annotation from phpstorm-stubs

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

that way we can support all constants out of the box, without the need for a hardcoded list in this class

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This logic isn't needed here at all. This should be handled by PhpStormStubsSourceStubber.

@staabm staabm marked this pull request as ready for review March 3, 2024 09:27
@staabm staabm closed this Mar 8, 2024
@staabm staabm deleted the test-const branch March 13, 2024 08:10
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.

2 participants