diff --git a/phpstan.neon.dist b/phpstan.neon.dist index e2e72fb367482..d5b77a737836c 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -42,7 +42,6 @@ includes: - tests/phpstan/baselines/empty.offset.neon - tests/phpstan/baselines/empty.property.neon - tests/phpstan/baselines/empty.variable.neon - - tests/phpstan/baselines/encapsedStringPart.nonString.neon - tests/phpstan/baselines/foreach.nonIterable.neon - tests/phpstan/baselines/function.alreadyNarrowedType.neon - tests/phpstan/baselines/function.impossibleType.neon diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index 6c50a1daba4fd..c17e68e34c363 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -1398,7 +1398,10 @@ function image_media_send_to_editor( $html, $attachment_id, $attachment ) { * * @param WP_Post $post * @param array $errors - * @return array> The attachment fields. + * @return array> The attachment fields, keyed by field name. Each value is a field + * definition array, except for underscore-prefixed keys such as + * `_final`, which the `attachment_fields_to_edit` filter may set to + * raw HTML. */ function get_attachment_fields_to_edit( $post, $errors = null ) { if ( is_int( $post ) ) { diff --git a/tests/phpstan/baselines/encapsedStringPart.nonString.neon b/tests/phpstan/baselines/encapsedStringPart.nonString.neon deleted file mode 100644 index 707a2192a4c8a..0000000000000 --- a/tests/phpstan/baselines/encapsedStringPart.nonString.neon +++ /dev/null @@ -1,25 +0,0 @@ -# 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