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

feature: add PhpUnitDataProviderStaticFixer #6702

Merged
merged 13 commits into from
Jan 21, 2023
Merged

feature: add PhpUnitDataProviderStaticFixer #6702

merged 13 commits into from
Jan 21, 2023

Conversation

kubawerlos
Copy link
Contributor

Non-static data providers will be deprecated in PHPUnit 10 and removed in PHPUnit 11.

(fixer that actually made: #6696)

@coveralls
Copy link

coveralls commented Dec 5, 2022

Pull Request Test Coverage Report for Build 3833873772

  • 64 of 64 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 92.944%

Totals Coverage Status
Change from base Build 3832405332: 0.02%
Covered Lines: 22618
Relevant Lines: 24335

💛 - Coveralls

doc/list.rst Show resolved Hide resolved
$tokensAnalyzer = new TokensAnalyzer($tokens);

$inserts = [];
foreach ($dataProviderAnalyzer->getDataProviders($tokens, $startIndex, $endIndex) as $dataProviderAnalysis) {
Copy link
Member

@keradus keradus Dec 27, 2022

Choose a reason for hiding this comment

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

I wonder about functional programming here... yeah - totally out of scope of this PR. but hey... DS\Vector?

looks like:

$allAnalysis
  ->filter(check for $this usage)
  ->map(convert to `function` index)
  ->filter(check if already static)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like fun, for refactoring, especially the part with figuring out how to handle keys in this case.

@kubawerlos kubawerlos merged commit 8099262 into PHP-CS-Fixer:master Jan 21, 2023
@kubawerlos kubawerlos deleted the add_PhpUnitDataProviderStaticFixer branch January 21, 2023 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants