Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[String] CamelCase/SnakeCase on uppercase word#47423

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:5.4frommpiot:string-camel-snake
Sep 1, 2022

Conversation

@mpiot
Copy link
Contributor

@mpiotmpiot commentedAug 29, 2022
edited
Loading

QA
Branch?6.1
Bug fix?yes
New feature?no
Deprecations?~
TicketsFix#47421
LicenseMIT
Doc PR

The behavior of->snake() method from String component has changed in 6.1.4, now, usingu('SYMFONY')->snake() returns_ymfony instead ofsymfony (#47185).

After, some investigations, it seams the->camel() behavior is not exactly the expected one:u('SYMFONY')->camel() returnsYMFONY instead ofSYMFONY.

This PR give theses behaviors:

  • CamelCase:

    • '' => ''
    • x_y => xY
    • xu_yo => xuYo
    • symfony_is_great => symfonyIsGreat
    • symfony_5_is_great => symfony5IsGreat
    • Symfony is great => symfonyIsGreat
    • Symfony is a great framework => symfonyIsAGreatFramework
    • *Symfony* is GREAT!! => symfonyIsGREAT
    • SYMFONY => SYMFONY
  • SnakeCase:

    • '' => ''
    • x_y => x_y
    • X_Y => x_y
    • xu_yo => xu_yo
    • symfonyIsGreat => symfony_is_great
    • symfony5IsGreat => symfony5_is_great
    • symfony5isGreat => symfony5is_great
    • Symfony is great => symfony_is_great
    • symfonyIsAGreatFramework => symfony_is_a_great_framework
    • symfonyIsGREAT => symfony_is_great
    • symfonyIsREALLYGreat => symfony_is_really_great
    • SYMFONY => symfony

@carsonbotcarsonbot added this to the6.2 milestoneAug 29, 2022
@mpiotmpiotforce-pushed thestring-camel-snake branch 3 times, most recently from5fac902 tof9129e6CompareAugust 29, 2022 10:52
@xabbuh
Copy link
Member

This affects Symfony 5.4 too, doesn't it?

@mpiot
Copy link
ContributorAuthor

@xabbuh oh yes#47185 has been merged in 5.4 branch.

@xabbuhxabbuh modified the milestones:6.2,5.4Aug 31, 2022
@fabpot
Copy link
Member

Thank you@mpiot.

@fabpotfabpot merged commitc61dfca intosymfony:5.4Sep 1, 2022
@mpiotmpiot deleted the string-camel-snake branchSeptember 1, 2022 04:47
@fabpotfabpot mentioned this pull requestSep 30, 2022
This was referencedSep 30, 2022
fabpot added a commit that referenced this pull requestJul 1, 2024
…>snake() methods" (nicolas-grekas)This PR was squashed before being merged into the 5.4 branch.Discussion----------[String] Revert "Fixed u()->snake(), b()->snake() and s()->snake() methods"| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        |Fix#57612| License       | MITThis PR reverts#57497 for BC reasons, but keeps the test cases we added in the process. Those test cases allowed to spot a real issue where the ascii and unicode implementations didn't agree on the resulting camel case for `SYMFONY IS GREAT`. Both implementations now result in `SYMFONYISGREAT` (likely introduced in#47423).Commits-------6397c38 [String] Revert "Fixed u()->snake(), b()->snake() and s()->snake() methods"
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@OskarStarkOskarStarkOskarStark approved these changes

@lyrixxlyrixxAwaiting requested review from lyrixx

@ycerutoycerutoAwaiting requested review from yceruto

@wouterjwouterjAwaiting requested review from wouterj

@chalasrchalasrAwaiting requested review from chalasr

@dunglasdunglasAwaiting requested review from dunglas

@jderussejderusseAwaiting requested review from jderusse

@xabbuhxabbuhAwaiting requested review from xabbuh

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

[String] Snakecase breaked

5 participants

@mpiot@xabbuh@fabpot@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp