[wp-trac] [WordPress Trac] #56293: Use 'MINUTE_IN_SECONDS' for consistency in 'update.php' file
WordPress Trac
noreply at wordpress.org
Thu Jul 28 20:15:36 UTC 2022
#56293: Use 'MINUTE_IN_SECONDS' for consistency in 'update.php' file
------------------------------------+-------------------------------
Reporter: hztyfoon | Owner: audrasjb
Type: defect (bug) | Status: reviewing
Priority: low | Milestone: 6.1
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback | Focuses: coding-standards
------------------------------------+-------------------------------
Comment (by SergeyBiryukov):
Replying to [comment:17 audrasjb]:
> @peterwilsoncc suggested to replace `MINUTE_IN_SECONDS / 2` with `0.5 *
MINUTE_IN_SECONDS`.
As noted in comment:10:ticket:55647, the former gives `int(30)` while the
latter gives `float(30)`, so we might need to write it like this to avoid
unexpected type changes:
{{{
(int) ( 0.5 * MINUTE_IN_SECONDS )
}}}
That said, the `timeout` parameter of `WP_Http::request()` is documented
as `float`, so a float may be fine here, and casting to `(int)` may be
redundant.
I don't have a strong preference on the format we choose here, but ideally
the instances from [53714] should be updated to use the same format.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56293#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list