From fc995b041d92b9d4bb86e893cef9a22b50fb3901 Mon Sep 17 00:00:00 2001 From: arshidkv12 Date: Sat, 26 Sep 2026 09:06:15 +0530 Subject: [PATCH] Code Quality: Fix offsetAccess.nonOffsetAccessible errors by correcting inaccurate type annotations --- src/wp-includes/class-wp-theme.php | 2 +- .../offsetAccess.nonOffsetAccessible.neon | 30 ------------------- 2 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 tests/phpstan/baselines/offsetAccess.nonOffsetAccessible.neon diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php index 47ec3db9194d5..236c00fafe482 100644 --- a/src/wp-includes/class-wp-theme.php +++ b/src/wp-includes/class-wp-theme.php @@ -30,7 +30,7 @@ final class WP_Theme implements ArrayAccess { * Whether the theme has been marked as updateable. * * @since 4.4.0 - * @var bool + * @var bool|array * * @see WP_MS_Themes_List_Table */ diff --git a/tests/phpstan/baselines/offsetAccess.nonOffsetAccessible.neon b/tests/phpstan/baselines/offsetAccess.nonOffsetAccessible.neon deleted file mode 100644 index ed021ec794760..0000000000000 --- a/tests/phpstan/baselines/offsetAccess.nonOffsetAccessible.neon +++ /dev/null @@ -1,30 +0,0 @@ -# PHPStan baseline for the `offsetAccess.nonOffsetAccessible` errors in WordPress core. -# -# https://phpstan.org/error-identifiers/offsetAccess.nonOffsetAccessible -# -# 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=offsetAccess.nonOffsetAccessible --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: '#^Cannot access offset ''new_version'' on bool\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 4 - path: ../../../src/wp-admin/includes/class-wp-debug-data.php - - - message: '#^Cannot access offset ''new_version'' on bool\.$#' - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: ../../../src/wp-admin/update-core.php