Skip to content

Commit b57546a

Browse files
shaedrichondrejmirtes
authored andcommitted
Use early return
1 parent afd954f commit b57546a

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎src/Command/ErrorFormatter/JunitErrorFormatter.php‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,13 @@ private function fileGetLine(string $fileName, int $lineNumber): ?string
117117
}
118118

119119
$file = new SplFileObject($fileName);
120-
if (!$file->eof()) {
121-
$file->seek($lineNumber);
122-
// @phpstan-ignore-next-line
123-
return $file->current(); // $contents would hold the data from line x
120+
if ($file->eof()) {
121+
return null;
124122
}
125-
return null;
123+
124+
$file->seek($lineNumber);
125+
// @phpstan-ignore-next-line
126+
return $file->current(); // $contents would hold the data from line x
126127
}
127128

128129
/**

0 commit comments

Comments
 (0)