Conditions | 6 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function setupOnce(): void |
||
16 | { |
||
17 | Scope::addGlobalEventProcessor( |
||
18 | static function (Event $event, ?EventHint $hint = null): Event { |
||
19 | $self = SentrySdk::getCurrentHub()->getIntegration(self::class); |
||
20 | |||
21 | if ( |
||
22 | !$self instanceof self || |
||
23 | $hint === null || |
||
24 | $hint->exception === null || |
||
25 | !method_exists($hint->exception, 'context') || |
||
26 | !is_array($hint->exception->context()) |
||
27 | ) { |
||
28 | return $event; |
||
29 | } |
||
30 | $event->setExtra(['exception_context' => $hint->exception->context()]); |
||
31 | |||
32 | return $event; |
||
33 | } |
||
37 |