8000 [FeatureFlag] Add ArgumentResolver by Jean-Beru · Pull Request #8 · Jean-Beru/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FeatureFlag] Add ArgumentResolver #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 36 commits into
base: rfc/simple-feature-flag
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ccbde2d
[FeatureFlag] Propose a simple version
Jean-Beru Dec 7, 2023
f789984
extract FrameworkBundle integration
Jean-Beru Dec 26, 2023
a4bfd4e
fix typos, doc and default feature value
Jean-Beru Dec 29, 2023
88280a8
review
Jean-Beru Jan 2, 2024
e3b5757
add some tests
Jean-Beru Jan 2, 2024
8e8f1e3
happy new year
Jean-Beru Jan 2, 2024
004e76d
cs
Jean-Beru Jan 2, 2024
93570fc
add base exception
Jean-Beru Jan 3, 2024
05df4d9
refact DataCollector
Jean-Beru Jan 3, 2024
3460e97
add isDisabled
Jean-Beru Jan 3, 2024
2634480
fix collector
Jean-Beru Jan 4, 2024
7854cd9
fix forgotten method in FeatureCheckerInterface
Jean-Beru Jan 4, 2024
ff279ab
fix interface
Jean-Beru Jan 4, 2024
72b893b
remove exception catching
Jean-Beru Jan 29, 2024
d343107
[FeatureFlag] Add FrameworkBundle integration
Jean-Beru Dec 26, 2023
07452ca
exception format
Jean-Beru Feb 29, 2024
c83e651
cs
Jean-Beru Feb 29, 2024
cac6b22
add Neirda24 as co-author
Jean-Beru Mar 1, 2024
b437a73
add ContainerInterface dependency
Jean-Beru Mar 1, 2024
9f8a4fd
fix exception namespace
Jean-Beru Mar 1, 2024
71b5558
fix namespace again
Jean-Beru Mar 1, 2024
1b7ba66
remove merge file
Jean-Beru Mar 1, 2024
bd9ad89
Fix bundle and add details in profiler
Jean-Beru Apr 5, 2024
36394ec
Add Twig functions to UndefinedCallableHandler::FUNCTION_COMPONENTS
Jean-Beru Apr 5, 2024
1b62db2
cs
Jean-Beru Apr 5, 2024
5a87737
rebase
Jean-Beru Apr 5, 2024
fce994a
review
Jean-Beru Apr 5, 2024
222a22b
cs
Jean-Beru Apr 5, 2024
997fc4a
tests
Jean-Beru Apr 5, 2024
ae25ba3
psalm
Jean-Beru Apr 5, 2024
f11eef5
readme
Jean-Beru Apr 12, 2024
e1a7dda
add functional tests
Jean-Beru Apr 12, 2024
4e37306
fix framework bundle test
Jean-Beru Apr 16, 2024
e55798f
[FeatureFlag] Use providers
Jean-Beru Oct 8, 2024
a99c32c
cs
Jean-Beru Oct 9, 2024
5e44fa4
[FeatureFlag] Add ArgumentResolver
Jean-Beru Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add isDisabled
  • Loading branch information
Jean-Beru committed Oct 9, 2024
commit 3460e977674c5852247fc15e88b3f2c293306d61
5 changes: 5 additions & 0 deletions src/Symfony/Component/FeatureFlag/FeatureChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public function isEnabled(string $featureName, mixed $expectedValue = true): boo
return $this->getValue($featureName) === $expectedValue;
}

public function isDisabled(string $featureName, mixed $expectedValue = true): bool
{
return !$this->isEnabled($featureName, $expectedValue);
}

public function getValue(string $featureName): mixed
{
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public function testTraces()
'feature_true' => true,
'feature_integer' => false,
'unknown_feature' => false,

],
$traceableFeatureChecker->getChecks(),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public function testIsEnabled()
$this->assertFalse($featureChecker->isEnabled('feature_false'));
$this->assertFalse($featureChecker->isEnabled('feature_integer'));
$this->assertFalse($featureChecker->isEnabled('unknown_feature'));

$this->assertFalse($featureChecker->isDisabled('feature_true'));
$this->assertTrue($featureChecker->isDisabled('feature_false'));
$this->assertTrue($featureChecker->isDisabled('feature_integer'));
$this->assertTrue($featureChecker->isDisabled('unknown_feature'));
}

/**
Expand Down
0