Skip to content

Commit c3243c8

Browse files
authored
PHP 8.2 | Fix deprecated embedded variables in text strings (sirbrillig#248)
PHP 8.2 will deprecate two of the four currently supported syntaxes for embedding variables in double quoted text string/heredocs. This libery contains one such use of an embedded variable using braces after the dollar sign (`"${foo}"`), which is one of the deprecated forms. This commit fixes this. Refs: * https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
1 parent dafcd6f commit c3243c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ protected function processVariableAsStaticOutsideClass(File $phpcsFile, $stackPt
919919
* @return void
920920
*/
921921
protected function processVariableAsAssignment(File $phpcsFile, $stackPtr, $varName, $currScope) {
922-
Helpers::debug("processVariableAsAssignment: starting for '${varName}'");
922+
Helpers::debug("processVariableAsAssignment: starting for '{$varName}'");
923923
$assignPtr = Helpers::getNextAssignPointer($phpcsFile, $stackPtr);
924924
if (! is_int($assignPtr)) {
925925
return;

0 commit comments

Comments
 (0)