Skip to content

Commit

Permalink
NetteSessionIntegration: replace getIterator (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Jan 10, 2023
1 parent 3817ea9 commit 964cbc2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Integration/NetteSessionIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Contributte\Sentry\Integration;

use ArrayIterator;
use Nette\DI\Container;
use Nette\Http\Session;
use Sentry\Breadcrumb;
Expand All @@ -25,8 +26,12 @@ public function setup(HubInterface $hub, Event $event, EventHint $hint): ?Event
return $event;
}

// @see https://github.com/nette/http/blob/v3.1/src/Http/Session.php
// phpcs:ignore SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable.DisallowedSuperGlobalVariable
$sessionData = $_SESSION['__NF']['DATA'] ?? [];

/** @var array<mixed, string> $iterator */
$iterator = $session->getIterator();
$iterator = new ArrayIterator(array_keys($sessionData));
$data = [];

foreach ($iterator as $section) {
Expand Down

0 comments on commit 964cbc2

Please sign in to comment.