Skip to content

Commit b12211d

Browse files
committed
CS fixes
1 parent 7a419a2 commit b12211d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/Core/Diagnostics/DiagnosticsEngine.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Throwable;
1515
use function Amp\asyncCall;
1616
use function Amp\delay;
17+
use Exception;
1718

1819
class DiagnosticsEngine
1920
{
@@ -117,7 +118,7 @@ public function run(CancellationToken $token): Promise
117118
$message = sprintf('Diagnostic provider "%s" errored with "%s", removing from pool', $providerId, $e->getMessage());
118119
$this->clientApi->window()->showMessage()->warning($message);
119120
$this->logger->error($message, [
120-
'stack' => (new \Exception())->getTraceAsString()
121+
'stack' => (new Exception())->getTraceAsString()
121122
]);
122123
$crashedProviders[$providerId] = true;
123124
return;

tests/Unit/Core/Diagnostics/DiagnosticsEngineTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use function Amp\asyncCall;
1717
use function Amp\call;
1818
use function Amp\delay;
19+
use Exception;
1920

2021
class DiagnosticsEngineTest extends AsyncTestCase
2122
{
@@ -142,8 +143,8 @@ public function testHandlesLinterExceptions(): Generator
142143
{
143144
$tester = LanguageServerTesterBuilder::create();
144145
$engine = new DiagnosticsEngine($tester->clientApi(), new NullLogger(), [
145-
new ClosureDiagnosticsProvider(function (TextDocumentItem $item) {
146-
throw new \Exception('oh dear');
146+
new ClosureDiagnosticsProvider(function (TextDocumentItem $item): void {
147+
throw new Exception('oh dear');
147148
}),
148149
], 10);
149150

0 commit comments

Comments
 (0)