Transform sequential assignments to pipe operator syntax
$value = "hello world";
-$result1 = function1($value);
-$result2 = function2($result1);
-$result = function3($result2);
+$result = $value
+ |> function1(...)
+ |> function2(...)
+ |> function3(...);
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\Php85\Rector\StmtsAwareInterface\SequentialAssignmentsToPipeOperatorRector;
return RectorConfig::configure()
->withRules([
SequentialAssignmentsToPipeOperatorRector::class,
]);