WIP Simple and extensive feature flipper for php. Identifier centric.
<?php
use Coduo\Flipper;
use Coduo\Flipper\Feature\Repository\InMemoryFeatureRepository;
use Coduo\Flipper\Activation\Strategy;
$context = new Flipper\Activation\Context('default');
$context2 = new Flipper\Activation\Context('some_dummy_context');
$context->registerArgument(new Flipper\Activation\Argument\UserIdentifier('[email protected]');
```php
## Set up your feature definitions
$flipper = new Flipper(new InMemoryFeatureRepository());
$flipper->addContext($this->context);
$feature = new Feature('captcha', new Strategy\UserIdentifier(
new Flipper\Activation\Argument\UserIdentifier('[email protected]')
]));
$feature2 = new Feature('new_topbar', new Strategy\SystemWide(true));
$flipper->add($feature);
$flipper->add($feature2);
<?php
$flipper->isActive('captcha', 'default'); #true
$flipper->isActive('captcha', 'Argument'); #false
require: {
"coduo/flipper": "dev-master"
}