-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Leverage the match expression #45433
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
1a50e49
to
67b5237
Compare
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.
Very nice!
src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php
Outdated
Show resolved
Hide resolved
I'm totally in favor of switching to FQCN but it needs to be done globally in another PR I guess. That's unrelated to the match expression for me. |
We prefer changing lines once in a single PR, because that helps when running git blame later on. |
67b5237
to
b1be99b
Compare
b1be99b
to
7d241b1
Compare
Looks like PHP CS Fixer does not like the code style proposed by @nicolas-grekas (yet). |
I'm fine adopting php-cs-fixer suggestion then (after removing the trailing coma) |
src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php
Outdated
Show resolved
Hide resolved
3a866fe
to
b1284dc
Compare
b1284dc
to
217dc16
Compare
Thank you @fancyweb. |
This PR was merged into the 6.2 branch. Discussion ---------- Convert switch cases to match expression | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | - | License | MIT | Doc PR | Continuation of #45433 using [rector rule ](https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#changeswitchtomatchrector) `@fancyweb` friendly ping as you've worked on it previously. Commits ------- f3ec7ac Convert switch cases to match expression
This PR was merged into the 6.2 branch. Discussion ---------- Convert switch cases to match expression | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | - | License | MIT | Doc PR | Continuation of symfony/symfony#45433 using [rector rule ](https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#changeswitchtomatchrector) `@fancyweb` friendly ping as you've worked on it previously. Commits ------- f3ec7ac324 Convert switch cases to match expression
This PR was merged into the 6.2 branch. Discussion ---------- Convert switch cases to match expression | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | - | License | MIT | Doc PR | Continuation of symfony/symfony#45433 using [rector rule ](https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#changeswitchtomatchrector) `@fancyweb` friendly ping as you've worked on it previously. Commits ------- f3ec7ac324 Convert switch cases to match expression
This PR was merged into the 6.2 branch. Discussion ---------- Convert switch cases to match expression | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | - | License | MIT | Doc PR | Continuation of symfony/symfony#45433 using [rector rule ](https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#changeswitchtomatchrector) `@fancyweb` friendly ping as you've worked on it previously. Commits ------- f3ec7ac324 Convert switch cases to match expression
Tentative to leverage the
match
expression when we can in order to keep on modernizing the code (afterarray_is_list()
,str_starts_with()
,str_ends_with()
andstr_contains()
).Firstly, let's see if the CI is green.