| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
||
| 26 | { |
||
| 27 | if ($this->container->has(HubInterface::class)) { |
||
| 28 | /** @var HubInterface $sentry */ |
||
| 29 | $sentry = $this->container->get(HubInterface::class); |
||
| 30 | $client = $sentry->getClient(); |
||
| 31 | |||
| 32 | if ($client !== null && $client->getOptions()->shouldSendDefaultPii()) { |
||
| 33 | $sentry->configureScope(static function (Scope $scope) use ($request): void { |
||
| 34 | $scope->setUser([ |
||
| 35 | 'ip_address' => $request->getServerParams()['REMOTE_ADDR'] ?? null, |
||
| 36 | ]); |
||
| 37 | }); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | return $handler->handle($request); |
||
| 42 | } |
||
| 44 |