Skip to content

Commit 66c5c73

Browse files
committed
add ResetInterface
1 parent 2f490f8 commit 66c5c73

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Symfony/Component/FeatureFlag/FeatureChecker.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
namespace Symfony\Component\FeatureFlag;
1313

1414
use Symfony\Component\FeatureFlag\Provider\ProviderInterface;
15+
use Symfony\Contracts\Service\ResetInterface;
1516

1617
/**
1718
* @experimental
1819
*/
19-
final class FeatureChecker implements FeatureCheckerInterface
20+
final class FeatureChecker implements FeatureCheckerInterface, ResetInterface
2021
{
2122
private array $cache = [];
2223

@@ -40,4 +41,9 @@ public function getValue(string $featureName): mixed
4041

4142
return $this->cache[$featureName] = $feature();
4243
}
44+
45+
public function reset(): void
46+
{
47+
$this->cache = [];
48+
}
4349
}

src/Symfony/Component/FeatureFlag/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
],
1818
"require": {
1919
"php": ">=8.2",
20-
"psr/container": "^1.1|^2.0"
20+
"psr/container": "^1.1|^2.0",
21+
"symfony/service-contracts": "^2.5|^3"
2122
},
2223
"require-dev": {
2324
"symfony/http-kernel": "^7.2",

0 commit comments

Comments
 (0)