Wrap encapsed variables in curly braces
function run($world)
{
- echo "Hello $world!";
+ echo "Hello {$world}!";
}
Configure your rector.php
:
<?php
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
WrapEncapsedVariableInCurlyBracesRector::class,
]);