Run Rector on your code to see what it can do for you:

 <?php
 
 // imagine this being dynamic, not just a const string..
-$command = 'echo "%s"';
+$command = 'echo "%s"';
+assert(...);
 
-assert(is_string($command));
-passthru(sprintf($command, $foo));
+is_string(...);
+passthru(...);
+sprintf($command, $foo);
     
-echo $command;
+echo $command;
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: febd1c - released at 2026-04-01 18:25