Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Oct 14, 2025

No description provided.

Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

Maybe I'm too slow today - but why do we need PHPUnit version detection for data providers? There are versions that support both @dataProvider PHPDoc tag and #[DataProvider] attribute. We should be looking at both.

@staabm
Copy link
Contributor Author

staabm commented Oct 14, 2025

Maybe I'm too slow today - but why do we need PHPUnit version detection for data providers? There are versions that support both @dataProvider PHPDoc tag and #[DataProvider] attribute. We should be looking at both.

in this PR I am mostly refactoring pre-existing logic.

while I agree from a functional point of view, its not necessary, but I think we could improve performance with this knowledge (what is not implemented right now) - because there are PHPUnit versions which support only annotations, some support both and newer ones only support Attributes (no longer annotations). so we could prevent unnecessary phpdoc parsing work on newer PHPUnit

@clxmstaab clxmstaab force-pushed the ref1 branch 5 times, most recently from b943272 to 8d6c1bd Compare October 14, 2025 08:29
@ondrejmirtes
Copy link
Member

@staabm I don't think we should use this knowledge to improve performance (it'd be negligible). I think we should use it to report "@dataProvider is deprecated on PHPUnit 11.x" (when %deprecationRulesInstalled% is true) and on PHPUnit 12.x to report that it's no longer supported 😊

@ondrejmirtes ondrejmirtes merged commit 39950c7 into phpstan:2.0.x Oct 14, 2025
67 checks passed
@ondrejmirtes
Copy link
Member

Thank you.

@staabm staabm deleted the ref1 branch October 14, 2025 11:37
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