[wp-trac] [WordPress Trac] #47632: Coding Standards fixes for WP 5.3
WordPress Trac
noreply at wordpress.org
Sun Jul 7 22:58:15 UTC 2019
#47632: Coding Standards fixes for WP 5.3
----------------------------+-------------------------------
Reporter: pento | Owner: pento
Type: task (blessed) | Status: assigned
Priority: normal | Milestone: 5.3
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses: coding-standards
----------------------------+-------------------------------
Comment (by pento):
Replying to [comment:17 jrf]:
> Understood, though I suspect it may have more to do with
[https://github.com/squizlabs/PHP_CodeSniffer/issues/2396 the fix for this
issue]. Any particular file you can point me to which shows the incorrect
fixes well ?
`src/wp-includes/theme-compat/embed.php` shows it pretty well. `src/wp-
admin/includes/media.php` is also an interesting example of indenting the
`?>` correctly, but not fixing the corresponding `<?php`.
> Just checking: Function names in PHP are case-insensitive, so most of
these could be fixed without breaking anything. Any particular reason why
these functions with case issues are whitelisted instead of fixed ?
`WP_Filesystem` could probably be fixed like this, but everything else
(eg, `dbDelta`) would need to be deprecated and renamed to `db_delta`.
Given the age of these functions, I didn't think it was worth the trouble
of deprecating them for all the thousands of plugins or themes that are
using them.
> For the underscore prefixed functions, a deprecation and new method with
a better name could be considered.
Similarly, these are all really old functions that could possibly be
fixed, but (particularly in the case of the `__return_*()` functions, it
would just be a hassle for the plugins and themes that use them.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47632#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list