Skip to content

Commit

Permalink
[PHP 8.2] Fix deprecated ${var} string interpolation patterns (#5154)
Browse files Browse the repository at this point in the history
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.

Fix: `Drush\Psysh\DrushHelpCommand::execute()`

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)
  • Loading branch information
Ayesh committed May 26, 2022
1 parent be050e1 commit b2c6634
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Psysh/DrushHelpCommand.php
Expand Up @@ -108,7 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output): void
$namespaces[$namespace] = [];
}

$namespaces[$namespace][] = sprintf(" <info>%-${width}s</info> %s%s", $name, $command->getDescription(), $aliases);
$namespaces[$namespace][] = sprintf(" <info>%-{$width}s</info> %s%s", $name, $command->getDescription(), $aliases);
}

$messages = [];
Expand Down

0 comments on commit b2c6634

Please sign in to comment.