Quoting #2610958: Start following the Drupal coding standard again:
When we were starting Commerce and Address we decided to break Drupal's coding standard in regards to variable naming, by mandating camelCase everywhere, instead of snake_case. The argument was that the library interfaces already imposed too many camelCase variables, giving us a very inconsistent end result.
Since then we've reduced the essential library interfaces for entities to getters only.
The Drupal interfaces are the ones that provide the setters now.That means our argument is gone, and we should switch back. The resulting code will be uglier, but personal opinions are no basis for going against the ecosystem here.
Address has switched back, Commerce should do the same.
Pushed the commit that fixes commerce and commerce_store:
https://github.com/commerceguys/commerce/commit/c106f094acbd4b3d55bc15b4...
We should focus on making sure new code uses snake_case, and then slowly convert the rest.
(For example, I'll clean up commerce_tax while tackling the other issues there).
Comment | File | Size | Author |
---|---|---|---|
#6 | camelCase_to_snake_case_for_product-2637022-6.patch | 43.52 KB | vasike |
#5 | camelCase_to_snake_case_for_price-2637022-5.patch | 35.07 KB | vasike |
#3 | camelCase_to_snake_case_for_price-2637022-3.patch | 32.83 KB | vasike |
Comments
Comment #2
bojanz CreditAttribution: bojanz at Centarro commentedClean:
- commerce
- commerce_store
- commerce_order
- commerce_cart
Todo:
- commerce_price
- commerce_product
Postponed:
- commerce_tax (to be done by me while cleaning up other things)
Comment #3
vasikethere is patch for commerce_price
Comment #4
bojanz CreditAttribution: bojanz at Centarro commentedIn this example $translatedCurrency needs to become $translated_currency. Every local variable must be converted (that means $translatedCurrency becomes $translated_currency but $this->translatedCurrency stays the same)
Comment #5
vasikeindeed, i missed some of variables. thank you Bojan.
there is an updated patch for commerce_price
Comment #6
vasikeand this is a patch for commerce product.
i hope i was more accurate this time.
Comment #8
bojanz CreditAttribution: bojanz at Centarro commentedGreat. That only leaves commerce_tax, currently on my plate.
Comment #9
bojanz CreditAttribution: bojanz at Centarro commentedThe commerce_tax entities and forms are now camelCase-free. That leaves only the importer, which can happen along the way. Closing this issue.