Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/wp-includes/class-wp-block-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* Class representing a list of block instances.
*
* @since 5.5.0
*
* @phpstan-implements ArrayAccess<int, WP_Block>
*/
#[AllowDynamicProperties]
class WP_Block_List implements Iterator, ArrayAccess, Countable {
Expand Down Expand Up @@ -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]
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/class-wp-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;

Expand Down
14 changes: 14 additions & 0 deletions src/wp-includes/class-wp-theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions src/wp-includes/class-wp-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 ) ) {
Expand Down
30 changes: 0 additions & 30 deletions tests/phpstan/baselines/property.notFound.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions tests/phpstan/baselines/property.private.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading