Please pull the assignement out of the if: $oldSource = $this->getSourcePath($path1))

It makes the code less readable.