[wp-trac] [WordPress Trac] #48142: Let's do some `phpcbf` cleanup...
WordPress Trac
noreply at wordpress.org
Thu Sep 26 17:34:51 UTC 2019
#48142: Let's do some `phpcbf` cleanup...
-------------------------------------+------------------------
Reporter: whyisjake | Owner: whyisjake
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 5.3
Component: General | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch needs-refresh | Focuses:
-------------------------------------+------------------------
Changes (by garrett-eclipse):
* keywords: has-patch => has-patch needs-refresh
Comment:
Thanks for the feedback @jrf
Replying to [comment:10 jrf]:
> @garrett-eclipse pinged me to have a look at the patches here.
>
> Re: [46316] - this may lead to difficult to debug issues unless you are
100% sure both sides of the comparison will always be numeric.
Effectively, the change makes no difference to the code and it is still a
loose type comparison, as the `(int)` cast is what PHP would do internally
when using `!=`.
>
> So if a true strict type comparison is intended here, a string-based
strict comparison should be used:
> {{{#!php
> <?php
> if ( $cat_id !== (string) $category ) {
> }}}
>
> Also see: https://phpcheatsheets.com/compare/not_equal/
I'm going to leave this comparison check to @SergeyBiryukov for review.
> Re: `CS-network.php.diff`: comments should use proper punctuation, i.e.
start with a capital letter and end with a punctuation character, so this
inline comment would not pass once the docs checks get activated.
> {{{#!php
> <?php
> activate_plugin( $path, '', true ); // $network_wide = true
> }}}
I appreciate the feedback, as I copied that comment from previous in the
file I've gone through and addressed all comments in the file in
[https://core.trac.wordpress.org/attachment/ticket/48142/CS-
network.php.2.diff CS-network.php.2.diff] ensuring they started with a
capital and ended with punctuation.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48142#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list