-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG]: Camelize helper does not camelCase, and also fails with space delimiters #15850
Comments
@lcdennison We have a few things going on here. For v4 and before the Running your examples with the v3/v4 version of camelize produces:
So for the v4 version of this method and before you get Running this with the current code, gives the results you gave and for sure the last case ( I can correct at least the last example but I am afraid if I change this method, a lot of current applications will break because for better or worse, this method was always returning the first character capitalized. Thoughts? |
We could also introduce one more parameter in the |
…seFirst if need be; Added PascalCase, SnakeCase and KebabCase helpers Related phalcon/cphalcon#15850 Refs phalcon#6.0.x
…seFirst if need be; Added PascalCase, SnakeCase and KebabCase helpers Related phalcon/cphalcon#15850 Refs phalcon#6.0.x
…seFirst if need be; Added PascalCase, SnakeCase and KebabCase helpers Related phalcon/cphalcon#15850 Refs #6.0.x
Resolved in #15851 |
@niden Sorry for the delayed reply. I certainly understand about not wanting to break existing usages that rely on the capitalized first letter. The changes you committed seem to solve everything nicely. For anyone that wants to make I also see a few extra helper classes for pascal, snake, and kebab. Thanks for that! |
@niden One minor bug/inconsistency I think with your fix, didn't notice before. The "Kebab" and "Snake" case delimiters are swapped. The comment for kebab says "kebab-case" but uses the "_" delimiter:
Similarly, the comment for snake says "snake_case" but uses the "-" delimiter:
I believe those delimiters just need to be swapped (and the corresponding tests updated). |
Thank you for the heads up. Resolved in #15875 |
Describe the bug
The Camelize string helper fails on a few fronts. See obvious issues below.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I use the following function, which converts the above test strings to
customerSession
as expected in all cases.If you want PascalCase and snake_case as well:
Details
The text was updated successfully, but these errors were encountered: