Skip to content

Commit d9fe623

Browse files
authored
Merge branch refs/heads/1.12.x into 2.1.x
2 parents 5b4bf80 + 43c44ee commit d9fe623

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Analyser/FileAnalyser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,15 @@ public function analyseFile(
290290
InternalError::STACK_TRACE_METADATA_KEY => InternalError::prepareTrace($e),
291291
InternalError::STACK_TRACE_AS_STRING_METADATA_KEY => $e->getTraceAsString(),
292292
]);
293+
} finally {
294+
$this->restoreCollectErrorsHandler();
293295
}
294296
} elseif (is_dir($file)) {
295297
$fileErrors[] = (new Error(sprintf('File %s is a directory.', $file), $file, canBeIgnored: false))->withIdentifier('phpstan.path');
296298
} else {
297299
$fileErrors[] = (new Error(sprintf('File %s does not exist.', $file), $file, canBeIgnored: false))->withIdentifier('phpstan.path');
298300
}
299301

300-
$this->restoreCollectErrorsHandler();
301-
302302
foreach ($linesToIgnore as $fileKey => $lines) {
303303
if (count($lines) > 0) {
304304
continue;

0 commit comments

Comments
 (0)