Skip to content

Commit cc23b2e

Browse files
authored
[PHP 8.2] Fix deprecated ${var} string interpolation patterns (#42520)
PHP 8.2 deprecates string interpolation patterns that place the dollar sign outside the curly braces. This fixes such patterns by replacing them with proper curly braced patterns. Fixes `Illuminate\Cookie\Middleware\EncryptCookies::validateArray()` This is so far the only such occurrence. Reference: - [PHP.Watch: `${var}` string interpolation deprecated](https://php.watch/versions/8.2/$%7Bvar%7D-string-interpolation-deprecated) - [wiki.php.net RFC](https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation)
1 parent 2ca86f9 commit cc23b2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Cookie/Middleware/EncryptCookies.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ protected function validateArray(string $key, array $value)
118118
$validated = [];
119119

120120
foreach ($value as $index => $subValue) {
121-
$validated[$index] = $this->validateValue("${key}[${index}]", $subValue);
121+
$validated[$index] = $this->validateValue("{$key}[{$index}]", $subValue);
122122
}
123123

124124
return $validated;

0 commit comments

Comments
 (0)