diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php index 47ec3db9194d5..d6f0fa8d7d1a3 100644 --- a/src/wp-includes/class-wp-theme.php +++ b/src/wp-includes/class-wp-theme.php @@ -27,12 +27,30 @@ final class WP_Theme implements ArrayAccess { /** - * Whether the theme has been marked as updateable. + * Whether the theme has been marked as updateable, or the theme's update data. + * + * This is false by default. WP_MS_Themes_List_Table sets it to true when an + * update is available for the theme, while get_theme_updates() sets it to the + * theme's entry in the `response` of the `update_themes` site transient. That + * entry always contains the `new_version`, and usually the `theme`, `url`, + * `package`, `requires`, and `requires_php` as well, where `requires` and + * `requires_php` are false when the theme does not declare them. Themes updated + * via the {@see 'update_themes_$hostname'} filter may also include other keys. * * @since 4.4.0 - * @var bool + * @var bool|array + * @phpstan-var bool|array{ + * new_version: string, + * theme?: string, + * url?: string, + * package?: string, + * requires?: string|false, + * requires_php?: string|false, + * ... + * } * * @see WP_MS_Themes_List_Table + * @see get_theme_updates() */ public $update = false; 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