Convert multiple nested function calls in single line to |> pipe operator
class SomeClass
{
public function run($input)
{
- $result = trim(strtolower(htmlspecialchars($input)));
+ $result = $input
+ |> htmlspecialchars(...)
+ |> strtolower(...)
+ |> trim(...);
}
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\Php85\Rector\Expression\NestedFuncCallsToPipeOperatorRector;
return RectorConfig::configure()
->withRules([
NestedFuncCallsToPipeOperatorRector::class,
]);