Fork me on GitHub
a Sensio Labs Product

Jump & Run (v3.28.0) edition

Rule simple_to_complex_string_variable

Converts explicit variables in double-quoted strings and heredoc syntax from simple to complex format (${ to {$).


Doesn’t touch implicit variables. Works together nicely with explicit_string_variable.


Example #1

--- Original
+++ New
 $name = 'World';
-echo "Hello ${name}!";
+echo "Hello {$name}!";

Example #2

--- Original
+++ New
 $name = 'World';
 echo <<<TEST
-Hello ${name}!
+Hello {$name}!

Rule sets

The rule is part of the following rule sets:

The logo is © 2010-2022 Sensio Labs