diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php index d6f0fa8d7d1a3..12e51de472448 100644 --- a/src/wp-includes/class-wp-theme.php +++ b/src/wp-includes/class-wp-theme.php @@ -298,7 +298,7 @@ public function __construct( $theme_dir, $theme_root, $_child = null ) { self::$cache_expiration = self::$persistently_cache; } } else { - wp_cache_add_non_persistent_groups( 'themes' ); + wp_cache_add_non_persistent_groups( 'themes' ); // @phpstan-ignore function.resultUnused (A no-op in core, but object cache drop-ins implement it.) } } diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index b9086e733c966..a8e6a1922e39e 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -932,7 +932,7 @@ function wp_start_object_cache() { ) ); - wp_cache_add_non_persistent_groups( array( 'counts', 'plugins', 'theme_json' ) ); + wp_cache_add_non_persistent_groups( array( 'counts', 'plugins', 'theme_json' ) ); // @phpstan-ignore function.resultUnused (A no-op in core, but object cache drop-ins implement it.) } $first_init = false; @@ -1314,7 +1314,7 @@ function shutdown_action_hook() { */ do_action( 'shutdown' ); - wp_cache_close(); + wp_cache_close(); // @phpstan-ignore function.resultUnused (A no-op in core, but object cache drop-ins implement it.) } /** diff --git a/src/wp-includes/ms-blogs.php b/src/wp-includes/ms-blogs.php index d791dd2f4526d..e3cf35fac1217 100644 --- a/src/wp-includes/ms-blogs.php +++ b/src/wp-includes/ms-blogs.php @@ -684,7 +684,7 @@ function wp_cache_switch_to_blog_fallback() { ); } - wp_cache_add_non_persistent_groups( $non_persistent_groups ); + wp_cache_add_non_persistent_groups( $non_persistent_groups ); // @phpstan-ignore function.resultUnused (A no-op in core, but object cache drop-ins implement it.) } } diff --git a/tests/phpstan/baselines/function.resultUnused.neon b/tests/phpstan/baselines/function.resultUnused.neon deleted file mode 100644 index 045ad4b731459..0000000000000 --- a/tests/phpstan/baselines/function.resultUnused.neon +++ /dev/null @@ -1,40 +0,0 @@ -# PHPStan baseline for the `function.resultUnused` errors in WordPress core. -# -# https://phpstan.org/error-identifiers/function.resultUnused -# -# Each entry is scoped to a single file and carries an exact occurrence count, -# so that a new instance is reported as a new error rather than being absorbed -# silently. Fixing an occurrence therefore means decrementing or removing its -# entry here as part of the same change. -# -# The goal is to empty this file and delete it. -# -# Generated by `composer phpstan:baselines`. Do not edit by hand. Regenerate with: -# -# composer phpstan:baselines -- --identifier=function.resultUnused --config=phpstan.neon.dist -# -# This reruns the analysis with the baselines in this directory suppressed, so -# that their errors surface again, and rewrites only this file. - -parameters: - ignoreErrors: - - - message: '#^Call to function wp_cache_add_non_persistent_groups\(\) on a separate line has no effect\.$#' - identifier: function.resultUnused - count: 1 - path: ../../../src/wp-includes/class-wp-theme.php - - - message: '#^Call to function wp_cache_add_non_persistent_groups\(\) on a separate line has no effect\.$#' - identifier: function.resultUnused - count: 1 - path: ../../../src/wp-includes/load.php - - - message: '#^Call to function wp_cache_close\(\) on a separate line has no effect\.$#' - identifier: function.resultUnused - count: 1 - path: ../../../src/wp-includes/load.php - - - message: '#^Call to function wp_cache_add_non_persistent_groups\(\) on a separate line has no effect\.$#' - identifier: function.resultUnused - count: 1 - path: ../../../src/wp-includes/ms-blogs.php