From f5e277e25be97d9c52415c33b4398783cd955f01 Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Tue, 24 Sep 2024 15:42:28 +0100 Subject: [PATCH] fix: JIRA-13558 Resolve Config `override-all` key This fixes the usage of the `override-all` setting so that it works again. --- src/Overriders/ConfigOverrider.php | 8 ++++---- tests/Feature/ConfigOverriderTest.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Overriders/ConfigOverrider.php b/src/Overriders/ConfigOverrider.php index 0438d5c..1032d08 100644 --- a/src/Overriders/ConfigOverrider.php +++ b/src/Overriders/ConfigOverrider.php @@ -34,13 +34,13 @@ public function get(FeatureFlagEnum $key): bool */ public function hasAll(): bool { - return $this->config->has('feature-flags.overriders.config.override_all') - && $this->config->get('feature-flags.overriders.config.override_all') !== null; + return $this->config->has('feature-flags.overriders.config.override-all') + && $this->config->get('feature-flags.overriders.config.override-all') !== null; } public function getAll(): bool { - return (bool) $this->config->get('feature-flags.overriders.config.override_all'); + return (bool) $this->config->get('feature-flags.overriders.config.override-all'); } public function set(FeatureFlagEnum $key, bool|null $value): static @@ -52,7 +52,7 @@ public function set(FeatureFlagEnum $key, bool|null $value): static public function setAll(bool|null $value): static { - $this->config->set('feature-flags.overriders.config.override_all', $value); + $this->config->set('feature-flags.overriders.config.override-all', $value); return $this; } diff --git a/tests/Feature/ConfigOverriderTest.php b/tests/Feature/ConfigOverriderTest.php index 10a4427..9193a9b 100644 --- a/tests/Feature/ConfigOverriderTest.php +++ b/tests/Feature/ConfigOverriderTest.php @@ -111,10 +111,10 @@ null ]); -it('sets overriderAll value', function ($value) { +it('sets override-all value', function ($value) { $overrider = $this->app->make(ConfigOverrider::class); $overrider->setAll($value); - expect($this->configRepo->get('feature-flags.overriders.config.override_all'))->toBe($value); + expect($this->configRepo->get('feature-flags.overriders.config.override-all'))->toBe($value); })->with([ true, false,