diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index 27c58b57dd671..4b32257cfad5e 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -1629,6 +1629,8 @@ function wp_load_translations_early() { * Omit this parameter if you only want to fetch the current status. * @return bool True if WP is installing, otherwise false. When a `$is_installing` is passed, the function will * report whether WP was in installing mode prior to the change to `$is_installing`. + * + * @phpstan-impure */ function wp_installing( $is_installing = null ) { static $installing = null; diff --git a/src/wp-includes/query.php b/src/wp-includes/query.php index 60571c01cb880..8db70d585a493 100644 --- a/src/wp-includes/query.php +++ b/src/wp-includes/query.php @@ -462,6 +462,8 @@ function is_comment_feed() { * @global WP_Query $wp_query WordPress Query object. * * @return bool Whether the query is for the front page of the site. + * + * @phpstan-impure */ function is_front_page() { global $wp_query; diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index 07869ae61d0ff..b19237098f788 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -3155,6 +3155,8 @@ function _remove_theme_support( $feature ) { * of possible values. * @param mixed ...$args Optional extra arguments to be checked against certain features. * @return bool True if the active theme supports the feature, false otherwise. + * + * @phpstan-impure */ function current_theme_supports( $feature, ...$args ) { global $_wp_theme_features; diff --git a/tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon b/tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon index c64a48177e085..d93b0e1c6cad9 100644 --- a/tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon +++ b/tests/phpstan/baselines/booleanAnd.leftAlwaysTrue.neon @@ -33,11 +33,6 @@ parameters: identifier: booleanAnd.leftAlwaysTrue count: 1 path: ../../../src/wp-includes/block-template-utils.php - - - message: '#^Left side of && is always true\.$#' - identifier: booleanAnd.leftAlwaysTrue - count: 1 - path: ../../../src/wp-includes/canonical.php - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue diff --git a/tests/phpstan/baselines/booleanNot.alwaysTrue.neon b/tests/phpstan/baselines/booleanNot.alwaysTrue.neon index ae0b0afe52c56..d3ab0987d55f5 100644 --- a/tests/phpstan/baselines/booleanNot.alwaysTrue.neon +++ b/tests/phpstan/baselines/booleanNot.alwaysTrue.neon @@ -18,11 +18,6 @@ parameters: ignoreErrors: - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 1 - path: ../../../src/wp-admin/includes/class-custom-image-header.php - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -53,8 +48,3 @@ parameters: identifier: booleanNot.alwaysTrue count: 1 path: ../../../src/wp-includes/general-template.php - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 1 - path: ../../../src/wp-includes/option.php