Skip to content

Commit 9025731

Browse files
committed
wrap in try/finally
1 parent 80aa859 commit 9025731

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/PHPStan/Analyser/Bug13813IntegrationTest.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ public function testBug13813(): void
1919
{
2020
$oldReporting = error_reporting();
2121

22-
error_reporting(E_ALL);
23-
$analyzerResult = $this->runAnalyse([
24-
__DIR__ . '/data/bug-13813.php',
25-
__DIR__ . '/Bug13813Rule.php',
26-
]);
22+
try {
23+
error_reporting(E_ALL);
24+
$analyzerResult = $this->runAnalyse([
25+
__DIR__ . '/data/bug-13813.php',
26+
__DIR__ . '/Bug13813Rule.php',
27+
]);
28+
} finally {
29+
error_reporting($oldReporting);
30+
}
2731
$this->assertCount(2, $analyzerResult->getAllPhpErrors());
2832
$this->assertCount(2, $analyzerResult->getFilteredPhpErrors());
2933

@@ -46,8 +50,6 @@ public function testBug13813(): void
4650
$analyzerResult->getAllPhpErrors()[1]->getMessage(),
4751
);
4852
}
49-
50-
error_reporting($oldReporting);
5153
}
5254

5355
/**

0 commit comments

Comments
 (0)