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
Conversation
I'm not sure to understand the failures... |
The failures are a side effect of your changes. The diff now looks like: -function falsyNull(null $n, false $f): null|false {}
+function falsyNull(null $n, false $f): false|null {} Now this expected since you've changed the configuration, however you didn't update the expected output for the test, hence it fails. So the fix would be to update the expected output for the test file and all should be fine :) |
Thanks |
Might be worth running on latest SF src and see how many hits there are and/or align with SF team, anyways, change look good to me, so I would welcome these :) |
I found 8 occurences of |
thanks, sounds like a good thing you got here :) |
@nicolas-grekas can you confirm we can safely add it? @VincentLanglet did you try to run it against Symfony codebase? |
ordered_types
to @Symfony
0f74193
to
703107d
Compare
@VincentLanglet , no need to poke me for review. |
Maybe @OskarStark you could say if it's ok to add this to the Symfony standard or ping someone who could decide |
I will bring this PR to the core-Team, let's wait a decision. |
703107d
to
d9bd4b0
Compare
Any news @OskarStark ? ^^' |
…radus) This PR was squashed before being merged into the 7.1 branch. Discussion ---------- CS: enable ordered_types.null_adjustment=always_last | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | Fix CS | License | MIT This PR is to apply rule to put `null` as last type variant for type declaration. Sf ruleset is already having enabled very same rule for types in phpdoc. Diff is very minimal, most of codebase already follows it. If merged, we can adjust official ruleset (PR already prepared by community: PHP-CS-Fixer/PHP-CS-Fixer#7356 ) Commits ------- 67a5d2d CS: enable ordered_types.null_adjustment=always_last
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.
Accepted by SF community
@@ -147,6 +147,10 @@ public function getRules(): array | |||
], | |||
'sort_algorithm' => 'alpha', | |||
], | |||
'ordered_types' => [ |
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 good to cover this set change in test.
ie tests/Fixtures/Integration/set/@Symfony.test
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.
I think It won't be compatible with the fact the test is running in PHP 7.4
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.
@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)
d9bd4b0
to
19a7a6a
Compare
19a7a6a
to
556d3eb
Compare
Test are green and I don't think #7356 (comment) is doable until we drop 7.4 support. |
Hi @Wirone
Symfony coding style already use:
so I assume same should be applied to the types, ie: