From aae9d1a4725e5a9afc4e4d653bb0758fd95ec844 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 5 Aug 2026 00:31:21 -0700 Subject: [PATCH] Bump PHPStan rule level to 2 and regenerate baselines --- phpstan.neon.dist | 21 +- tests/phpstan/baselines/arguments.count.neon | 50 +++ tests/phpstan/baselines/binaryOp.invalid.neon | 35 ++ tests/phpstan/baselines/class.nameCase.neon | 25 ++ tests/phpstan/baselines/class.notFound.neon | 90 +++++ .../encapsedStringPart.nonString.neon | 25 ++ tests/phpstan/baselines/greater.invalid.neon | 25 ++ tests/phpstan/baselines/method.nonObject.neon | 55 +++ tests/phpstan/baselines/method.notFound.neon | 45 +++ .../baselines/parameter.defaultValue.neon | 105 ++++++ .../phpstan/baselines/parameter.notFound.neon | 35 ++ .../baselines/parameter.phpDocType.neon | 25 ++ .../baselines/parameter.unresolvableType.neon | 25 ++ .../phpstan/baselines/property.nonObject.neon | 255 ++++++++++++++ .../phpstan/baselines/property.notFound.neon | 330 ++++++++++++++++++ tests/phpstan/baselines/property.private.neon | 60 ++++ .../phpstan/baselines/property.protected.neon | 60 ++++ tests/phpstan/baselines/return.missing.neon | 225 ++++++++++++ .../staticClassAccess.privateMethod.neon | 190 ++++++++++ .../phpstan/baselines/varTag.noVariable.neon | 60 ++++ 20 files changed, 1740 insertions(+), 1 deletion(-) create mode 100644 tests/phpstan/baselines/arguments.count.neon create mode 100644 tests/phpstan/baselines/binaryOp.invalid.neon create mode 100644 tests/phpstan/baselines/class.nameCase.neon create mode 100644 tests/phpstan/baselines/class.notFound.neon create mode 100644 tests/phpstan/baselines/encapsedStringPart.nonString.neon create mode 100644 tests/phpstan/baselines/greater.invalid.neon create mode 100644 tests/phpstan/baselines/method.nonObject.neon create mode 100644 tests/phpstan/baselines/method.notFound.neon create mode 100644 tests/phpstan/baselines/parameter.defaultValue.neon create mode 100644 tests/phpstan/baselines/parameter.notFound.neon create mode 100644 tests/phpstan/baselines/parameter.phpDocType.neon create mode 100644 tests/phpstan/baselines/parameter.unresolvableType.neon create mode 100644 tests/phpstan/baselines/property.nonObject.neon create mode 100644 tests/phpstan/baselines/property.notFound.neon create mode 100644 tests/phpstan/baselines/property.private.neon create mode 100644 tests/phpstan/baselines/property.protected.neon create mode 100644 tests/phpstan/baselines/return.missing.neon create mode 100644 tests/phpstan/baselines/staticClassAccess.privateMethod.neon create mode 100644 tests/phpstan/baselines/varTag.noVariable.neon diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 778b24b78c465..e96b6cfd9ce20 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -22,14 +22,33 @@ includes: # Regenerate with `composer phpstan:baselines`, which rewrites both the files # and the list between the markers. Do not edit that list by hand. # phpstan:baselines start + - tests/phpstan/baselines/arguments.count.neon + - tests/phpstan/baselines/binaryOp.invalid.neon + - tests/phpstan/baselines/class.nameCase.neon + - tests/phpstan/baselines/class.notFound.neon - tests/phpstan/baselines/empty.variable.neon + - tests/phpstan/baselines/encapsedStringPart.nonString.neon + - tests/phpstan/baselines/greater.invalid.neon - tests/phpstan/baselines/isset.variable.neon + - tests/phpstan/baselines/method.nonObject.neon + - tests/phpstan/baselines/method.notFound.neon + - tests/phpstan/baselines/parameter.defaultValue.neon + - tests/phpstan/baselines/parameter.notFound.neon + - tests/phpstan/baselines/parameter.phpDocType.neon + - tests/phpstan/baselines/parameter.unresolvableType.neon + - tests/phpstan/baselines/property.nonObject.neon + - tests/phpstan/baselines/property.notFound.neon + - tests/phpstan/baselines/property.private.neon + - tests/phpstan/baselines/property.protected.neon + - tests/phpstan/baselines/return.missing.neon + - tests/phpstan/baselines/staticClassAccess.privateMethod.neon + - tests/phpstan/baselines/varTag.noVariable.neon - tests/phpstan/baselines/variable.undefined.neon # phpstan:baselines end parameters: # https://phpstan.org/user-guide/rule-levels - level: 1 + level: 2 reportUnmatchedIgnoredErrors: true # The following ignored errors are not intended to be fixed, as distinct from the baselines diff --git a/tests/phpstan/baselines/arguments.count.neon b/tests/phpstan/baselines/arguments.count.neon new file mode 100644 index 0000000000000..e3cab51b3621e --- /dev/null +++ b/tests/phpstan/baselines/arguments.count.neon @@ -0,0 +1,50 @@ +# PHPStan baseline for the `arguments.count` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/arguments.count +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=arguments.count +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Method WP_List_Table\:\:display_rows\(\) invoked with 2 parameters, 0 required\.$#' + identifier: arguments.count + count: 1 + path: ../../../src/wp-admin/includes/ajax-actions.php + - + message: '#^Method WP_List_Table\:\:single_row\(\) invoked with 2 parameters, 1 required\.$#' + identifier: arguments.count + count: 2 + path: ../../../src/wp-admin/includes/ajax-actions.php + - + message: '#^Method WP_List_Table\:\:single_row\(\) invoked with 3 parameters, 1 required\.$#' + identifier: arguments.count + count: 1 + path: ../../../src/wp-admin/includes/ajax-actions.php + - + message: '#^Method WP_Upgrader_Skin\:\:before\(\) invoked with 1 parameter, 0 required\.$#' + identifier: arguments.count + count: 2 + path: ../../../src/wp-admin/includes/class-plugin-upgrader.php + - + message: '#^Method WP_Upgrader_Skin\:\:before\(\) invoked with 1 parameter, 0 required\.$#' + identifier: arguments.count + count: 2 + path: ../../../src/wp-admin/includes/class-theme-upgrader.php + - + message: '#^Method WP_List_Table\:\:display\(\) invoked with 1 parameter, 0 required\.$#' + identifier: arguments.count + count: 1 + path: ../../../src/wp-admin/includes/meta-boxes.php diff --git a/tests/phpstan/baselines/binaryOp.invalid.neon b/tests/phpstan/baselines/binaryOp.invalid.neon new file mode 100644 index 0000000000000..167f159cffb34 --- /dev/null +++ b/tests/phpstan/baselines/binaryOp.invalid.neon @@ -0,0 +1,35 @@ +# PHPStan baseline for the `binaryOp.invalid` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/binaryOp.invalid +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=binaryOp.invalid +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Binary operation "/" between string and 2 results in an error\.$#' + identifier: binaryOp.invalid + count: 2 + path: ../../../src/wp-content/themes/twentytwenty/functions.php + - + message: '#^Binary operation "\+" between array\\|WP_Comment\>\|int\<1, max\> and 1 results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: ../../../src/wp-includes/comment.php + - + message: '#^Binary operation "\+" between string and int results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: ../../../src/wp-includes/user.php diff --git a/tests/phpstan/baselines/class.nameCase.neon b/tests/phpstan/baselines/class.nameCase.neon new file mode 100644 index 0000000000000..dd88c5b677aa8 --- /dev/null +++ b/tests/phpstan/baselines/class.nameCase.neon @@ -0,0 +1,25 @@ +# PHPStan baseline for the `class.nameCase` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/class.nameCase +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=class.nameCase +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Class MO referenced with incorrect case\: Mo\.$#' + identifier: class.nameCase + count: 1 + path: ../../../src/wp-includes/class-wp-locale-switcher.php diff --git a/tests/phpstan/baselines/class.notFound.neon b/tests/phpstan/baselines/class.notFound.neon new file mode 100644 index 0000000000000..560ceafb56573 --- /dev/null +++ b/tests/phpstan/baselines/class.notFound.neon @@ -0,0 +1,90 @@ +# PHPStan baseline for the `class.notFound` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/class.notFound +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=class.notFound +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Property WP_Filesystem_FTPext\:\:\$link has unknown class FTP\\Connection as its type\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-wp-filesystem-ftpext.php + - + message: '#^Function _crop_image_resource\(\) has invalid return type GdImage\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-admin/includes/image-edit.php + - + message: '#^Function _flip_image_resource\(\) has invalid return type GdImage\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-admin/includes/image-edit.php + - + message: '#^Function _rotate_image_resource\(\) has invalid return type GdImage\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-admin/includes/image-edit.php + - + message: '#^Parameter \$img of function _crop_image_resource\(\) has invalid type GdImage\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-admin/includes/image-edit.php + - + message: '#^Parameter \$img of function _flip_image_resource\(\) has invalid type GdImage\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-admin/includes/image-edit.php + - + message: '#^Parameter \$img of function _rotate_image_resource\(\) has invalid type GdImage\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-admin/includes/image-edit.php + - + message: '#^Function load_image_to_edit\(\) has invalid return type GdImage\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-admin/includes/image.php + - + message: '#^Call to method html\(\) on an unknown class WP_Press_This_Plugin\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-admin/press-this.php + - + message: '#^Method WP_Image_Editor_GD\:\:_resize\(\) has invalid return type GdImage\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-includes/class-wp-image-editor-gd.php + - + message: '#^Parameter \$image of method WP_Image_Editor_GD\:\:_save\(\) has invalid type GdImage\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-includes/class-wp-image-editor-gd.php + - + message: '#^Property WP_Image_Editor_GD\:\:\$image has unknown class GdImage as its type\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-includes/class-wp-image-editor-gd.php + - + message: '#^Function wp_imagecreatetruecolor\(\) has invalid return type GdImage\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-includes/media.php + - + message: '#^Parameter \$image of function is_gd_image\(\) has invalid type GdImage\.$#' + identifier: class.notFound + count: 1 + path: ../../../src/wp-includes/media.php diff --git a/tests/phpstan/baselines/encapsedStringPart.nonString.neon b/tests/phpstan/baselines/encapsedStringPart.nonString.neon new file mode 100644 index 0000000000000..707a2192a4c8a --- /dev/null +++ b/tests/phpstan/baselines/encapsedStringPart.nonString.neon @@ -0,0 +1,25 @@ +# PHPStan baseline for the `encapsedStringPart.nonString` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/encapsedStringPart.nonString +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=encapsedStringPart.nonString +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Part \$form_fields\[''_final''\] \(non\-empty\-array\\) of encapsed string cannot be cast to string\.$#' + identifier: encapsedStringPart.nonString + count: 1 + path: ../../../src/wp-admin/includes/media.php diff --git a/tests/phpstan/baselines/greater.invalid.neon b/tests/phpstan/baselines/greater.invalid.neon new file mode 100644 index 0000000000000..bf9ca0aa0250f --- /dev/null +++ b/tests/phpstan/baselines/greater.invalid.neon @@ -0,0 +1,25 @@ +# PHPStan baseline for the `greater.invalid` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/greater.invalid +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=greater.invalid +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Comparison operation "\>" between \*NEVER\* and 0 results in an error\.$#' + identifier: greater.invalid + count: 1 + path: ../../../src/wp-admin/includes/upgrade.php diff --git a/tests/phpstan/baselines/method.nonObject.neon b/tests/phpstan/baselines/method.nonObject.neon new file mode 100644 index 0000000000000..4d0727f8950f1 --- /dev/null +++ b/tests/phpstan/baselines/method.nonObject.neon @@ -0,0 +1,55 @@ +# PHPStan baseline for the `method.nonObject` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/method.nonObject +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=method.nonObject +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Cannot call method inline_edit\(\) on WP_List_Table\|false\.$#' + identifier: method.nonObject + count: 1 + path: ../../../src/wp-admin/edit-tags.php + - + message: '#^Cannot call method inline_edit\(\) on WP_List_Table\|false\.$#' + identifier: method.nonObject + count: 1 + path: ../../../src/wp-admin/edit.php + - + message: '#^Cannot call method embed_scripts\(\) on WP_List_Table\|false\.$#' + identifier: method.nonObject + count: 1 + path: ../../../src/wp-admin/erase-personal-data.php + - + message: '#^Cannot call method process_bulk_action\(\) on WP_List_Table\|false\.$#' + identifier: method.nonObject + count: 1 + path: ../../../src/wp-admin/erase-personal-data.php + - + message: '#^Cannot call method embed_scripts\(\) on WP_List_Table\|false\.$#' + identifier: method.nonObject + count: 1 + path: ../../../src/wp-admin/export-personal-data.php + - + message: '#^Cannot call method process_bulk_action\(\) on WP_List_Table\|false\.$#' + identifier: method.nonObject + count: 1 + path: ../../../src/wp-admin/export-personal-data.php + - + message: '#^Cannot call method theme_installer_single\(\) on WP_List_Table\|false\.$#' + identifier: method.nonObject + count: 1 + path: ../../../src/wp-admin/includes/theme-install.php diff --git a/tests/phpstan/baselines/method.notFound.neon b/tests/phpstan/baselines/method.notFound.neon new file mode 100644 index 0000000000000..5d6bccb070ecb --- /dev/null +++ b/tests/phpstan/baselines/method.notFound.neon @@ -0,0 +1,45 @@ +# PHPStan baseline for the `method.notFound` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/method.notFound +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=method.notFound +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Call to an undefined method WP_Upgrader\:\:get_name_for_update\(\)\.$#' + identifier: method.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-language-pack-upgrader-skin.php + - + message: '#^Call to an undefined method WP_Upgrader\:\:plugin_info\(\)\.$#' + identifier: method.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-plugin-installer-skin.php + - + message: '#^Call to an undefined method WP_Upgrader\:\:plugin_info\(\)\.$#' + identifier: method.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-plugin-upgrader-skin.php + - + message: '#^Call to an undefined method WP_Upgrader\:\:theme_info\(\)\.$#' + identifier: method.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-theme-installer-skin.php + - + message: '#^Call to an undefined method WP_Upgrader\:\:theme_info\(\)\.$#' + identifier: method.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-theme-upgrader-skin.php diff --git a/tests/phpstan/baselines/parameter.defaultValue.neon b/tests/phpstan/baselines/parameter.defaultValue.neon new file mode 100644 index 0000000000000..34b6b678fc447 --- /dev/null +++ b/tests/phpstan/baselines/parameter.defaultValue.neon @@ -0,0 +1,105 @@ +# PHPStan baseline for the `parameter.defaultValue` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/parameter.defaultValue +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=parameter.defaultValue +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Default value of the parameter \#1 \$admin_header_callback \(''''\) of method Custom_Background\:\:__construct\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/class-custom-background.php + - + message: '#^Default value of the parameter \#2 \$admin_image_div_callback \(''''\) of method Custom_Background\:\:__construct\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/class-custom-background.php + - + message: '#^Default value of the parameter \#2 \$admin_image_div_callback \(''''\) of method Custom_Image_Header\:\:__construct\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/class-custom-image-header.php + - + message: '#^Default value of the parameter \#5 \$callback \(''''\) of function add_comments_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#5 \$callback \(''''\) of function add_dashboard_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#5 \$callback \(''''\) of function add_links_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#5 \$callback \(''''\) of function add_management_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#5 \$callback \(''''\) of function add_media_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#5 \$callback \(''''\) of function add_menu_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#5 \$callback \(''''\) of function add_options_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#5 \$callback \(''''\) of function add_pages_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#5 \$callback \(''''\) of function add_plugins_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#5 \$callback \(''''\) of function add_posts_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#5 \$callback \(''''\) of function add_theme_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#5 \$callback \(''''\) of function add_users_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#6 \$callback \(''''\) of function add_submenu_page\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-admin/includes/plugin.php + - + message: '#^Default value of the parameter \#3 \$deprecated \(''''\) of function unregister_setting\(\) is incompatible with type callable\(\)\: mixed\.$#' + identifier: parameter.defaultValue + count: 1 + path: ../../../src/wp-includes/option.php diff --git a/tests/phpstan/baselines/parameter.notFound.neon b/tests/phpstan/baselines/parameter.notFound.neon new file mode 100644 index 0000000000000..c3835cd7903c4 --- /dev/null +++ b/tests/phpstan/baselines/parameter.notFound.neon @@ -0,0 +1,35 @@ +# PHPStan baseline for the `parameter.notFound` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/parameter.notFound +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=parameter.notFound +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^PHPDoc tag @param references unknown parameter\: \$key$#' + identifier: parameter.notFound + count: 1 + path: ../../../src/wp-includes/functions.php + - + message: '#^PHPDoc tag @param references unknown parameter\: \$url$#' + identifier: parameter.notFound + count: 1 + path: ../../../src/wp-includes/functions.php + - + message: '#^PHPDoc tag @param references unknown parameter\: \$value$#' + identifier: parameter.notFound + count: 1 + path: ../../../src/wp-includes/functions.php diff --git a/tests/phpstan/baselines/parameter.phpDocType.neon b/tests/phpstan/baselines/parameter.phpDocType.neon new file mode 100644 index 0000000000000..db8a7f3b32466 --- /dev/null +++ b/tests/phpstan/baselines/parameter.phpDocType.neon @@ -0,0 +1,25 @@ +# PHPStan baseline for the `parameter.phpDocType` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/parameter.phpDocType +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=parameter.phpDocType +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^PHPDoc tag @param for parameter \$block_type with type array\ is incompatible with native type string\.$#' + identifier: parameter.phpDocType + count: 1 + path: ../../../src/wp-includes/class-wp-block-processor.php diff --git a/tests/phpstan/baselines/parameter.unresolvableType.neon b/tests/phpstan/baselines/parameter.unresolvableType.neon new file mode 100644 index 0000000000000..1193e163ca555 --- /dev/null +++ b/tests/phpstan/baselines/parameter.unresolvableType.neon @@ -0,0 +1,25 @@ +# PHPStan baseline for the `parameter.unresolvableType` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/parameter.unresolvableType +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=parameter.unresolvableType +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^PHPDoc tag @param for parameter \$type contains unresolvable type\.$#' + identifier: parameter.unresolvableType + count: 1 + path: ../../../src/wp-includes/class-wp-feed-cache-transient.php diff --git a/tests/phpstan/baselines/property.nonObject.neon b/tests/phpstan/baselines/property.nonObject.neon new file mode 100644 index 0000000000000..81a4af3e09511 --- /dev/null +++ b/tests/phpstan/baselines/property.nonObject.neon @@ -0,0 +1,255 @@ +# PHPStan baseline for the `property.nonObject` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/property.nonObject +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=property.nonObject +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Cannot access property \$download_link on array\|object\.$#' + identifier: property.nonObject + count: 2 + path: ../../../src/wp-admin/includes/ajax-actions.php + - + message: '#^Cannot access property \$id on int\|string\|WP_Term\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/ajax-actions.php + - + message: '#^Cannot access property \$link on int\|string\|WP_Term\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/ajax-actions.php + - + message: '#^Cannot access property \$name on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/ajax-actions.php + - + message: '#^Cannot access property \$themes on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/ajax-actions.php + - + message: '#^Cannot access property \$download_link on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/class-theme-upgrader.php + - + message: '#^Cannot access property \$name on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/class-theme-upgrader.php + - + message: '#^Cannot access property \$version on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/class-theme-upgrader.php + - + message: '#^Cannot access property \$current on array\|object\.$#' + identifier: property.nonObject + count: 3 + path: ../../../src/wp-admin/includes/class-wp-automatic-updater.php + - + message: '#^Cannot access property \$response on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/class-wp-automatic-updater.php + - + message: '#^Cannot access property \$version on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/class-wp-automatic-updater.php + - + message: '#^Cannot access property \$info on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/class-wp-plugin-install-list-table.php + - + message: '#^Cannot access property \$plugins on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/class-wp-plugin-install-list-table.php + - + message: '#^Cannot access property \$parent on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/class-wp-terms-list-table.php + - + message: '#^Cannot access property \$term_id on array\|object\.$#' + identifier: property.nonObject + count: 2 + path: ../../../src/wp-admin/includes/class-wp-terms-list-table.php + - + message: '#^Cannot access property \$info on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/class-wp-theme-install-list-table.php + - + message: '#^Cannot access property \$themes on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/class-wp-theme-install-list-table.php + - + message: '#^Cannot access property \$author on array\|object\.$#' + identifier: property.nonObject + count: 2 + path: ../../../src/wp-admin/includes/plugin-install.php + - + message: '#^Cannot access property \$downloaded on array\|object\.$#' + identifier: property.nonObject + count: 2 + path: ../../../src/wp-admin/includes/plugin-install.php + - + message: '#^Cannot access property \$external on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/plugin-install.php + - + message: '#^Cannot access property \$homepage on array\|object\.$#' + identifier: property.nonObject + count: 2 + path: ../../../src/wp-admin/includes/plugin-install.php + - + message: '#^Cannot access property \$name on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/includes/plugin-install.php + - + message: '#^Cannot access property \$requires on array\|object\.$#' + identifier: property.nonObject + count: 2 + path: ../../../src/wp-admin/includes/plugin-install.php + - + message: '#^Cannot access property \$sections on array\|object\.$#' + identifier: property.nonObject + count: 5 + path: ../../../src/wp-admin/includes/plugin-install.php + - + message: '#^Cannot access property \$slug on array\|object\.$#' + identifier: property.nonObject + count: 3 + path: ../../../src/wp-admin/includes/plugin-install.php + - + message: '#^Cannot access property \$tested on array\|object\.$#' + identifier: property.nonObject + count: 2 + path: ../../../src/wp-admin/includes/plugin-install.php + - + message: '#^Cannot access property \$version on array\|object\.$#' + identifier: property.nonObject + count: 2 + path: ../../../src/wp-admin/includes/plugin-install.php + - + message: '#^Cannot access property \$meta_key on object\|true\.$#' + identifier: property.nonObject + count: 4 + path: ../../../src/wp-admin/includes/post.php + - + message: '#^Cannot access property \$post_id on object\|true\.$#' + identifier: property.nonObject + count: 2 + path: ../../../src/wp-admin/includes/post.php + - + message: '#^Cannot access property \$download_link on array\|object\.$#' + identifier: property.nonObject + count: 2 + path: ../../../src/wp-admin/update.php + - + message: '#^Cannot access property \$name on array\|object\.$#' + identifier: property.nonObject + count: 2 + path: ../../../src/wp-admin/update.php + - + message: '#^Cannot access property \$version on array\|object\.$#' + identifier: property.nonObject + count: 2 + path: ../../../src/wp-admin/update.php + - + message: '#^Cannot access property \$comment_shortcuts on WP_User\|false\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/user-edit.php + - + message: '#^Cannot access property \$infinite_scrolling on WP_User\|false\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-admin/user-edit.php + - + message: '#^Cannot access property \$id on int\|string\|WP_Term\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-includes/category-template.php + - + message: '#^Cannot access property \$link on int\|string\|WP_Term\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-includes/category-template.php + - + message: '#^Cannot access property \$themes on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-includes/class-wp-customize-manager.php + - + message: '#^Cannot access property \$object_id on array\|WP_Error\|WP_Term\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-includes/class-wp-term-query.php + - + message: '#^Cannot access property \$term_id on string\|WP_Customize_Setting\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-includes/customize/class-wp-customize-nav-menu-control.php + - + message: '#^Cannot access property \$link_id on array\|object\.$#' + identifier: property.nonObject + count: 3 + path: ../../../src/wp-includes/link-template.php + - + message: '#^Cannot access property \$plugins on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-block-directory-controller.php + - + message: '#^Cannot access property \$auto_add on WP_Term\|false\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php + - + message: '#^Cannot access property \$download_link on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php + - + message: '#^Cannot access property \$language_packs on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php + - + message: '#^Cannot access property \$parent on array\|object\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-includes/taxonomy.php + - + message: '#^Cannot access property \$template_name on array\.$#' + identifier: property.nonObject + count: 1 + path: ../../../src/wp-includes/taxonomy.php + - + message: '#^Cannot access property \$term_id on array\|object\.$#' + identifier: property.nonObject + count: 4 + path: ../../../src/wp-includes/taxonomy.php diff --git a/tests/phpstan/baselines/property.notFound.neon b/tests/phpstan/baselines/property.notFound.neon new file mode 100644 index 0000000000000..7893a2dd24bb6 --- /dev/null +++ b/tests/phpstan/baselines/property.notFound.neon @@ -0,0 +1,330 @@ +# PHPStan baseline for the `property.notFound` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/property.notFound +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=property.notFound +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Access to an undefined property WP_Upgrader_Skin\:\:\$language_update\.$#' + identifier: property.notFound + count: 2 + path: ../../../src/wp-admin/includes/class-language-pack-upgrader.php + - + message: '#^Access to an undefined property WP_Upgrader\:\:\$new_plugin_data\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-plugin-installer-skin.php + - + message: '#^Access to an undefined property WP_Upgrader_Skin\:\:\$plugin_active\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-plugin-upgrader.php + - + message: '#^Access to an undefined property WP_Upgrader_Skin\:\:\$plugin_info\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-plugin-upgrader.php + - + message: '#^Access to an undefined property WP_Upgrader\:\:\$new_theme_data\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-theme-installer-skin.php + - + message: '#^Access to an undefined property WP_Upgrader_Skin\:\:\$api\.$#' + identifier: property.notFound + count: 2 + path: ../../../src/wp-admin/includes/class-theme-upgrader.php + - + message: '#^Access to an undefined property WP_Upgrader_Skin\:\:\$theme_info\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-theme-upgrader.php + - + message: '#^Access to an undefined property WP_Post\:\:\$attr_title\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-checklist.php + - + message: '#^Access to an undefined property WP_Post\:\:\$classes\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-checklist.php + - + message: '#^Access to an undefined property WP_Post\:\:\$menu_item_parent\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-checklist.php + - + message: '#^Access to an undefined property WP_Post\:\:\$object\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-checklist.php + - + message: '#^Access to an undefined property WP_Post\:\:\$object_id\.$#' + identifier: property.notFound + count: 2 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-checklist.php + - + message: '#^Access to an undefined property WP_Post\:\:\$target\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-checklist.php + - + message: '#^Access to an undefined property WP_Post\:\:\$title\.$#' + identifier: property.notFound + count: 2 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-checklist.php + - + message: '#^Access to an undefined property WP_Post\:\:\$type\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-checklist.php + - + message: '#^Access to an undefined property WP_Post\:\:\$url\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-checklist.php + - + message: '#^Access to an undefined property WP_Post\:\:\$xfn\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-checklist.php + - + message: '#^Access to an undefined property WP_Post\:\:\$classes\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-edit.php + - + message: '#^Access to an undefined property WP_Post\:\:\$description\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-edit.php + - + message: '#^Access to an undefined property WP_Post\:\:\$menu_item_parent\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-edit.php + - + message: '#^Access to an undefined property WP_Post\:\:\$object\.$#' + identifier: property.notFound + count: 4 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-edit.php + - + message: '#^Access to an undefined property WP_Post\:\:\$object_id\.$#' + identifier: property.notFound + count: 3 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-edit.php + - + message: '#^Access to an undefined property WP_Post\:\:\$target\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-edit.php + - + message: '#^Access to an undefined property WP_Post\:\:\$title\.$#' + identifier: property.notFound + count: 4 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-edit.php + - + message: '#^Access to an undefined property WP_Post\:\:\$type\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-edit.php + - + message: '#^Access to an undefined property WP_Post\:\:\$type_label\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-edit.php + - + message: '#^Access to an undefined property WP_Post\:\:\$url\.$#' + identifier: property.notFound + count: 2 + path: ../../../src/wp-admin/includes/class-walker-nav-menu-edit.php + - + message: '#^Access to an undefined property WP_Post\:\:\$xfn\.$#' + 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: 5 + path: ../../../src/wp-admin/includes/class-wp-debug-data.php + - + message: '#^Access to an undefined property WP_Theme\:\:\$auto_update_forced\.$#' + 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\:\:\$update_supported\.$#' + 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 + count: 2 + path: ../../../src/wp-admin/includes/image.php + - + message: '#^Access to an undefined property WP_Post\:\:\$front_or_home\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/nav-menu.php + - + message: '#^Access to an undefined property WP_Post\:\:\$privacy_policy_page\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/nav-menu.php + - + message: '#^Access to an undefined property wpdb\:\:\$categories\.$#' + identifier: property.notFound + count: 4 + path: ../../../src/wp-admin/includes/upgrade.php + - + message: '#^Access to an undefined property wpdb\:\:\$link2cat\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-admin/includes/upgrade.php + - + message: '#^Access to an undefined property wpdb\:\:\$post2cat\.$#' + identifier: property.notFound + count: 4 + path: ../../../src/wp-admin/includes/upgrade.php + - + message: '#^Access to an undefined property WP_Term\:\:\$truncated_name\.$#' + 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 + count: 1 + path: ../../../src/wp-content/themes/twentyfifteen/functions.php + - + message: '#^Access to an undefined property WP_Post\:\:\$classes\.$#' + identifier: property.notFound + count: 2 + path: ../../../src/wp-content/themes/twentynineteen/inc/icon-functions.php + - + message: '#^Access to an undefined property WP_Post\:\:\$url\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-content/themes/twentynineteen/inc/icon-functions.php + - + message: '#^Access to an undefined property WP_Post\:\:\$classes\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-content/themes/twentynineteen/inc/template-functions.php + - + message: '#^Access to an undefined property WP_Post\:\:\$classes\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-content/themes/twentyseventeen/inc/icon-functions.php + - + message: '#^Access to an undefined property WP_Post\:\:\$classes\.$#' + identifier: property.notFound + count: 2 + path: ../../../src/wp-content/themes/twentytwenty/inc/template-tags.php + - + message: '#^Access to an undefined property WP_Post\:\:\$url\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-content/themes/twentytwenty/inc/template-tags.php + - + message: '#^Access to an undefined property WP_Post\:\:\$url\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-content/themes/twentytwentyone/inc/menu-functions.php + - + message: '#^Access to an undefined property WP_Post_Type\:\:\$capabilities\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-includes/capabilities.php + - + message: '#^Access to an undefined property WP_Term\:\:\$link\.$#' + identifier: property.notFound + count: 2 + path: ../../../src/wp-includes/category-template.php + - + message: '#^Access to an undefined property WP_Post\:\:\$current\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-includes/class-walker-nav-menu.php + - + message: '#^Access to an undefined property WP_Post\:\:\$title\.$#' + identifier: property.notFound + count: 2 + path: ../../../src/wp-includes/class-walker-nav-menu.php + - + message: '#^Access to an undefined property WP_Query\:\:\$comments_by_type\.$#' + identifier: property.notFound + count: 3 + path: ../../../src/wp-includes/comment-template.php + - + message: '#^Access to an undefined property WP_Post\:\:\$attr_title\.$#' + identifier: property.notFound + count: 2 + path: ../../../src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php + - + message: '#^Access to an undefined property WP_Post\:\:\$db_id\.$#' + identifier: property.notFound + count: 2 + path: ../../../src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php + - + message: '#^Access to an undefined property WP_Post\:\:\$description\.$#' + identifier: property.notFound + count: 2 + path: ../../../src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php + - + message: '#^Access to an undefined property WP_Post\:\:\$type\.$#' + identifier: property.notFound + count: 3 + path: ../../../src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php + - + message: '#^Access to an undefined property WP_Post\:\:\$type_label\.$#' + identifier: property.notFound + count: 1 + path: ../../../src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php + - + message: '#^Access to an undefined property WP_Post\:\:\$url\.$#' + identifier: property.notFound + count: 4 + path: ../../../src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php diff --git a/tests/phpstan/baselines/property.private.neon b/tests/phpstan/baselines/property.private.neon new file mode 100644 index 0000000000000..900a8e51dc423 --- /dev/null +++ b/tests/phpstan/baselines/property.private.neon @@ -0,0 +1,60 @@ +# PHPStan baseline for the `property.private` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/property.private +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=property.private +# +# which reruns the analysis with this file suppressed so the errors surface again. + +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 + count: 1 + path: ../../../src/wp-admin/includes/post.php + - + message: '#^Access to private property WP_Block_Type\:\:\$variations\.$#' + identifier: property.private + count: 1 + path: ../../../src/wp-admin/includes/post.php + - + message: '#^Access to private property WP_Block_Type\:\:\$uses_context\.$#' + identifier: property.private + count: 1 + path: ../../../src/wp-includes/class-wp-block.php + - + message: '#^Access to private property WP_Object_Cache\:\:\$cache\.$#' + identifier: property.private + count: 2 + path: ../../../src/wp-includes/ms-blogs.php + - + message: '#^Access to private property WP_Block_Type\:\:\$uses_context\.$#' + identifier: property.private + count: 1 + path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php + - + message: '#^Access to private property WP_Block_Type\:\:\$variations\.$#' + identifier: property.private + count: 1 + path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php diff --git a/tests/phpstan/baselines/property.protected.neon b/tests/phpstan/baselines/property.protected.neon new file mode 100644 index 0000000000000..b29d125bd2a7a --- /dev/null +++ b/tests/phpstan/baselines/property.protected.neon @@ -0,0 +1,60 @@ +# PHPStan baseline for the `property.protected` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/property.protected +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=property.protected +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Access to protected property WP_List_Table\:\:\$screen\.$#' + identifier: property.protected + count: 1 + path: ../../../src/wp-admin/erase-personal-data.php + - + message: '#^Access to protected property WP_List_Table\:\:\$screen\.$#' + identifier: property.protected + count: 1 + path: ../../../src/wp-admin/export-personal-data.php + - + message: '#^Access to protected property WP_List_Table\:\:\$screen\.$#' + identifier: property.protected + count: 1 + path: ../../../src/wp-admin/includes/ajax-actions.php + - + message: '#^Access to protected property wpdb\:\:\$dbh\.$#' + identifier: property.protected + count: 3 + path: ../../../src/wp-admin/includes/class-wp-debug-data.php + - + message: '#^Access to protected property wpdb\:\:\$dbhost\.$#' + identifier: property.protected + count: 1 + path: ../../../src/wp-admin/includes/class-wp-debug-data.php + - + message: '#^Access to protected property wpdb\:\:\$dbname\.$#' + identifier: property.protected + count: 1 + path: ../../../src/wp-admin/includes/class-wp-debug-data.php + - + message: '#^Access to protected property wpdb\:\:\$dbuser\.$#' + identifier: property.protected + count: 1 + path: ../../../src/wp-admin/includes/class-wp-debug-data.php + - + message: '#^Access to protected property WP_Object_Cache\:\:\$global_groups\.$#' + identifier: property.protected + count: 2 + path: ../../../src/wp-includes/ms-blogs.php diff --git a/tests/phpstan/baselines/return.missing.neon b/tests/phpstan/baselines/return.missing.neon new file mode 100644 index 0000000000000..11bb654bafb2c --- /dev/null +++ b/tests/phpstan/baselines/return.missing.neon @@ -0,0 +1,225 @@ +# PHPStan baseline for the `return.missing` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/return.missing +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=return.missing +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Method Twenty_Eleven_Ephemera_Widget\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-content/themes/twentyeleven/inc/widgets.php + - + message: '#^Method Twenty_Fourteen_Ephemera_Widget\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-content/themes/twentyfourteen/inc/widgets.php + - + message: '#^Function get_category_by_path\(\) should return array\|WP_Error\|WP_Term\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/category.php + - + message: '#^Method WP_Customize_Manager\:\:get_control\(\) should return WP_Customize_Control\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/class-wp-customize-manager.php + - + message: '#^Method WP_Customize_Manager\:\:get_panel\(\) should return WP_Customize_Panel\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/class-wp-customize-manager.php + - + message: '#^Method WP_Customize_Manager\:\:get_section\(\) should return WP_Customize_Section\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/class-wp-customize-manager.php + - + message: '#^Method WP_Customize_Manager\:\:get_setting\(\) should return WP_Customize_Setting\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/class-wp-customize-manager.php + - + message: '#^Method WP_Customize_Widgets\:\:get_setting_type\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/class-wp-customize-widgets.php + - + message: '#^Method WP_Image_Editor_Imagick\:\:set_imagick_time_limit\(\) should return int\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/class-wp-image-editor-imagick.php + - + message: '#^Method WP_Customize_Header_Image_Control\:\:get_current_image_src\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/customize/class-wp-customize-header-image-control.php + - + message: '#^Function post_type_archive_title\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/general-template.php + - + message: '#^Function single_month_title\(\) should return string\|false\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/general-template.php + - + message: '#^Function single_post_title\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/general-template.php + - + message: '#^Function single_term_title\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/general-template.php + - + message: '#^Function the_date\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/general-template.php + - + message: '#^Function the_modified_date\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/general-template.php + - + message: '#^Function wp_title\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/general-template.php + - + message: '#^Function edit_term_link\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/link-template.php + - + message: '#^Function get_next_posts_link\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/link-template.php + - + message: '#^Function get_next_posts_page_link\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 2 + path: ../../../src/wp-includes/link-template.php + - + message: '#^Function get_previous_posts_link\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/link-template.php + - + message: '#^Function get_previous_posts_page_link\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/link-template.php + - + message: '#^Function next_posts\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/link-template.php + - + message: '#^Function previous_posts\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/link-template.php + - + message: '#^Function wp_list_users\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/user.php + - + message: '#^Method WP_Nav_Menu_Widget\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-nav-menu-widget.php + - + message: '#^Method WP_Widget_Archives\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-archives.php + - + message: '#^Method WP_Widget_Block\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-block.php + - + message: '#^Method WP_Widget_Calendar\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-calendar.php + - + message: '#^Method WP_Widget_Categories\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-categories.php + - + message: '#^Method WP_Widget_Custom_HTML\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-custom-html.php + - + message: '#^Method WP_Widget_Links\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-links.php + - + message: '#^Method WP_Widget_Media\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-media.php + - + message: '#^Method WP_Widget_Meta\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-meta.php + - + message: '#^Method WP_Widget_Pages\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-pages.php + - + message: '#^Method WP_Widget_Recent_Comments\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-recent-comments.php + - + message: '#^Method WP_Widget_Recent_Posts\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-recent-posts.php + - + message: '#^Method WP_Widget_RSS\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-rss.php + - + message: '#^Method WP_Widget_Search\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 1 + path: ../../../src/wp-includes/widgets/class-wp-widget-search.php + - + message: '#^Method WP_Widget_Tag_Cloud\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 2 + path: ../../../src/wp-includes/widgets/class-wp-widget-tag-cloud.php + - + message: '#^Method WP_Widget_Text\:\:form\(\) should return string\|null but return statement is missing\.$#' + identifier: return.missing + count: 2 + path: ../../../src/wp-includes/widgets/class-wp-widget-text.php diff --git a/tests/phpstan/baselines/staticClassAccess.privateMethod.neon b/tests/phpstan/baselines/staticClassAccess.privateMethod.neon new file mode 100644 index 0000000000000..c3a8969643a94 --- /dev/null +++ b/tests/phpstan/baselines/staticClassAccess.privateMethod.neon @@ -0,0 +1,190 @@ +# PHPStan baseline for the `staticClassAccess.privateMethod` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/staticClassAccess.privateMethod +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=staticClassAccess.privateMethod +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^Unsafe call to private method WP_Classic_To_Block_Menu_Converter\:\:group_by_parent_id\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-classic-to-block-menu-converter.php + - + message: '#^Unsafe call to private method WP_Classic_To_Block_Menu_Converter\:\:to_blocks\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 2 + path: ../../../src/wp-includes/class-wp-classic-to-block-menu-converter.php + - + message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:create_classic_menu_fallback\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-navigation-fallback.php + - + message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:create_default_fallback\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-navigation-fallback.php + - + message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:get_default_fallback_blocks\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-navigation-fallback.php + - + message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:get_fallback_classic_menu\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-navigation-fallback.php + - + message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:get_most_recently_created_nav_menu\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-navigation-fallback.php + - + message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:get_most_recently_published_navigation\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 3 + path: ../../../src/wp-includes/class-wp-navigation-fallback.php + - + message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:get_nav_menu_at_primary_location\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-navigation-fallback.php + - + message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:get_nav_menu_with_primary_slug\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-navigation-fallback.php + - + message: '#^Unsafe call to private method WP_Theme_JSON_Resolver\:\:inject_variations_from_block_style_variation_files\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-theme-json-resolver.php + - + message: '#^Unsafe call to private method WP_Theme_JSON_Resolver\:\:inject_variations_from_block_styles_registry\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-theme-json-resolver.php + - + message: '#^Unsafe call to private method WP_Theme_JSON_Resolver\:\:recursively_iterate_json\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 2 + path: ../../../src/wp-includes/class-wp-theme-json-resolver.php + - + message: '#^Unsafe call to private method WP_Theme_JSON_Resolver\:\:remove_json_comments\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 2 + path: ../../../src/wp-includes/class-wp-theme-json-resolver.php + - + message: '#^Unsafe call to private method WP_Theme_JSON_Resolver\:\:style_variation_has_scope\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-theme-json-resolver.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:compute_spacing_sizes\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 3 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:get_block_name_from_metadata_path\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 2 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:get_block_nodes\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 3 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:get_feature_selector\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:get_viewport_breakpoint_value_in_pixels\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:is_valid_viewport_breakpoint_size\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:merge_spacing_sizes\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 2 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:remove_indirect_properties\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 2 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:resolve_custom_css_format\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:sanitize_viewport_settings\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 3 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:unwrap_shared_block_style_variations\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:update_button_width_declarations\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 4 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:update_paragraph_text_indent_selector\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 4 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Theme_JSON\:\:update_separator_declarations\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/class-wp-theme-json.php + - + message: '#^Unsafe call to private method WP_Font_Face_Resolver\:\:convert_font_face_properties\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/fonts/class-wp-font-face-resolver.php + - + message: '#^Unsafe call to private method WP_Font_Face_Resolver\:\:maybe_parse_name_from_comma_separated_list\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/fonts/class-wp-font-face-resolver.php + - + message: '#^Unsafe call to private method WP_Font_Face_Resolver\:\:parse_settings\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 2 + path: ../../../src/wp-includes/fonts/class-wp-font-face-resolver.php + - + message: '#^Unsafe call to private method WP_Font_Face_Resolver\:\:to_kebab_case\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/fonts/class-wp-font-face-resolver.php + - + message: '#^Unsafe call to private method WP_Font_Face_Resolver\:\:to_theme_file_uri\(\) through static\:\:\.$#' + identifier: staticClassAccess.privateMethod + count: 1 + path: ../../../src/wp-includes/fonts/class-wp-font-face-resolver.php diff --git a/tests/phpstan/baselines/varTag.noVariable.neon b/tests/phpstan/baselines/varTag.noVariable.neon new file mode 100644 index 0000000000000..36e0f9fed1382 --- /dev/null +++ b/tests/phpstan/baselines/varTag.noVariable.neon @@ -0,0 +1,60 @@ +# PHPStan baseline for the `varTag.noVariable` errors in WordPress core. +# +# https://phpstan.org/error-identifiers/varTag.noVariable +# +# 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, along with the `includes` entry +# for it in phpstan.neon.dist. +# +# Generated by `composer phpstan:baselines`. Do not edit by hand; regenerate with +# +# composer phpstan:baselines -- --identifier=varTag.noVariable +# +# which reruns the analysis with this file suppressed so the errors surface again. + +parameters: + ignoreErrors: + - + message: '#^PHPDoc tag @var does not specify variable name\.$#' + identifier: varTag.noVariable + count: 1 + path: ../../../src/wp-admin/install.php + - + message: '#^PHPDoc tag @var does not specify variable name\.$#' + identifier: varTag.noVariable + count: 1 + path: ../../../src/wp-admin/profile.php + - + message: '#^PHPDoc tag @var does not specify variable name\.$#' + identifier: varTag.noVariable + count: 1 + path: ../../../src/wp-admin/upgrade.php + - + message: '#^PHPDoc tag @var does not specify variable name\.$#' + identifier: varTag.noVariable + count: 1 + path: ../../../src/wp-cron.php + - + message: '#^PHPDoc tag @var above assignment does not specify variable name\.$#' + identifier: varTag.noVariable + count: 9 + path: ../../../src/wp-includes/class-wp-query.php + - + message: '#^PHPDoc tag @var does not specify variable name\.$#' + identifier: varTag.noVariable + count: 1 + path: ../../../src/wp-includes/kses.php + - + message: '#^PHPDoc tag @var does not specify variable name\.$#' + identifier: varTag.noVariable + count: 2 + path: ../../../src/wp-includes/rest-api.php + - + message: '#^PHPDoc tag @var does not specify variable name\.$#' + identifier: varTag.noVariable + count: 1 + path: ../../../src/xmlrpc.php