Opened 5 weeks ago
Last modified 6 days ago
#63268 accepted defect (bug)
PHPStan code quality improvements for 6.9
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch |
Focuses: | coding-standards | Cc: |
Description (last modified by )
Change History (35)
This ticket was mentioned in PR #8680 on WordPress/wordpress-develop by @justlevine.
5 weeks ago
#2
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/63268
This PR fixes the parameter doc-type on WP_REST_Server::get_index()
's $request
param to be a WP_REST_Request
instead of an array
.
While this issue was surfaced via PHPStan in https://github.com/WordPress/wordpress-develop/pull/7619 (trac: https://core.trac.wordpress.org/ticket/61175 ), it can be remediated independently of that ticket.
This ticket was mentioned in PR #8681 on WordPress/wordpress-develop by @justlevine.
5 weeks ago
#3
Trac ticket: https://core.trac.wordpress.org/ticket/63268
This PR updates _wp_filter_build_unique_id()
to explicitly return null
if the function isn't passed a valid $callback
. This is instead of the current behavior where the function can return void
, but is typed as only returning a string
.
While this issue was surfaced via PHPStan in https://github.com/WordPress/wordpress-develop/pull/7619 (trac: https://core.trac.wordpress.org/ticket/61175 ), it can be remediated independently of that ticket.
#4
@
5 weeks ago
- Description modified (diff)
- Focuses coding-standards added
- Milestone changed from Awaiting Review to 6.9
- Owner set to SergeyBiryukov
- Status changed from new to accepted
This ticket was mentioned in PR #8384 on WordPress/wordpress-develop by @justlevine.
5 weeks ago
#5
This PR fixes the default $post
ID param values used in several functions in wp-includes/link-template.php
, to bring them in line with their int
doctypes (and the doctypes of their internal function calls).
More specifically,
get_page_link()
:$post = false
changed to$post = 0
_get_page_link()
:$post = false
changed to$post = 0
post_comments_feed_link()
:$post_id = ''
changed to$post_id = 0
While this issue was surfaced via PHPStan in https://github.com/WordPress/wordpress-develop/pull/7619 (trac: https://core.trac.wordpress.org/ticket/61175 ), it can be remediated independently of that ticket.
Trac ticket: https://core.trac.wordpress.org/ticket/63268
This ticket was mentioned in PR #8385 on WordPress/wordpress-develop by @justlevine.
5 weeks ago
#6
This PR updates the @param
types on get_comments_number_text()
to correctly reflect the default false
parameter.
While this issue was surfaced via PHPStan in https://github.com/WordPress/wordpress-develop/pull/7619 (trac: https://core.trac.wordpress.org/ticket/61175 ), it can be remediated independently of that ticket.
Trac ticket: https://core.trac.wordpress.org/ticket/63268
This ticket was mentioned in PR #8386 on WordPress/wordpress-develop by @justlevine.
5 weeks ago
#7
This PR fixes the doc-block for rest_menu_read_access
, where the third param name is incorrectly named $this
, which is an illegal parameter name.
While this issue was surfaced via PHPStan in https://github.com/WordPress/wordpress-develop/pull/7619 (trac: https://core.trac.wordpress.org/ticket/61175 ), it can be remediated independently of that ticket.
Trac ticket: https://core.trac.wordpress.org/ticket/63268
This ticket was mentioned in PR #8387 on WordPress/wordpress-develop by @justlevine.
5 weeks ago
#8
This PR fixes the default $site_id
parameter value used throughout WP_User
to correctly match the (int) doctypes, and the doctypes of the functions they use internally.
Specifically:
__construct()
:$site_id = ''
is now$site_id = 0
init()
:$site_id = ''
is now$site_id = 0
for_blog()
:$blog_id = ''
is now$blog_id = 0
for_site():
$site_id= ''
is now$site_id = 0
While this issue was surfaced via PHPStan in https://github.com/WordPress/wordpress-develop/pull/7619 (trac: https://core.trac.wordpress.org/ticket/61175 ), it can be remediated independently of that ticket.
Trac ticket: https://core.trac.wordpress.org/ticket/63268
This ticket was mentioned in PR #8388 on WordPress/wordpress-develop by @justlevine.
5 weeks ago
#9
This PR fixes an issue in wp_xmlrpc_server::wp_deleteTerm()
doesn't correctly return the WP_Error
message from the wp_delete_term()
attempt.
While this issue was surfaced via PHPStan in https://github.com/WordPress/wordpress-develop/pull/7619 (trac: https://core.trac.wordpress.org/ticket/61175 ), it can be remediated independently of that ticket.
Trac ticket: https://core.trac.wordpress.org/ticket/63268
This ticket was mentioned in PR #8389 on WordPress/wordpress-develop by @justlevine.
5 weeks ago
#10
This PR fixes the WP_Meta_Query
constructor arg, to take a default value of array()
, as specified by the doc-block @param
.
Since the function is gated with a loose, falsy ! $meta_query
check, there is no difference to function behavior.
While this issue was surfaced via PHPStan in https://github.com/WordPress/wordpress-develop/pull/7619 (trac: https://core.trac.wordpress.org/ticket/61175 ), it can be remediated independently of that ticket.
Trac ticket: https://core.trac.wordpress.org/ticket/63268
This ticket was mentioned in PR #8390 on WordPress/wordpress-develop by @justlevine.
5 weeks ago
#11
This PR updates the @return
type for _wp_get_current_user()
to correctly reflect that it can return a null
value if no user is logged in.
While this issue was surfaced via PHPStan in https://github.com/WordPress/wordpress-develop/pull/7619 (trac: https://core.trac.wordpress.org/ticket/61175 ), it can be remediated independently of that ticket.
Trac ticket: https://core.trac.wordpress.org/ticket/63268
This ticket was mentioned in PR #7720 on WordPress/wordpress-develop by @justlevine.
5 weeks ago
#12
Trac ticket: https://core.trac.wordpress.org/ticket/63268
This PR fixes an issue in get_taxonomy_labels()
, where the template_name
was accessed as an object property on $tax->labels
instead of as an array property.
While this issue was surfaced via PHPStan in https://github.com/WordPress/wordpress-develop/pull/7619 (trac: https://core.trac.wordpress.org/ticket/61175 ), it can be remediated independently of that ticket.
@SergeyBiryukov commented on PR #8384:
5 weeks ago
#14
Thanks for the PR! Merged in r60152.
This ticket was mentioned in PR #8682 on WordPress/wordpress-develop by @justlevine.
5 weeks ago
#15
This PR fixes a bug in WP_Debug_Data::get_wp_themes_inactive()
, where the update_themes
site $transient
was not defined before being checked in several isset()
checks later on in the function (L1359).
While this issue was surfaced via PHPStan in https://github.com/WordPress/wordpress-develop/pull/7619 (trac: https://core.trac.wordpress.org/ticket/61175 ), it can be remediated independently of that ticket.
Trac ticket: https://core.trac.wordpress.org/ticket/63268
This ticket was mentioned in PR #8683 on WordPress/wordpress-develop by @justlevine.
5 weeks ago
#16
This PR updates wp_get_nav_menu_to_edit()
to explicitly return null
and adds null
to the function's return type. This is instead of the existing behavior where the implict void
return is not typehinted.
While this issue was surfaced via PHPStan in https://github.com/WordPress/wordpress-develop/pull/7619 (trac: https://core.trac.wordpress.org/ticket/61175 ), it can be remediated independently of that ticket.
Trac ticket: https://core.trac.wordpress.org/ticket/63268
@SergeyBiryukov commented on PR #8385:
4 weeks ago
#18
Thanks for the PR! Merged in r60166.
@SergeyBiryukov commented on PR #8386:
4 weeks ago
#20
Thanks for the PR! Merged in r60172.
@SergeyBiryukov commented on PR #8387:
4 weeks ago
#22
Thanks for the PR! Merged in r60174.
@SergeyBiryukov commented on PR #8388:
4 weeks ago
#24
Thanks for the PR! Merged in r60175.
@SergeyBiryukov commented on PR #8389:
3 weeks ago
#26
Thanks for the PR! Merged in r60176.
@SergeyBiryukov commented on PR #8680:
3 weeks ago
#28
Thanks for the PR! Merged in r60177.
@SergeyBiryukov commented on PR #8681:
3 weeks ago
#30
Thanks for the PR! Merged in r60179.
@SergeyBiryukov commented on PR #8683:
3 weeks ago
#32
Thanks for the PR! Merged in r60180.
@SergeyBiryukov commented on PR #8682:
12 days ago
#34
Thanks for the PR! Merged in r60181.
@justlevine commented on PR #7720:
6 days ago
#35
On further investigation, this is invalid, and labels is indeed reconverted back to an object.
Crossposted stats from #61175 using https://github.com/WordPress/wordpress-develop/pull/7619, so there's a quick reference for comparison when this ticket gets closed for WP7.0
(even if today's
trunk
isn't 100% synonymous with 6.9)