Say you have a PHP function getId
that calls a function from another class:
public function getFoosForBar(int $bar): array
{
$helperClass = new HelperClass();
return $helperClass->getFoos($bar);
}
You, as the smart cookie you are, recognise that $helperClass is an inline variable, and you want to refactor it to:
public function getFoosForBar(int $bar): array
{
return (new HelperClass)->getFoos($bar);
}
Your IDE (in my case, PHPStorm) also recognises it is an inline variable and offers the same solution, so you make the change. Does this trigger a regression test for all functions that call getFoosForBar?
I've tried googling this several times, as I'm new in the programming career path, so I am unsure if this should trigger regression testing, or any testing for that matter, especially if they're not automated. I appreciate your input!