Skip to content

Commit

Permalink
HTML API: Fix "${var} in strings" deprecation notice in html5lib test.
Browse files Browse the repository at this point in the history
Changeset [58712] introduced the following compile time PHP deprecation notice on >= PHP 8.2 test runs:

{{{
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php on line 257
PHPUnit 9.6.20 by Sebastian Bergmann and contributors.
}}}

The `${` syntax for string interpolation was deprecated in PHP 8.2 and should not be used anymore.

Ref: https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation

Follow-up to [58712].

Props jrf.
See #61530, #59654, #61576.

git-svn-id: https://develop.svn.wordpress.org/trunk@58733 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
hellofromtonya committed Jul 16, 2024
1 parent 606fcbd commit 36ac310
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ private static function build_tree_representation( ?string $fragment_context, st
}

if ( '' !== $text_node ) {
$output .= "${text_node}\"\n";
$output .= "{$text_node}\"\n";
}

// Tests always end with a trailing newline.
Expand Down

0 comments on commit 36ac310

Please sign in to comment.