diff --git a/tests/RuleTestCase.php b/tests/RuleTestCase.php index bc4dd39..51a99eb 100644 --- a/tests/RuleTestCase.php +++ b/tests/RuleTestCase.php @@ -111,7 +111,12 @@ private function autofix(string $file, array $analyserErrors): void $errorsByLines = []; foreach ($analyserErrors as $analyserError) { - $line = $analyserError->getLine() ?? -1; + $line = $analyserError->getLine(); + + if ($line === null) { + throw new LogicException('Error without line number: ' . $analyserError->getMessage()); + } + $errorsByLines[$line] = $analyserError; }