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: Add ordered_types to @Symfony #7356

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/ruleSets/Symfony.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ Rules

``['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha']``

- `ordered_types <./../rules/class_notation/ordered_types.rst>`_ with config:

``['null_adjustment' => 'always_last', 'sort_algorithm' => 'none']``

- `php_unit_fqcn_annotation <./../rules/php_unit/php_unit_fqcn_annotation.rst>`_
- `php_unit_method_casing <./../rules/php_unit/php_unit_method_casing.rst>`_
- `phpdoc_align <./../rules/phpdoc/phpdoc_align.rst>`_
Expand Down
6 changes: 5 additions & 1 deletion doc/rules/class_notation/ordered_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,13 @@ With configuration: ``['sort_algorithm' => 'none', 'null_adjustment' => 'always_
Rule sets
---------

The rule is part of the following rule set:
The rule is part of the following rule sets:

- `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
- `@Symfony <./../../ruleSets/Symfony.rst>`_ with config:

``['null_adjustment' => 'always_last', 'sort_algorithm' => 'none']``


References
----------
Expand Down
4 changes: 4 additions & 0 deletions src/RuleSet/Sets/SymfonySet.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ public function getRules(): array
],
'sort_algorithm' => 'alpha',
],
'ordered_types' => [
Copy link
Member

Choose a reason for hiding this comment

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

would be good to cover this set change in test.
ie tests/Fixtures/Integration/set/@Symfony.test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think It won't be compatible with the fact the test is running in PHP 7.4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@keradus I don't see how to add this in Symfony.set since it must run in PHP 7.4 too.

But there is already test about this change since I needed to update the following code:
#7356 (comment)

'null_adjustment' => 'always_last',
'sort_algorithm' => 'none',
VincentLanglet marked this conversation as resolved.
Show resolved Hide resolved
],
'php_unit_fqcn_annotation' => true,
'php_unit_method_casing' => true,
'phpdoc_align' => true,
Expand Down