Skip to content

Conversation

@fancyweb
Copy link
Contributor

Q A
Branch? 6.1
Bug fix? no
New feature? no
Deprecations? -
Tickets -
License MIT
Doc PR -

Tentative to leverage the match expression when we can in order to keep on modernizing the code (after array_is_list(), str_starts_with(), str_ends_with() and str_contains()).

Firstly, let's see if the CI is green.

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

Very nice!

@fancyweb
Copy link
Contributor Author

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.

@nicolas-grekas
Copy link
Member

We prefer changing lines once in a single PR, because that helps when running git blame later on.

@fancyweb fancyweb force-pushed the minor/leverage-match branch from 67b5237 to b1be99b Compare February 17, 2022 17:14
@fancyweb fancyweb force-pushed the minor/leverage-match branch from b1be99b to 7d241b1 Compare February 17, 2022 17:21
@derrabus
Copy link
Member

Looks like PHP CS Fixer does not like the code style proposed by @nicolas-grekas (yet).

@nicolas-grekas
Copy link
Member

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)

@fancyweb fancyweb force-pushed the minor/leverage-match branch 2 times, most recently from 3a866fe to b1284dc Compare February 18, 2022 15:01
@fancyweb fancyweb force-pushed the minor/leverage-match branch from b1284dc to 217dc16 Compare February 18, 2022 15:03
@fabpot
Copy link
Member

fabpot commented Feb 19, 2022

Thank you @fancyweb.

@fabpot fabpot merged commit 01ea9a3 into symfony:6.1 Feb 19, 2022
@fancyweb fancyweb deleted the minor/leverage-match branch February 22, 2022 08:45
fabpot added a commit that referenced this pull request Sep 23, 2022
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
symfony-splitter pushed a commit to symfony/twig-bridge that referenced this pull request Sep 23, 2022
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
symfony-splitter pushed a commit to symfony/serializer that referenced this pull request Sep 23, 2022
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
symfony-splitter pushed a commit to symfony/config that referenced this pull request Sep 23, 2022
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
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.

7 participants