Skip to content

Commit

Permalink
Merge pull request #86 from worksome/JIRA-13558_config-overrider
Browse files Browse the repository at this point in the history
fix: JIRA-13558 Resolve Config `override-all` key
  • Loading branch information
owenvoke authored Sep 24, 2024
2 parents 16223d2 + f5e277e commit 64a5fae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Overriders/ConfigOverrider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/ConfigOverriderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 64a5fae

Please sign in to comment.