Skip to content

Commit c41c0b1

Browse files
committed
Fix undeclared variable usage
1 parent 522a953 commit c41c0b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/QafooLabs/Refactoring/Application/ConvertLocalToInstanceVariable.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace QafooLabs\Refactoring\Application;
44

55
use QafooLabs\Refactoring\Domain\Model\File;
6+
use QafooLabs\Refactoring\Domain\Model\LineRange;
67
use QafooLabs\Refactoring\Domain\Model\Variable;
78
use QafooLabs\Refactoring\Domain\Model\RefactoringException;
89
use QafooLabs\Refactoring\Domain\Model\EditingAction\AddProperty;
@@ -46,7 +47,7 @@ private function convertVariablesToInstanceVariables()
4647
$definedVariables = $this->getDefinedVariables();
4748

4849
if ( ! $definedVariables->contains($this->convertVariable)) {
49-
throw RefactoringException::variableNotInRange($this->convertVariable, $selectedMethodLineRange);
50+
throw RefactoringException::variableNotInRange($this->convertVariable, LineRange::fromSingleLine($this->line));
5051
}
5152

5253
$this->session->addEdit(new LocalVariableToInstance($definedVariables, $this->convertVariable));

0 commit comments

Comments
 (0)