Skip to content

Commit de483aa

Browse files
committed
Remove all deprecations from Sentry
1 parent ae23bfb commit de483aa

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

src/SentryBundle.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public static function setCurrentHub(HubInterface $hub): void
3737
{
3838
if (class_exists(SentrySdk::class)) {
3939
SentrySdk::setCurrentHub($hub);
40+
41+
return;
4042
}
4143

4244
Hub::setCurrent($hub);

test/Command/SentryTestCommandTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Sentry\ClientInterface;
88
use Sentry\Options;
99
use Sentry\SentryBundle\Command\SentryTestCommand;
10-
use Sentry\State\Hub;
10+
use Sentry\SentrySdk;
1111
use Sentry\State\HubInterface;
1212
use Symfony\Component\Console\Application;
1313
use Symfony\Component\Console\Tester\CommandTester;
@@ -29,7 +29,7 @@ public function testExecuteSuccessfully(): void
2929
->shouldBeCalled()
3030
->willReturn($lastEventId);
3131

32-
Hub::setCurrent($hub->reveal());
32+
SentrySdk::setCurrentHub($hub->reveal());
3333

3434
$commandTester = $this->executeCommand();
3535

@@ -51,7 +51,7 @@ public function testExecuteFailsDueToMissingDSN(): void
5151
$hub->getClient()
5252
->willReturn($client->reveal());
5353

54-
Hub::setCurrent($hub->reveal());
54+
SentrySdk::setCurrentHub($hub->reveal());
5555

5656
$commandTester = $this->executeCommand();
5757

@@ -75,7 +75,7 @@ public function testExecuteFailsDueToMessageNotSent(): void
7575
->shouldBeCalled()
7676
->willReturn(null);
7777

78-
Hub::setCurrent($hub->reveal());
78+
SentrySdk::setCurrentHub($hub->reveal());
7979

8080
$commandTester = $this->executeCommand();
8181

@@ -92,7 +92,7 @@ public function testExecuteFailsDueToMissingClient(): void
9292
$hub->getClient()
9393
->willReturn(null);
9494

95-
Hub::setCurrent($hub->reveal());
95+
SentrySdk::setCurrentHub($hub->reveal());
9696

9797
$commandTester = $this->executeCommand();
9898

test/EventListener/ConsoleListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Prophecy\Argument;
77
use Sentry\Event;
88
use Sentry\SentryBundle\EventListener\ConsoleListener;
9-
use Sentry\State\Hub;
9+
use Sentry\SentrySdk;
1010
use Sentry\State\HubInterface;
1111
use Sentry\State\Scope;
1212
use Symfony\Component\Console\Command\Command;
@@ -31,7 +31,7 @@ protected function setUp()
3131
$callable($scope);
3232
});
3333

34-
Hub::setCurrent($this->currentHub->reveal());
34+
SentrySdk::setCurrentHub($this->currentHub->reveal());
3535
}
3636

3737
public function testOnConsoleCommandAddsCommandName(): void

test/EventListener/RequestListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Sentry\Event;
99
use Sentry\Options;
1010
use Sentry\SentryBundle\EventListener\RequestListener;
11-
use Sentry\State\Hub;
11+
use Sentry\SentrySdk;
1212
use Sentry\State\HubInterface;
1313
use Sentry\State\Scope;
1414
use Symfony\Component\HttpFoundation\Request;
@@ -48,7 +48,7 @@ protected function setUp()
4848
$callable($scope);
4949
});
5050

51-
Hub::setCurrent($this->currentHub->reveal());
51+
SentrySdk::setCurrentHub($this->currentHub->reveal());
5252
}
5353

5454
/**

test/EventListener/SubRequestListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use PHPUnit\Framework\TestCase;
66
use Sentry\SentryBundle\EventListener\SubRequestListener;
7-
use Sentry\State\Hub;
7+
use Sentry\SentrySdk;
88
use Sentry\State\HubInterface;
99
use Sentry\State\Scope;
1010
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
@@ -20,7 +20,7 @@ protected function setUp()
2020

2121
$this->currentHub = $this->prophesize(HubInterface::class);
2222

23-
Hub::setCurrent($this->currentHub->reveal());
23+
SentrySdk::setCurrentHub($this->currentHub->reveal());
2424
}
2525

2626
public function testOnKernelRequestWithMasterRequest(): void

0 commit comments

Comments
 (0)