This PR gives the ability to resolve the implementation of the feature.
class MyFeature
{
public $name = 'my-feature';
// ...
}
Feature::define(MyFeature::class);
$instance = Feature::instance('my-feature');
$instance = Feature::instance(MyFeature::class);
The instance method will return either an instance of the feature class, a lottery, or a closure. The tests give a good rundown of when each of these might occur.
This PR gives the ability to resolve the implementation of the feature.
The
instance
method will return either an instance of the feature class, a lottery, or a closure. The tests give a good rundown of when each of these might occur.