[wp-trac] [WordPress Trac] #41057: Update PHP codebase per WordPress PHP Coding Standards
WordPress Trac
noreply at wordpress.org
Mon Jul 3 08:58:10 UTC 2017
#41057: Update PHP codebase per WordPress PHP Coding Standards
----------------------------+-----------------------
Reporter: netweb | Owner: pento
Type: task (blessed) | Status: accepted
Priority: normal | Milestone: 4.9
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
----------------------------+-----------------------
Comment (by netweb):
Replying to [comment:36 pento]:
> WPCS currently doesn't (I think) change whether a `break` is aligned
with it's `case`, or indented from it. The format isn't defined in the
coding standards, the normal usage for core is to indent the `break` one
tab from the `case` statement.
>
> {{{
> $ ag --php --stats '^(\t*)case(.*\n){0,5}\1break' wp-includes/ wp-admin/
| ag '^\d+ matches$'
> 34 matches
> $ ag --php --stats '^(\t*)case(.*\n){0,5}\1\tbreak' wp-includes/ wp-
admin/ | ag '^\d+ matches$'
> 613 matches
> }}}
>
> Any objections to formalising the latter as the correct standard?
This has now been added to the PHP Coding Standards:
https://make.wordpress.org/core/handbook/best-practices/coding-
standards/php/#indentation
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41057#comment:45>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list