diff --git a/phpstan.neon.dist b/phpstan.neon.dist
index 9f53887d400de..062dd43509769 100644
--- a/phpstan.neon.dist
+++ b/phpstan.neon.dist
@@ -124,3 +124,23 @@ parameters:
message: '#^PHPDoc tag @throws with type InvalidArgumentException\|ValueError is not subtype of Throwable$#'
path: src/wp-includes/compat.php
reportUnmatched: false
+
+ # Level 5:
+ # substr_compare()'s $length has always accepted null, meaning "compare the full length". PHP 7.4 spelled
+ # that `int $length = null`, where the null default makes the parameter implicitly nullable, and PHP 8.0
+ # only made it explicit as `?int $length = null`. The behavior never differed: verified on PHP 7.4 that
+ # passing null compares the whole string rather than coercing to a length of 0.
+ #
+ # PHPStan reads the two spellings from two sources and only one is right. Its PHP 8 stub carries `?int`,
+ # but the pre-8.0 `resources/functionMap.php` records the type as plain `int`, having dropped the implicit
+ # nullability when it was transcribed from the old manual. Because `phpVersion.min` is 70400, the legacy
+ # map wins and null is reported as invalid.
+ #
+ # This lives here rather than in a baseline because a baseline entry records work still to be done, and
+ # there is none: the call is correct on every version WordPress supports, and the fault is in PHPStan's
+ # data. Passing an explicit length purely to satisfy it would change working code to suit a tooling bug.
+ # `reportUnmatched: false` so this entry lapses quietly if PHPStan corrects the map.
+ -
+ message: '#^Parameter \#4 \$length of function substr_compare expects int, null given\.$#'
+ path: src/wp-includes/html-api/class-wp-html-tag-processor.php
+ reportUnmatched: false
diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php
index 8a319986766b8..bb8382569dbaa 100644
--- a/src/wp-admin/includes/class-wp-posts-list-table.php
+++ b/src/wp-admin/includes/class-wp-posts-list-table.php
@@ -1135,7 +1135,7 @@ protected function _column_title( $post, $classes, $data, $primary ) {
* @return string The post title, or 'no title' if no title.
*/
protected function get_primary_column_aria_label( $item ) {
- return isset( $item->post_title ) && ! empty( $item->post_title ) ? $item->post_title : __( 'no title' );
+ return ! empty( $item->post_title ) ? $item->post_title : __( 'no title' );
}
/**
diff --git a/src/wp-admin/users.php b/src/wp-admin/users.php
index a94a9eff4a9cf..1a2177a21dbf7 100644
--- a/src/wp-admin/users.php
+++ b/src/wp-admin/users.php
@@ -339,6 +339,11 @@
selectors ) && is_array( $block_type->selectors )
+ $block_selectors = is_array( $block_type->selectors )
? $block_type->selectors
: array();
diff --git a/src/wp-includes/class-wp-block-type.php b/src/wp-includes/class-wp-block-type.php
index d06279879c1f8..811e65c6ab390 100644
--- a/src/wp-includes/class-wp-block-type.php
+++ b/src/wp-includes/class-wp-block-type.php
@@ -357,8 +357,9 @@ public function __construct( $block_type, $args = array() ) {
* @since 6.1.0
*
* @param string $name Deprecated property name.
- * @return string|string[]|null The value read from the new property if the first item in the array provided,
- * null when value not found or when unknown property name provided.
+ * @return string|string[]|array[]|null The value read from the new property if the first item in the array
+ * provided, the variations or uses context arrays for those two names,
+ * null when value not found or when unknown property name provided.
*/
public function __get( $name ) {
if ( 'variations' === $name ) {
diff --git a/src/wp-includes/class-wp-comment.php b/src/wp-includes/class-wp-comment.php
index f14fac6614901..c2ebe94ec8ef1 100644
--- a/src/wp-includes/class-wp-comment.php
+++ b/src/wp-includes/class-wp-comment.php
@@ -63,22 +63,24 @@ final class WP_Comment {
/**
* Comment ID.
*
- * A numeric string, for compatibility reasons.
+ * A numeric string, for compatibility reasons. Note that {@see get_comment_to_edit()}
+ * replaces it with an integer in place.
*
* @since 4.4.0
- * @var string
- * @phpstan-var numeric-string
+ * @var string|int
+ * @phpstan-var numeric-string|int
*/
public $comment_ID;
/**
* ID of the post the comment is associated with.
*
- * A numeric string, for compatibility reasons.
+ * A numeric string, for compatibility reasons. Note that {@see get_comment_to_edit()}
+ * replaces it with an integer in place.
*
* @since 4.4.0
- * @var string
- * @phpstan-var numeric-string
+ * @var string|int
+ * @phpstan-var numeric-string|int
*/
public $comment_post_ID = '0';
diff --git a/src/wp-includes/class-wp-theme-json.php b/src/wp-includes/class-wp-theme-json.php
index f9d07ccaa6c10..c20960bd0f9cc 100644
--- a/src/wp-includes/class-wp-theme-json.php
+++ b/src/wp-includes/class-wp-theme-json.php
@@ -5672,8 +5672,9 @@ protected static function get_block_element_selectors( $root_selector ) {
*
* @since 6.3.0
*
- * @param object $metadata The related block metadata containing selectors.
- * @param object $node A merged theme.json node for block or variation.
+ * @param array $metadata The related block metadata containing selectors.
+ * @param array $node A merged theme.json node for block or variation. Features
+ * promoted to their own selector are removed from it.
* @return array The style declarations for the node's features with custom
* selectors.
*/
diff --git a/src/wp-includes/class-wp-view-config-data.php b/src/wp-includes/class-wp-view-config-data.php
index be85e9dc10d60..a1f6fd37f99b1 100644
--- a/src/wp-includes/class-wp-view-config-data.php
+++ b/src/wp-includes/class-wp-view-config-data.php
@@ -523,7 +523,7 @@ private function merge_properties( $current, $incoming, $replace_lists ) {
// A non-empty list only lands where a list (or nothing) lives, under
// merge() and replace() alike. An empty array is shape-ambiguous and
// exempt, so replace() with an empty list can still clear a list.
- if ( array() !== $incoming && is_array( $current ) && ! array_is_list( $current ) && array() !== $current ) {
+ if ( array() !== $incoming && is_array( $current ) && ! array_is_list( $current ) ) {
_doing_it_wrong(
__METHOD__,
esc_html__( 'A view configuration patch value must match the shape of the value it patches: a list merges into a list, and an associative array into an associative array.' ),
diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php
index f63b98e5d6e0b..597fdf4118d68 100644
--- a/src/wp-includes/taxonomy.php
+++ b/src/wp-includes/taxonomy.php
@@ -1598,7 +1598,7 @@ function unregister_term_meta( $taxonomy, $meta_key ) {
* @phpstan-return (
* $term is null ? null : (
* $term is 0 ? 0 : (
- * $taxonomy is '' ? int|null : (
+ * $taxonomy is '' ? numeric-string|null : (
* array{
* term_id: numeric-string,
* term_taxonomy_id: numeric-string,
diff --git a/tests/phpstan/baselines/argument.type.neon b/tests/phpstan/baselines/argument.type.neon
index 7c5e40014c762..c1b7e7c679cf1 100644
--- a/tests/phpstan/baselines/argument.type.neon
+++ b/tests/phpstan/baselines/argument.type.neon
@@ -28,21 +28,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-admin/admin-header.php
- -
- message: '#^Parameter \#1 \$post of function get_edit_post_link expects int\|WP_Post, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-admin/comment.php
- -
- message: '#^Parameter \#1 \$post of function get_post_status expects int\|WP_Post\|null, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-admin/comment.php
- -
- message: '#^Parameter \#1 \$post of function get_the_title expects int\|WP_Post, string given\.$#'
- identifier: argument.type
- count: 2
- path: ../../../src/wp-admin/comment.php
-
message: '#^Parameter \#1 \$position of function wp_comment_reply expects int, string given\.$#'
identifier: argument.type
@@ -53,16 +38,6 @@ parameters:
identifier: argument.type
count: 2
path: ../../../src/wp-admin/edit-form-advanced.php
- -
- message: '#^Parameter \#1 \$post of function get_edit_post_link expects int\|WP_Post, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-admin/edit-form-comment.php
- -
- message: '#^Parameter \#1 \$post of function get_the_title expects int\|WP_Post, string given\.$#'
- identifier: argument.type
- count: 2
- path: ../../../src/wp-admin/edit-form-comment.php
-
message: '#^Parameter \#1 \$screen of function do_meta_boxes expects string\|WP_Screen, null given\.$#'
identifier: argument.type
@@ -93,11 +68,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-admin/includes/ajax-actions.php
- -
- message: '#^Parameter \#1 \$comment_id of function _wp_ajax_delete_comment_response expects int, string given\.$#'
- identifier: argument.type
- count: 2
- path: ../../../src/wp-admin/includes/ajax-actions.php
-
message: '#^Parameter \#2 \$compare_from of function wp_get_revision_ui_diff expects int, string given\.$#'
identifier: argument.type
@@ -138,16 +108,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-admin/includes/class-wp-automatic-updater.php
- -
- message: '#^Parameter \#1 \$post of function post_password_required expects int\|WP_Post\|null, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-admin/includes/class-wp-comments-list-table.php
- -
- message: '#^Parameter \#3 \$post of function get_comment_class expects int\|WP_Post\|null, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-admin/includes/class-wp-comments-list-table.php
-
message: '#^Parameter \#3 \$number of function _nx expects int, float given\.$#'
identifier: argument.type
@@ -178,21 +138,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-admin/includes/class-wp-upgrader.php
- -
- message: '#^Parameter \#1 \$post of function _draft_or_post_title expects int\|WP_Post, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-admin/includes/dashboard.php
- -
- message: '#^Parameter \#1 \$post of function get_the_permalink expects int\|WP_Post, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-admin/includes/dashboard.php
- -
- message: '#^Parameter \#1 \$post of function post_password_required expects int\|WP_Post\|null, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-admin/includes/dashboard.php
-
message: '#^Parameter \#3 \$name of function submit_button expects string, false given\.$#'
identifier: argument.type
@@ -478,11 +423,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-content/themes/twentyeleven/functions.php
- -
- message: '#^Parameter \#1 \$comment of function get_comment_link expects int\|WP_Comment\|null, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-content/themes/twentyeleven/functions.php
-
message: '#^Parameter \#1 \$size of function next_image_link expects array\\|string, false given\.$#'
identifier: argument.type
@@ -618,11 +558,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-content/themes/twentyten/functions.php
- -
- message: '#^Parameter \#1 \$comment of function get_comment_link expects int\|WP_Comment\|null, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-content/themes/twentyten/functions.php
-
message: '#^Parameter \#1 \$wp_head_callback of function add_custom_image_header expects callable\(\)\: mixed, '''' given\.$#'
identifier: argument.type
@@ -688,11 +623,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-content/themes/twentytwelve/functions.php
- -
- message: '#^Parameter \#1 \$comment of function get_comment_link expects int\|WP_Comment\|null, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-content/themes/twentytwelve/functions.php
-
message: '#^Parameter \#1 \$size of function next_image_link expects array\\|string, false given\.$#'
identifier: argument.type
@@ -788,16 +718,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-includes/class-wp-block-parser.php
- -
- message: '#^Parameter \#1 \$child_id of method WP_Comment\:\:get_child\(\) expects int, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/class-wp-comment-query.php
- -
- message: '#^Parameter \#1 \$ids of function _prime_post_caches expects array\, list\ given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/class-wp-comment-query.php
-
message: '#^Parameter \#1 \$ajax_message of method WP_Customize_Manager\:\:wp_die\(\) expects string\|WP_Error, int given\.$#'
identifier: argument.type
@@ -913,21 +833,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-includes/class-wp-site.php
- -
- message: '#^Parameter \#1 \$metadata of method WP_Theme_JSON\:\:get_feature_declarations_for_node\(\) expects object, array given\.$#'
- identifier: argument.type
- count: 4
- path: ../../../src/wp-includes/class-wp-theme-json.php
- -
- message: '#^Parameter \#1 \$node of method WP_Theme_JSON\:\:process_pseudo_selectors\(\) expects array, object given\.$#'
- identifier: argument.type
- count: 2
- path: ../../../src/wp-includes/class-wp-theme-json.php
- -
- message: '#^Parameter \#1 \$styles of static method WP_Theme_JSON\:\:compute_style_properties\(\) expects array, object given\.$#'
- identifier: argument.type
- count: 3
- path: ../../../src/wp-includes/class-wp-theme-json.php
-
message: '#^Parameter \#2 \$data of method WP_Theme\:\:cache_add\(\) expects array\|string, int given\.$#'
identifier: argument.type
@@ -948,11 +853,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-includes/class-wp-widget.php
- -
- message: '#^Parameter \#1 \$post of function get_the_title expects int\|WP_Post, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/class-wp-xmlrpc-server.php
-
message: '#^Parameter \#1 \$postarr of function wp_insert_post expects array\{ID\?\: int, post_author\?\: int, post_date\?\: string, post_date_gmt\?\: string, post_content\?\: string, post_content_filtered\?\: string, post_title\?\: string, post_excerpt\?\: string, \.\.\., \.\.\.\}, array\{post_author\: int, post_date\: int\|string, post_date_gmt\: int\|string, post_content\: string, post_title\: string, post_category\: array\\|string, post_status\: ''draft''\|''publish''\} given\.$#'
identifier: argument.type
@@ -968,46 +868,11 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-includes/class-wp-xmlrpc-server.php
- -
- message: '#^Parameter \#1 \$comment_id of function get_page_of_comment expects int, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/comment-template.php
- -
- message: '#^Parameter \#1 \$post of function get_permalink expects int\|WP_Post, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/comment-template.php
- -
- message: '#^Parameter \#1 \$post of function post_password_required expects int\|WP_Post\|null, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/comment-template.php
-
message: '#^Parameter \#1 \$user_id of function get_userdata expects int, string given\.$#'
identifier: argument.type
count: 2
path: ../../../src/wp-includes/comment-template.php
- -
- message: '#^Parameter \#1 \$comment of function get_comment_link expects int\|WP_Comment\|null, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/comment.php
- -
- message: '#^Parameter \#1 \$comment_id of function add_comment_meta expects int, string given\.$#'
- identifier: argument.type
- count: 5
- path: ../../../src/wp-includes/comment.php
- -
- message: '#^Parameter \#1 \$comment_id of function delete_comment_meta expects int, string given\.$#'
- identifier: argument.type
- count: 8
- path: ../../../src/wp-includes/comment.php
- -
- message: '#^Parameter \#1 \$comment_id of function get_comment_text expects int\|WP_Comment, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/comment.php
-
message: '#^Parameter \#1 \$comment_id of function get_page_of_comment expects int, string given\.$#'
identifier: argument.type
@@ -1023,26 +888,11 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-includes/comment.php
- -
- message: '#^Parameter \#1 \$ids of function clean_comment_cache expects array\|int, string given\.$#'
- identifier: argument.type
- count: 2
- path: ../../../src/wp-includes/comment.php
- -
- message: '#^Parameter \#1 \$post_id of function wp_update_comment_count expects int\|null, string given\.$#'
- identifier: argument.type
- count: 2
- path: ../../../src/wp-includes/comment.php
-
message: '#^Parameter \#2 \$meta_id of function delete_metadata_by_mid expects int, string\|null given\.$#'
identifier: argument.type
count: 1
path: ../../../src/wp-includes/comment.php
- -
- message: '#^Parameter \#2 \$object_ids of function update_meta_cache expects array\\|string, list\ given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/comment.php
-
message: '#^Parameter \#1 \$gmt_time of function spawn_cron expects int, float given\.$#'
identifier: argument.type
@@ -1073,11 +923,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-includes/feed-rss2.php
- -
- message: '#^Parameter \#1 \$post of function get_the_guid expects int\|WP_Post, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/feed.php
-
message: '#^Parameter \#2 \$message of class WP_Error constructor expects string, list\ given\.$#'
identifier: argument.type
@@ -1168,11 +1013,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-includes/html-api/class-wp-html-processor.php
- -
- message: '#^Parameter \#4 \$length of function substr_compare expects int, null given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/html-api/class-wp-html-tag-processor.php
-
message: '#^Parameter \#1 \$user_id of function get_userdata expects int, string given\.$#'
identifier: argument.type
@@ -1273,16 +1113,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-includes/pluggable.php
- -
- message: '#^Parameter \#1 \$post of function get_edit_post_link expects int\|WP_Post, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/pluggable.php
- -
- message: '#^Parameter \#1 \$post of function get_permalink expects int\|WP_Post, string given\.$#'
- identifier: argument.type
- count: 4
- path: ../../../src/wp-includes/pluggable.php
-
message: '#^Parameter \#1 \$user of function user_can expects int\|WP_User, string given\.$#'
identifier: argument.type
@@ -1418,36 +1248,6 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php
- -
- message: '#^Parameter \#1 \$comment_id of function get_comment_type expects int\|WP_Comment, string given\.$#'
- identifier: argument.type
- count: 2
- path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
- -
- message: '#^Parameter \#1 \$comment_id of function wp_delete_comment expects int\|WP_Comment, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
- -
- message: '#^Parameter \#1 \$comment_id of function wp_trash_comment expects int\|WP_Comment, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
- -
- message: '#^Parameter \#1 \$object_id of method WP_REST_Meta_Fields\:\:get_value\(\) expects int, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
- -
- message: '#^Parameter \#2 \$comment_id of method WP_REST_Comments_Controller\:\:handle_status_param\(\) expects int, string given\.$#'
- identifier: argument.type
- count: 2
- path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
- -
- message: '#^Parameter \#2 \$object_id of method WP_REST_Meta_Fields\:\:update_value\(\) expects int, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
-
message: '#^Parameter \#2 \$value of method WP_HTTP_Response\:\:header\(\) expects string, int given\.$#'
identifier: argument.type
@@ -1623,8 +1423,3 @@ parameters:
identifier: argument.type
count: 1
path: ../../../src/wp-includes/widgets.php
- -
- message: '#^Parameter \#1 \$post of function get_the_title expects int\|WP_Post, string given\.$#'
- identifier: argument.type
- count: 1
- path: ../../../src/wp-includes/widgets/class-wp-widget-recent-comments.php
diff --git a/tests/phpstan/baselines/assign.propertyType.neon b/tests/phpstan/baselines/assign.propertyType.neon
index 88ac46bc45822..97c3032b91309 100644
--- a/tests/phpstan/baselines/assign.propertyType.neon
+++ b/tests/phpstan/baselines/assign.propertyType.neon
@@ -18,16 +18,6 @@
parameters:
ignoreErrors:
- -
- message: '#^Property WP_Comment\:\:\$comment_ID \(numeric\-string\) does not accept int\.$#'
- identifier: assign.propertyType
- count: 1
- path: ../../../src/wp-admin/includes/comment.php
- -
- message: '#^Property WP_Comment\:\:\$comment_post_ID \(numeric\-string\) does not accept int\.$#'
- identifier: assign.propertyType
- count: 1
- path: ../../../src/wp-admin/includes/comment.php
-
message: '#^Property WP_Block_Template\:\:\$author \(int\|null\) does not accept string\.$#'
identifier: assign.propertyType
diff --git a/tests/phpstan/baselines/isset.property.neon b/tests/phpstan/baselines/isset.property.neon
index 2a0c8971ceb55..ab7d839e22002 100644
--- a/tests/phpstan/baselines/isset.property.neon
+++ b/tests/phpstan/baselines/isset.property.neon
@@ -28,11 +28,6 @@ parameters:
identifier: isset.property
count: 1
path: ../../../src/wp-admin/includes/class-walker-nav-menu-edit.php
- -
- message: '#^Property WP_Post\:\:\$post_title \(string\) in isset\(\) is not nullable\.$#'
- identifier: isset.property
- count: 1
- path: ../../../src/wp-admin/includes/class-wp-posts-list-table.php
-
message: '#^Property WP_Screen\:\:\$post_type \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
@@ -88,11 +83,6 @@ parameters:
identifier: isset.property
count: 1
path: ../../../src/wp-includes/block-editor.php
- -
- message: '#^Property WP_Block_Type\:\:\$selectors \(array\) in isset\(\) is not nullable\.$#'
- identifier: isset.property
- count: 1
- path: ../../../src/wp-includes/block-supports/states.php
-
message: '#^Property WP_Customize_Control\:\:\$settings \(array\) in isset\(\) is not nullable\.$#'
identifier: isset.property
diff --git a/tests/phpstan/baselines/notIdentical.alwaysTrue.neon b/tests/phpstan/baselines/notIdentical.alwaysTrue.neon
index 99fe5295c9d55..ee19bcbbd98b4 100644
--- a/tests/phpstan/baselines/notIdentical.alwaysTrue.neon
+++ b/tests/phpstan/baselines/notIdentical.alwaysTrue.neon
@@ -28,11 +28,6 @@ parameters:
identifier: notIdentical.alwaysTrue
count: 2
path: ../../../src/wp-includes/class-wp-rewrite.php
- -
- message: '#^Strict comparison using \!\=\= between array\{\} and non\-empty\-array\ will always evaluate to true\.$#'
- identifier: notIdentical.alwaysTrue
- count: 1
- path: ../../../src/wp-includes/class-wp-view-config-data.php
-
message: '#^Strict comparison using \!\=\= between ''Etc'' and ''Africa''\|''America''\|''Antarctica''\|''Arctic''\|''Asia''\|''Atlantic''\|''Australia''\|''Europe''\|''Indian''\|''Pacific'' will always evaluate to true\.$#'
identifier: notIdentical.alwaysTrue
diff --git a/tests/phpstan/baselines/return.type.neon b/tests/phpstan/baselines/return.type.neon
index 12bccecfa6be8..503bf14cf72b2 100644
--- a/tests/phpstan/baselines/return.type.neon
+++ b/tests/phpstan/baselines/return.type.neon
@@ -48,11 +48,6 @@ parameters:
identifier: return.type
count: 1
path: ../../../src/wp-includes/class-wp-block-processor.php
- -
- message: '#^Method WP_Block_Type\:\:__get\(\) should return array\\|string\|null but returns array\\.$#'
- identifier: return.type
- count: 1
- path: ../../../src/wp-includes/class-wp-block-type.php
-
message: '#^Method WP_Image_Editor_Imagick\:\:set_imagick_time_limit\(\) should return int\|null but returns float\.$#'
identifier: return.type
@@ -148,11 +143,6 @@ parameters:
identifier: return.type
count: 2
path: ../../../src/wp-includes/revision.php
- -
- message: '#^Function term_exists\(\) should return array\{term_id\: numeric\-string, term_taxonomy_id\: numeric\-string\}\|int\|null but returns string\.$#'
- identifier: return.type
- count: 1
- path: ../../../src/wp-includes/taxonomy.php
-
message: '#^Function _wp_get_current_user\(\) should return WP_User but returns null\.$#'
identifier: return.type
diff --git a/tests/phpstan/baselines/variable.undefined.neon b/tests/phpstan/baselines/variable.undefined.neon
index dca18ebe74acc..91c668011373e 100644
--- a/tests/phpstan/baselines/variable.undefined.neon
+++ b/tests/phpstan/baselines/variable.undefined.neon
@@ -583,11 +583,6 @@ parameters:
identifier: variable.undefined
count: 1
path: ../../../src/wp-admin/users.php
- -
- message: '#^Variable \$wpdb might not be defined\.$#'
- identifier: variable.undefined
- count: 6
- path: ../../../src/wp-admin/users.php
-
message: '#^Variable \$title might not be defined\.$#'
identifier: variable.undefined