Rector PHP: What rule can I use to remove a function call?

119 views Asked by At

I have code like this:

$x = (int) trim(fuzzy_logic(floor($x1 / $x2)));
$t = fuzzy_logic([$title,$desc]);
$z = trim(fuzzy_logic($z));
$i = fuzzy_logic($i);

The function fuzzy_logic() have been obsolete, and I would like to have it removed. How would I go about for making a Rector rule for removing it so that my code becomes:

$x = (int) trim(floor($x1 / $x2));
$t = [$title,$desc];
$z = trim($z);
$i = $i;

I looked in the documentation and found a way of removing a function entirely, which is not the case for me here as I only want it removed and keep whatever parameter thats inside.

Rector rule for removing entire function: RemoveFuncCallRector.php

0

There are 0 answers