diff --git a/src/wp-includes/class-wp-block-list.php b/src/wp-includes/class-wp-block-list.php index b56b3bd69dc3c..44e3055253a7b 100644 --- a/src/wp-includes/class-wp-block-list.php +++ b/src/wp-includes/class-wp-block-list.php @@ -10,6 +10,8 @@ * Class representing a list of block instances. * * @since 5.5.0 + * + * @phpstan-implements ArrayAccess */ #[AllowDynamicProperties] class WP_Block_List implements Iterator, ArrayAccess, Countable { @@ -105,7 +107,7 @@ public function offsetGet( $offset ) { * * @link https://www.php.net/manual/en/arrayaccess.offsetset.php * - * @param int $offset Offset of block value to set. + * @param int|null $offset Offset of block value to set, or null to append. * @param array|WP_Block $value Block value. */ #[ReturnTypeWillChange] diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php index 513f0f702c61f..58c4d10f3163e 100644 --- a/src/wp-includes/class-wp-query.php +++ b/src/wp-includes/class-wp-query.php @@ -14,6 +14,10 @@ * * @since 1.5.0 * @since 4.5.0 Removed the `$comments_popup` property. + * + * @phpstan-property-read bool $query_vars_changed + * @phpstan-property-read false|(lowercase-string&non-falsy-string) $query_vars_hash + * @phpstan-method void init_query_flags() */ #[AllowDynamicProperties] class WP_Query { @@ -441,6 +445,7 @@ class WP_Query { * * @since 3.1.0 * @var bool|string + * @phpstan-var false|(lowercase-string&non-falsy-string) */ private $query_vars_hash = false; diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php index 87fcd7eec72b4..f7d4aba792a00 100644 --- a/src/wp-includes/class-wp-theme.php +++ b/src/wp-includes/class-wp-theme.php @@ -7,6 +7,20 @@ * @since 3.4.0 * * @phpstan-type Theme_Key 'Name'|'Version'|'Status'|'Title'|'Author'|'Author Name'|'Author URI'|'Description'|'Template'|'Stylesheet'|'Template Files'|'Stylesheet Files'|'Template Dir'|'Stylesheet Dir'|'Screenshot'|'Tags'|'Theme Root'|'Theme Root URI'|'Parent Theme' + * @property-read string|false $name + * @property-read string|false $title + * @property-read string|false $version + * @property-read string|false $parent_theme + * @property-read string $template_dir + * @property-read string $stylesheet_dir + * @property-read string $template + * @property-read string $stylesheet + * @property-read string|false $screenshot + * @property-read string|false $description + * @property-read string|false $author + * @property-read string[]|false $tags + * @property-read string $theme_root + * @property-read string $theme_root_uri */ #[AllowDynamicProperties] final class WP_Theme implements ArrayAccess { diff --git a/src/wp-includes/class-wp-widget.php b/src/wp-includes/class-wp-widget.php index b131c50db3226..4e1edd72fd22b 100644 --- a/src/wp-includes/class-wp-widget.php +++ b/src/wp-includes/class-wp-widget.php @@ -408,6 +408,8 @@ public function display_callback( $args, $widget_args = 1 ) { * @global array $wp_registered_widgets * * @param int $deprecated Not used. + * + * @final */ public function update_callback( $deprecated = 1 ) { global $wp_registered_widgets; @@ -500,6 +502,8 @@ public function update_callback( $deprecated = 1 ) { * @type int $number Number increment used for multiples of the same widget. * } * @return string|null + * + * @final */ public function form_callback( $widget_args = 1 ) { if ( is_numeric( $widget_args ) ) { diff --git a/tests/phpstan/baselines/property.notFound.neon b/tests/phpstan/baselines/property.notFound.neon index 460a5082ab0b8..521bc7619766a 100644 --- a/tests/phpstan/baselines/property.notFound.neon +++ b/tests/phpstan/baselines/property.notFound.neon @@ -158,26 +158,6 @@ parameters: identifier: property.notFound count: 1 path: ../../../src/wp-admin/includes/class-walker-nav-menu-edit.php - - - message: '#^Access to an undefined property WP_Theme\:\:\$author\.$#' - identifier: property.notFound - count: 3 - path: ../../../src/wp-admin/includes/class-wp-debug-data.php - - - message: '#^Access to an undefined property WP_Theme\:\:\$name\.$#' - identifier: property.notFound - count: 4 - path: ../../../src/wp-admin/includes/class-wp-debug-data.php - - - message: '#^Access to an undefined property WP_Theme\:\:\$parent_theme\.$#' - identifier: property.notFound - count: 1 - path: ../../../src/wp-admin/includes/class-wp-debug-data.php - - - message: '#^Access to an undefined property WP_Theme\:\:\$version\.$#' - identifier: property.notFound - count: 6 - path: ../../../src/wp-admin/includes/class-wp-debug-data.php - message: '#^Access to an undefined property WP_Theme\:\:\$auto_update_forced\.$#' identifier: property.notFound @@ -188,11 +168,6 @@ parameters: identifier: property.notFound count: 1 path: ../../../src/wp-admin/includes/class-wp-ms-themes-list-table.php - - - message: '#^Access to an undefined property WP_Theme\:\:\$name\.$#' - identifier: property.notFound - count: 8 - path: ../../../src/wp-admin/includes/class-wp-site-health.php - message: '#^Access to an undefined property WP_Post\:\:\$_wp_attachment_image_alt\.$#' identifier: property.notFound @@ -228,11 +203,6 @@ parameters: identifier: property.notFound count: 2 path: ../../../src/wp-admin/nav-menus.php - - - message: '#^Access to an undefined property WP_Theme\:\:\$version\.$#' - identifier: property.notFound - count: 1 - path: ../../../src/wp-admin/update-core.php - message: '#^Access to an undefined property WP_Post\:\:\$description\.$#' identifier: property.notFound diff --git a/tests/phpstan/baselines/property.private.neon b/tests/phpstan/baselines/property.private.neon index 900a8e51dc423..7549ab9c5ddd5 100644 --- a/tests/phpstan/baselines/property.private.neon +++ b/tests/phpstan/baselines/property.private.neon @@ -18,16 +18,6 @@ parameters: ignoreErrors: - - - message: '#^Access to private property WP_Theme\:\:\$stylesheet\.$#' - identifier: property.private - count: 20 - path: ../../../src/wp-admin/includes/class-wp-debug-data.php - - - message: '#^Access to private property WP_Theme\:\:\$template\.$#' - identifier: property.private - count: 2 - path: ../../../src/wp-admin/includes/class-wp-debug-data.php - message: '#^Access to private property WP_Block_Type\:\:\$uses_context\.$#' identifier: property.private