Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I think this is just code-style. I much prefer to drop out of control structures before returning, but also the variant parts of the statement have already been abstracted out with a variable, so I am at a loss to explain why the two identical statements haven’t been combined.
Comment | File | Size | Author |
---|---|---|---|
#7 | toolbar-cs.patch | 1 KB | zeta ζ |
#2 | toolbar-cs.patch | 1 KB | zeta ζ |
toolbar-cs.patch | 1.03 KB | zeta ζ | |
Comments
Comment #2
zeta ζ CreditAttribution: zeta ζ commentedslight omission…
Comment #3
idflood CreditAttribution: idflood commentedPatch looks good for me. After applying it the toolbar toggle still behave as expected.
Comment #4
zeta ζ CreditAttribution: zeta ζ commentedHi idflood,
Thanks for testing this: Could you mark it RTBC? Being a code style issue, it’s simple enough to not need extensive testing. What you have done is perfectly adequate.
Comment #5
Damien Tournoud CreditAttribution: Damien Tournoud commentedSounds reasonable. This is a minor code clean-up.
Comment #6
Dries CreditAttribution: Dries commentedThis patch no longer applies. It needs a re-roll.
Comment #7
zeta ζ CreditAttribution: zeta ζ commentedRe-roll…
Would you be interested in a coding-standards page, advising do not return from inside a control structure / one return at end of each function?
Comment #8
webchickCommitted to HEAD. Thanks!
zeta ζ: That sounds like a good idea. Maybe coordinate either at http://groups.drupal.org/documentation-team or http://groups.drupal.org/coding-standards-and-best-practices on the best place for that?