@JakubMisek I have the following code:
/**
* Check whether a variable is a WP_Error instance.
*
* @param mixed $thing
*
* @phpstan-assert-if-true WP_Error $thing
*/
function is_wp_error( $thing ) : bool {
return false;
}
/**
* @var array|WP_Error $sites
*/
$sites = null;
if ( is_wp_error( $sites ) ) {
return;
}
$sites;
But $sites type doesn't seem to get narrowed:
