This commit is contained in:
2025-02-04 12:40:43 +03:00
parent 4bcb4c60dd
commit 50343d5a87
372 changed files with 9019 additions and 6684 deletions

View File

@@ -2,12 +2,6 @@
All notable changes in `sebastian/global-state` are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
## [8.0.0] - 2025-02-07
### Removed
* This component is no longer supported on PHP 8.2
## [7.0.2] - 2024-07-03
### Changed
@@ -116,7 +110,6 @@ 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
[8.0.0]: https://github.com/sebastianbergmann/global-state/compare/7.0...main
[7.0.2]: https://github.com/sebastianbergmann/global-state/compare/7.0.1...7.0.2
[7.0.1]: https://github.com/sebastianbergmann/global-state/compare/7.0.0...7.0.1
[7.0.0]: https://github.com/sebastianbergmann/global-state/compare/6.0...7.0.0

View File

@@ -1,6 +1,6 @@
BSD 3-Clause License
Copyright (c) 2001-2025, Sebastian Bergmann
Copyright (c) 2001-2024, Sebastian Bergmann
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@@ -1,4 +1,4 @@
[![Latest Stable Version](https://poser.pugx.org/sebastian/global-state/v)](https://packagist.org/packages/sebastian/global-state)
[![Latest Stable Version](https://poser.pugx.org/sebastian/global-state/v/stable.png)](https://packagist.org/packages/sebastian/global-state)
[![CI Status](https://github.com/sebastianbergmann/global-state/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/global-state/actions)
[![codecov](https://codecov.io/gh/sebastianbergmann/global-state/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/global-state)

View File

@@ -14,23 +14,22 @@
"issues": "https://github.com/sebastianbergmann/global-state/issues",
"security": "https://github.com/sebastianbergmann/global-state/security/policy"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"platform": {
"php": "8.3.0"
"php": "8.2.0"
},
"optimize-autoloader": true,
"sort-packages": true
},
"require": {
"php": ">=8.3",
"sebastian/object-reflector": "^5.0",
"sebastian/recursion-context": "^7.0"
"php": ">=8.2",
"sebastian/object-reflector": "^4.0",
"sebastian/recursion-context": "^6.0"
},
"require-dev": {
"ext-dom": "*",
"phpunit/phpunit": "^12.0-dev"
"phpunit/phpunit": "^11.0"
},
"autoload": {
"classmap": [
@@ -47,7 +46,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "8.0-dev"
"dev-main": "7.0-dev"
}
}
}

View File

@@ -13,7 +13,6 @@ use function array_diff;
use function array_key_exists;
use function array_keys;
use function array_merge;
use function assert;
use function in_array;
use function is_array;
use ReflectionClass;
@@ -96,8 +95,6 @@ final class Restorer
);
foreach ($keys as $key) {
assert(isset($GLOBALS[$superGlobalArray]) && is_array($GLOBALS[$superGlobalArray]));
if (isset($superGlobalVariables[$superGlobalArray][$key])) {
$GLOBALS[$superGlobalArray][$key] = $superGlobalVariables[$superGlobalArray][$key];
} else {

View File

@@ -128,7 +128,6 @@ final class Snapshot
assert($iniSettings !== false);
/* @phpstan-ignore assign.propertyType */
$this->iniSettings = $iniSettings;
}
@@ -293,7 +292,7 @@ final class Snapshot
!in_array($key, $superGlobalArrays, true) &&
$this->canBeSerialized($GLOBALS[$key]) &&
!$this->excludeList->isGlobalVariableExcluded($key)) {
/* @phpstan-ignore assign.propertyType */
/* @noinspection UnserializeExploitsInspection */
$this->globalVariables[$key] = unserialize(serialize($GLOBALS[$key]));
}
}
@@ -305,7 +304,7 @@ final class Snapshot
if (isset($GLOBALS[$superGlobalArray]) && is_array($GLOBALS[$superGlobalArray])) {
foreach ($GLOBALS[$superGlobalArray] as $key => $value) {
/* @phpstan-ignore assign.propertyType */
/* @noinspection UnserializeExploitsInspection */
$this->superGlobalVariables[$superGlobalArray][$key] = unserialize(serialize($value));
}
}
@@ -397,7 +396,6 @@ final class Snapshot
{
$result = [];
/* @phpstan-ignore argument.type */
if ($processed->contains($variable)) {
return $result;
}