DrewM\Morse\Morse::instantiateFromFeatureID PHP Method

instantiateFromFeatureID() private static method

@param string $featureID Feature identifier
private static instantiateFromFeatureID ( string $featureID ) : callable
$featureID string
return callable A callable array of class and method name.
    private static function instantiateFromFeatureID($featureID)
    {
        $parts = explode('/', $featureID);
        $classname = __NAMESPACE__ . '\\Feature\\' . \ucwords(\str_replace('-', '_', $parts[0]));
        $funcname = 'test' . \ucwords(\str_replace('-', '_', $parts[1]));
        try {
            $class = new $classname();
        } catch (\Exception $e) {
            return null;
        }
        return array(new $class(), $funcname);
    }