Skip to content

Commit

Permalink
PHP 8.2 | Fix deprecated embedded variables in text strings (#44538)
Browse files Browse the repository at this point in the history
PHP 8.2 will deprecate two of the four currently supported syntaxes for embedding variables in double quoted text string/heredocs.

This library contains six uses of embedded variables using braces after the dollar sign (`"${foo}"`), which is one of the deprecated forms.

This commit fixes all six.

Refs:
* https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation

Co-authored-by: jrfnl <[email protected]>
  • Loading branch information
jrfnl and jrfnl authored Oct 3, 2022
1 parent de7207b commit 9c7c637
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ protected static function get_property_value( $styles, $path, $theme_json = null
if ( is_array( $ref_value ) && array_key_exists( 'ref', $ref_value ) ) {
$path_string = json_encode( $path );
$ref_value_string = json_encode( $ref_value );
_doing_it_wrong( 'get_property_value', "Your theme.json file uses a dynamic value (${ref_value_string}) for the path at ${path_string}. However, the value at ${path_string} is also a dynamic value (pointing to ${ref_value['ref']}) and pointing to another dynamic value is not supported. Please update ${path_string} to point directly to ${ref_value['ref']}.", '6.1.0' );
_doing_it_wrong( 'get_property_value', "Your theme.json file uses a dynamic value ({$ref_value_string}) for the path at {$path_string}. However, the value at {$path_string} is also a dynamic value (pointing to {$ref_value['ref']}) and pointing to another dynamic value is not supported. Please update {$path_string} to point directly to {$ref_value['ref']}.", '6.1.0' );
}
}

Expand Down

0 comments on commit 9c7c637

Please sign in to comment.