Skip to content

Commit cb6cca5

Browse files
SentryHandler: Replacing concrete type Hub with abstract HubInterface (#496)
* SentryHandler: Replacing concrete type Hub with abstract HubInterface * CS * Remove unneeded test * Add changelog entry Co-authored-by: Alex Bouma <[email protected]>
1 parent acfbddf commit cb6cca5

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Replace type hint of concrete type (`Sentry\State\Hub`) with interface (`Sentry\State\HubInterface`) in `SentryHandler` constructor (#496)
6+
57
## 2.6.0
68

79
- Add all log context as `log_context` to events when using the log channel (#489)

src/Sentry/Laravel/SentryHandler.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Sentry\Breadcrumb;
1111
use Sentry\Event;
1212
use Sentry\Severity;
13-
use Sentry\State\Hub;
13+
use Sentry\State\HubInterface;
1414
use Sentry\State\Scope;
1515
use Throwable;
1616

@@ -28,7 +28,7 @@ class SentryHandler extends AbstractProcessingHandler
2828
protected $release;
2929

3030
/**
31-
* @var Hub the hub object that sends the message to the server
31+
* @var HubInterface the hub object that sends the message to the server
3232
*/
3333
protected $hub;
3434

@@ -52,13 +52,13 @@ class SentryHandler extends AbstractProcessingHandler
5252
private $useFormattedMessage;
5353

5454
/**
55-
* @param Hub $hub
56-
* @param int $level The minimum logging level at which this handler will be triggered
57-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
58-
* @param bool $reportExceptions
59-
* @param bool $useFormattedMessage
55+
* @param HubInterface $hub
56+
* @param int $level The minimum logging level at which this handler will be triggered
57+
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
58+
* @param bool $reportExceptions
59+
* @param bool $useFormattedMessage
6060
*/
61-
public function __construct(Hub $hub, $level = Logger::DEBUG, bool $bubble = true, bool $reportExceptions = true, bool $useFormattedMessage = false)
61+
public function __construct(HubInterface $hub, $level = Logger::DEBUG, bool $bubble = true, bool $reportExceptions = true, bool $useFormattedMessage = false)
6262
{
6363
parent::__construct($level, $bubble);
6464

0 commit comments

Comments
 (0)