potix2/vim-phprefactor — Issue #2: Implement 'extract method'
Author: potix2
Created: 2012-03-10 01:24:38+00:00
State: open
Labels: enhancement

before:

```
function is_neighbor($other) {
$distance = sqrt(pow($this->x - $other->x, 2) + pow($this->y - $other->y, 2));
return $distance < $this->threshold;
}
```

after:

```
function is_neighbor($other) {
$distance = $this->calc_distance($other);
return $distance < $this->threshold;
}

function calc_distance($other) {
return sqrt(pow($this->x - $other->x, 2) + pow($this->y - $other->y, 2));
}
```