Skip to content

Commit

Permalink
Backport c57acac
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Aug 2, 2023
1 parent 0ca8db5 commit bde739e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes in `sebastian/global-state` are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.

## [5.0.6] - 2023-08-02

### Changed

* Changed usage of `ReflectionProperty::setValue()` to be compatible with PHP 8.3

## [5.0.5] - 2022-02-14

### Fixed
Expand Down Expand Up @@ -66,6 +72,7 @@ All notable changes in `sebastian/global-state` are documented in this file usin

* This component is no longer supported on PHP 7.0 and PHP 7.1

[5.0.6]: https://github.com/sebastianbergmann/global-state/compare/5.0.5...5.0.6
[5.0.5]: https://github.com/sebastianbergmann/global-state/compare/5.0.4...5.0.5
[5.0.4]: https://github.com/sebastianbergmann/global-state/compare/5.0.3...5.0.4
[5.0.3]: https://github.com/sebastianbergmann/global-state/compare/5.0.2...5.0.3
Expand Down
4 changes: 2 additions & 2 deletions src/Restorer.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function restoreStaticAttributes(Snapshot $snapshot): void
foreach ($staticAttributes as $name => $value) {
$reflector = new ReflectionProperty($className, $name);
$reflector->setAccessible(true);
$reflector->setValue($value);
$reflector->setValue(null, $value);
}
}

Expand All @@ -109,7 +109,7 @@ public function restoreStaticAttributes(Snapshot $snapshot): void
}

$attribute->setAccessible(true);
$attribute->setValue($defaults[$name]);
$attribute->setValue(null, $defaults[$name]);
}
}
}
Expand Down

0 comments on commit bde739e

Please sign in to comment.