[wp-trac] [WordPress Trac] #52217: Fix code issues identified by PHPStan
WordPress Trac
noreply at wordpress.org
Tue Nov 26 21:15:47 UTC 2024
#52217: Fix code issues identified by PHPStan
-------------------------+-------------------------------
Reporter: johnbillion | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses: coding-standards
-------------------------+-------------------------------
Comment (by SergeyBiryukov):
In [changeset:"59462" 59462]:
{{{
#!CommitTicketReference repository="" revision="59462"
Coding Standards: Cast `wp_count_terms()` result to `int` before using in
`ceil()`.
This addresses two instances of the (numeric string) return value from
`wp_count_terms()` being used directly in `ceil()`, which expects an
`int|float`.
Affected methods:
* `WP_Sitemaps_Taxonomies::get_max_num_pages()`
* `wp_nav_menu_item_taxonomy_meta_box()`
Reference: [https://www.php.net/manual/en/function.ceil.php PHP Manual:
ceil()].
Follow-up to [14248], [14291], [14569], [14943], [48072], [57648].
Props justlevine.
See #52217.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52217#comment:88>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list