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