-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[CS] Enforces null type hint on last position in phpDocs #28675
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can/does php-cs-fixer cover it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this is rejected because of the "merge conflicts" ... but I wish this is merged because it's great for consistency. Thanks Gabriel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(would be great to have php-cs-fixer do it for us)
Thank you @carusogabriel. |
… (carusogabriel) This PR was merged into the 2.8 branch. Discussion ---------- [CS] Enforces null type hint on last position in phpDocs | 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 | - <!-- required for new features --> As a majority in our codebase, the `null` typehint usually comes in the last position in phpDocs. Commits ------- efbba25 [CS] Enforces null type hint on last position in phpDocs
@ro0NL No need to. services:
SlevomatCodingStandard\Sniffs\TypeHints\NullTypeHintOnLastPositionSniff: ~
|
php-cs-fixer can do it with the |
@jvasseur Thanks for that. Gonna open a PR adding that to all current active branches. |
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
…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
As a majority in our codebase, the
null
typehint usually comes in the last position in phpDocs.