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

feat: @PhpCsFixer ruleset - enable php_unit_data_provider_static #7685

Merged
merged 4 commits into from Jan 20, 2024

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Jan 6, 2024

php_unit_data_provider_static is good even for PHPUnit < 10, only static methods were not required there

@mvorisek mvorisek changed the title Add php_unit_data_provider_static to PhpCsFixer ruleset feat: @PhpCsFixer ruleset - enable php_unit_data_provider_static Jan 6, 2024
@@ -31,6 +31,7 @@ Rules
- `no_unset_on_property <./../rules/language_construct/no_unset_on_property.rst>`_
- `php_unit_data_provider_name <./../rules/php_unit/php_unit_data_provider_name.rst>`_
- `php_unit_data_provider_return_type <./../rules/php_unit/php_unit_data_provider_return_type.rst>`_
- `php_unit_data_provider_static <./../rules/php_unit/php_unit_data_provider_static.rst>`_
Copy link
Member

@keradus keradus Jan 7, 2024

Choose a reason for hiding this comment

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

👎

This is not about style, this is about migration - in Fixer we applied this only because of migration purposes.
All migration rules shall be part of PHPUnit migration ruleset.

I would rather recommend projects to keep config like following:

[
    '@PHP{xy}Migration' => true,
    '@PHPUnit{xy}Migration' => true,
    '@PhpCsFixer' => true, // or @Symfony, @PSR, ...
]

if there is a non-migration rule, it could be part of vendor style (eg @Fixer..., @Symfony)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even if static providers make sense in all PHPUnits?

Copy link
Member

Choose a reason for hiding this comment

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

Were static data providers always available? If yes, then I would consider it as style rule rather than migration rule. But if they were introduced in some specific version, then it surely is migration rule 😉. Personally: I don't know 😅.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

@keradus keradus left a comment

Choose a reason for hiding this comment

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

@mvorisek mvorisek requested a review from keradus January 19, 2024 22:06
@keradus keradus dismissed their stale review January 20, 2024 11:23

requested change applied

@keradus keradus enabled auto-merge (squash) January 20, 2024 11:23
@keradus keradus merged commit 27c0ba8 into PHP-CS-Fixer:master Jan 20, 2024
26 checks passed
@mvorisek mvorisek deleted the enable_data_provider_static branch January 20, 2024 18:36
danog pushed a commit to zoonru/PHP-CS-Fixer that referenced this pull request Feb 2, 2024
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.

None yet

4 participants