Make WordPress Core

Changeset 61774

Timestamp:
02/28/2026 07:58:38 PM (4 days ago)
Author:
westonruter
Message:

Code Quality: Add @phpstan-assert-if-true to is_wp_error().

This ensures PHPStan is aware that passing a WP_Error instance to is_wp_error() will cause the function to return true. This reduces the total number of PHPStan errors at rule level 7 from 14,271 to 13,233 (-1,038 or -7.27%).

Developed in https://github.com/WordPress/wordpress-develop/pull/11095

See #64238.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/load.php

    r61443 r61774  
    17991799 * @param mixed $thing The variable to check.
    18001800 * @return bool Whether the variable is an instance of WP_Error.
     1801
     1802
    18011803 */
    18021804function is_wp_error( $thing ) {
Note: See TracChangeset for help on using the changeset viewer.