Skip to content

Commit

Permalink
Fix bug #19235 (#19247)
Browse files Browse the repository at this point in the history
* Fix bug #19235

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md
  • Loading branch information
virtual-designer committed Feb 18, 2022
1 parent 3c6805e commit 4d90778
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Yii Framework 2 Change Log
------------------------

- no changes in this release.

- Bug #19235: Fix return type compatibility of `yii\web\SessionIterator` class methods for PHP 8.1 (virtual-designer)

2.0.45 February 11, 2022
------------------------
Expand Down
5 changes: 5 additions & 0 deletions framework/web/SessionIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function __construct()
* Rewinds internal array pointer.
* This method is required by the interface [[\Iterator]].
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->_key = reset($this->_keys);
Expand All @@ -47,6 +48,7 @@ public function rewind()
* This method is required by the interface [[\Iterator]].
* @return mixed the key of the current array element
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->_key;
Expand All @@ -57,6 +59,7 @@ public function key()
* This method is required by the interface [[\Iterator]].
* @return mixed the current array element
*/
#[\ReturnTypeWillChange]
public function current()
{
return isset($_SESSION[$this->_key]) ? $_SESSION[$this->_key] : null;
Expand All @@ -66,6 +69,7 @@ public function current()
* Moves the internal pointer to the next array element.
* This method is required by the interface [[\Iterator]].
*/
#[\ReturnTypeWillChange]
public function next()
{
do {
Expand All @@ -78,6 +82,7 @@ public function next()
* This method is required by the interface [[\Iterator]].
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
return $this->_key !== false;
Expand Down

0 comments on commit 4d90778

Please sign in to comment.