This repository was archived by the owner on Jul 12, 2020. It is now read-only.
This repository was archived by the owner on Jul 12, 2020. It is now read-only.
Convert local method parameter variables to instance variables #50
Open
Description
I've currently noticed some funny behaviour with convert local variable to instance variable
when the local variable is a method parameter. Currently if you convert myvar
in the following code
class X
{
public function doSomething($myvar)
{
$myvar++;
return $myvar;
}
}
You get something like this
class X
{
private $myvar;
public function doSomething($this->myvar)
{
$this->myvar++;
return $this->myvar;
}
}
Which includes syntax errors as well as logic errors. What I think it should actually produce is something like this:
class X
{
private $myvar;
public function doSomething($myvar)
{
$this->myvar = $myvar;
$this->myvar++;
return $this->myvar;
}
}
Metadata
Metadata
Assignees
Labels
No labels