Opensoft\Rollout\Rollout::get PHP Method

get() public method

public get ( string $feature ) : Feature
$feature string
return Feature
    public function get($feature)
    {
        $settings = $this->storage->get($this->key($feature));
        if (!empty($settings)) {
            $f = new Feature($feature, $settings);
        } else {
            $f = new Feature($feature);
            $this->save($f);
        }
        return $f;
    }

Usage Example

Example #1
0
 public function testRemove()
 {
     $this->rollout->activate('signup');
     $feature = $this->rollout->get('signup');
     $this->assertEquals('signup', $feature->getName());
     $this->rollout->remove('signup');
     $this->assertNotContains('signup', $this->rollout->features());
 }