-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[String] Fix string to snake case conversion #49339
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
0d27885
to
c307c58
Compare
I would rather go with: symfony5_is_great |
@Kolyunya I think the case is wrong in your example. It should be: |
@Seb33300 my idea was that sequences of letters should be separated from sequences of numbers disregarding the capitalization of letters. So the example I provided is indeed intentional: @OskarStark please let me know if this is the final decision regarding the patch, I will update the tests and the production code accordingly. Although, I believe that
|
I agree, your example makes sense, but this sounds more like a bugfix to me, also I cannot see a BC break here. |
@nicolas-grekas WDYT? |
I don't think this is worth it as this is a BC break. |
Thanks for this proposal. I also think that we shouldn't do this change. In addition to the BC break, there are many legit cases (think of commercial product names, brands, etc.) where splitting by the numbers would be wrong. |
Hi guys!
It seems to me that snake-case converter could be enhanced a bit.
Concretely, I believe that letters should be separated from numbers. What do you think?
Before:
symfony5isGreat
→symfony5is_great
.After:
symfony5isGreat
→symfony_5_is_great
.Notice that if you would decide to merge this, this is a breaking change.