Make WordPress Core

Opened 4 months ago

Last modified 5 days ago

#59653 new task (blessed)

PHPStan: Fix function argument type issues for WP 6.5

Reported by: hellofromtonya's profile hellofromTonya Owned by:
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

Previously:

Continuation of the the work to fix function argument type issues as reported by PHPStan. These issues are argument types passed to a WP Core and PHP's built-in functions.

The last report was created 3 years ago https://gist.github.com/xknown/77f8cbe233da75080d1e9258a8c94f95. A new report should be generated as a starting point what issues remain to be fixed in 6.3.

Goals are to:

  • retain the current behavior (i.e. to avoid breaking changes).
  • retain the triggering of notice/warning/error, which are clues and indicators (i.e. rather than silently letting the problem propagate downstream).
  • gain PHP 8 compatibility.
  • ensure code coverage to validate changes.

This ticket is part of the effort to achieve PHP 8+ compatibility.

Change History (4)

#1 @swissspidy
4 months ago

We should really just properly integrate PHPStan into our tooling rather than doing one-off reports every three years.

Aside: why not just rename the existing ticket rather than just closing them without activity & creating a new one.

#2 @swissspidy
4 months ago

We should really just properly integrate PHPStan into our tooling rather than doing one-off reports every three years.

Looks like there is #52217 for that. Solving that will just make our lives easier going forward as it avoids the need for recurring tickets like this.

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


6 days ago

#4 @chaion07
5 days ago

Thanks @hellofromTonya for reporting this. We reviewed this ticket during a recent bug-scrub session and we recommend it would be good to get some movement on the comments about process for PHPStan and this recurring ticket for each cycle, as well as a new PHPStan report (the last one was 3 years ago).

Cheers!

Props to @costdev & @mukesh27

Note: See TracTickets for help on using tickets.