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

snake_case convert ImgURL to img_u_r_l #25675

Closed
cuimingda opened this Issue Sep 18, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@cuimingda

cuimingda commented Sep 18, 2018

  • Laravel Version: 5.7
  • PHP Version: 7.2.8
  • Database Driver & Version: 10.3.8-MariaDB Homebrew

Description:

print(snake_case("ImgURL"));
// img_u_r_l

expected: img_url

Steps To Reproduce:

@jmarcher

This comment has been minimized.

Show comment
Hide comment
@jmarcher

jmarcher Sep 18, 2018

Contributor

This is the expected result, if you want to have img_url your original string should be ImgUrl

Contributor

jmarcher commented Sep 18, 2018

This is the expected result, if you want to have img_url your original string should be ImgUrl

@laurencei

This comment has been minimized.

Show comment
Hide comment
@laurencei

laurencei Sep 18, 2018

Member

Closing as @jmarcher has given the answer - this is expected.

Member

laurencei commented Sep 18, 2018

Closing as @jmarcher has given the answer - this is expected.

@laurencei laurencei closed this Sep 18, 2018

@cuimingda

This comment has been minimized.

Show comment
Hide comment
@cuimingda

cuimingda Sep 18, 2018

absolutely not considering the real world case. :-(
there is many situation like this:
GUIElement: gui_element or g_u_i_element ?
IOException: io_exception or i_o_exception?
XMLHttpRequest: xml_http_request or x_m_l_http_request?

snake_case now is not expected. @jmarcher @laurencei . sorry for your sloopy.

cuimingda commented Sep 18, 2018

absolutely not considering the real world case. :-(
there is many situation like this:
GUIElement: gui_element or g_u_i_element ?
IOException: io_exception or i_o_exception?
XMLHttpRequest: xml_http_request or x_m_l_http_request?

snake_case now is not expected. @jmarcher @laurencei . sorry for your sloopy.

@laurencei

This comment has been minimized.

Show comment
Hide comment
@laurencei

laurencei Sep 18, 2018

Member

Is there any specification or document that defines what is the industry standard? I couldnt find one? Otherwise this is just open to interpretation either way?

Member

laurencei commented Sep 18, 2018

Is there any specification or document that defines what is the industry standard? I couldnt find one? Otherwise this is just open to interpretation either way?

@cuimingda

This comment has been minimized.

Show comment
Hide comment
@cuimingda

cuimingda Sep 18, 2018

@laurencei if the api is written by self, we certainly can named ImgUrl. I found a api named ImgURL today, and it is always appeared in my world, may be not your world, fine, i will write one for my case.
:-(

cuimingda commented Sep 18, 2018

@laurencei if the api is written by self, we certainly can named ImgUrl. I found a api named ImgURL today, and it is always appeared in my world, may be not your world, fine, i will write one for my case.
:-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment