Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[CS] Enable phpdoc_types_order #28780

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

Merged
merged 1 commit into from
Oct 11, 2018
Merged

[CS] Enable phpdoc_types_order #28780

merged 1 commit into from
Oct 11, 2018

Conversation

carusogabriel
Copy link
Contributor

Q A
Branch? 2.8
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

As suggested by @jvasseur in #28675 (comment), we can use the phpdoc_types_order rule from PHP-CS-Fixer to ensure that null is always on the last position in phpDocs as proposed in #28675.

@@ -19,6 +19,7 @@ return PhpCsFixer\Config::create()
'self_accessor' => false,
// Part of @Symfony:risky in PHP-CS-Fixer 2.13.0. To be removed from the config file once upgrading
'native_function_invocation' => array('include' => array('@compiler_optimized'), 'scope' => 'namespaced'),
'phpdoc_types_order' => array('null_adjustment' => 'always_last', 'sort_algorithm' => 'none'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that the comment above is misleading: the rule isn't part of any ruleset for now. Do you mind submitting a PR on PHP CS Fixer to update the Symfony ruleset?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@julienfalque What branch in PHP-CS-Fixer should I send? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Rulesets updates are done on minor releases so you should target branch master.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@julienfalque Cool. Gonna update the comment here for now, as well, submit a patch for the ruleset in php-cs-fixer 😊

@fabpot
Copy link
Member

fabpot commented Oct 11, 2018

Thank you @carusogabriel.

@fabpot fabpot merged commit c340502 into symfony:2.8 Oct 11, 2018
fabpot added a commit that referenced this pull request Oct 11, 2018
This PR was merged into the 2.8 branch.

Discussion
----------

[CS] Enable phpdoc_types_order

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | -   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | -

As suggested by @jvasseur in #28675 (comment), we can use the `phpdoc_types_order` rule from PHP-CS-Fixer to ensure that `null` is always on the last position in phpDocs as proposed in #28675.

Commits
-------

c340502 [CS] Enable phpdoc_types_order
@carusogabriel carusogabriel deleted the patch-1 branch October 11, 2018 11:30
SpacePossum added a commit to PHP-CS-Fixer/PHP-CS-Fixer that referenced this pull request Oct 18, 2018
…abriel)

This PR was merged into the 2.14-dev branch.

Discussion
----------

Add phpdoc_types_order rule to Symfony's ruleset

As suggested by @julienfalque in symfony/symfony#28780, besides add this new rule due to symfony/symfony#28675, we should also enforces it in Symfony's ruleset here too 😊

Commits
-------

c2ccec2 Add phpdoc_types_order rule to Symfony's ruleset
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Nov 12, 2018
This PR was merged into the 2.8 branch.

Discussion
----------

[standards] Document "phpdoc_types_order"

See symfony/symfony#28780.

Commits
-------

7587534 [standards] Document "phpdoc_types_order"
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.

6 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.