WordPress.org

Make WordPress Core

Opened 4 weeks ago

Last modified 12 days ago

#51423 accepted task (blessed)

Fix function argument type issues reported by PHPStan

Reported by: SergeyBiryukov Owned by: SergeyBiryukov
Milestone: 5.6 Priority: normal
Severity: normal Version:
Component: General Keywords: php8 has-patch has-unit-tests
Focuses: coding-standards Cc:

Description

Background: #50913

Splitting this out from comment:44:ticket:50913. @xknown is going through some issues reported by PHPStan, mostly in places where we are passing the incorrect type to WP core or PHP's built-in functions.

Let's use this ticket to include these fixes in core.

Change History (7)

#1 @SergeyBiryukov
4 weeks ago

  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

This ticket was mentioned in Slack in #core by sergey. View the logs.


4 weeks ago

This ticket was mentioned in Slack in #core by sergey. View the logs.


3 weeks ago

This ticket was mentioned in Slack in #hosting-community by javier. View the logs.


3 weeks ago

This ticket was mentioned in Slack in #core by sergey. View the logs.


2 weeks ago

This ticket was mentioned in PR #553 on WordPress/wordpress-develop by xknown.


2 weeks ago

  • Keywords has-patch has-unit-tests added

This PR attempts to fix the arguments type passed to a WP core and PHP's built-in functions, which would hopefully help reduce the number of PHP fatals for PHP 8.0.

The full list of reported issues can be seen at

https://gist.github.com/xknown/77f8cbe233da75080d1e9258a8c94f95

https://core.trac.wordpress.org/ticket/51423

#7 @prbot
12 days ago

jrfnl commented on PR #553:

Looked through a few of the changes (by far not all) and would like to observe the following: a lot of these changes bypass underlying errors by doing type casting, instead of handling the errors properly. While this will work, I'm not sure this is the always the right choice.

Note: See TracTickets for help on using tickets.