Skip to content

Commit

Permalink
Session::getIterator() is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 5, 2022
1 parent 4ebe7dd commit 0e16cd4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Http/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,10 @@ public function hasSection(string $section): bool
}


/**
* Iteration over all sections.
*/
/** @deprecated */
public function getIterator(): \Iterator
{
trigger_error(__METHOD__ . '() is deprecated', E_USER_DEPRECATED);
if ($this->exists() && !$this->started) {
$this->autoStart(false);
}
Expand Down

2 comments on commit 0e16cd4

@rootpd
Copy link

@rootpd rootpd commented on 0e16cd4 Dec 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dg Is this deprecated in favor of something? I've been using this to iterate over session in my Sentry extension (https://github.com/rootpd/nette-sentry/blob/master/src/SentryLogger.php#L135) and now I don't see any other way how to extract the NF session data.

@nufue
Copy link

@nufue nufue commented on 0e16cd4 Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rootpd Method getSectionNames() was recently added as a replacement for getIterator(). See a81c2e4

Please sign in to comment.