Last active
March 6, 2023 16:37
-
-
Save ismail1432/560c07c38d0d589e21b5eefd29034ab7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\FeatureFlag\FeatureFlagEnum; | |
trait FeatureFlagEnumTrait | |
{ | |
public static function names() | |
{ | |
return array_column(self::cases(), 'name'); | |
} | |
} | |
// feature flag to resolve in a database | |
enum DatabaseStorageFeatureFlagEnum | |
{ | |
use FeatureFlagEnumTrait; | |
case fake_payment; | |
case new_checkout_api; | |
} | |
// feature flag to resolve with A/B testing | |
enum ABTestingFeatureFlagEnum | |
{ | |
use FeatureFlagEnumTrait; | |
case pay_with_paypal; | |
} | |
// feature flag to resolve with Symfony parameters | |
enum ParameterFeatureFlagEnum | |
{ | |
use FeatureFlagEnumTrait; | |
case use_stripe; | |
case product_v2; | |
} | |
// feature flag to resolve with a period | |
enum PeriodFeatureFlagEnum | |
{ | |
use FeatureFlagEnumTrait; | |
case maintenance; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment