Skip to content

Commit 27c65a9

Browse files
committed
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 WordPress/wordpress-develop#11095 See #64238. Built from https://develop.svn.wordpress.org/trunk@61774 git-svn-id: http://core.svn.wordpress.org/trunk@61080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 4bbdf78 commit 27c65a9

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

wp-includes/load.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,6 +1798,8 @@ function wp_doing_cron() {
17981798
*
17991799
* @param mixed $thing The variable to check.
18001800
* @return bool Whether the variable is an instance of WP_Error.
1801+
*
1802+
* @phpstan-assert-if-true WP_Error $thing
18011803
*/
18021804
function is_wp_error( $thing ) {
18031805
$is_wp_error = ( $thing instanceof WP_Error );

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '7.0-beta2-61773';
19+
$wp_version = '7.0-beta2-61774';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)