kahlan\Scope::_bind PHP Method

_bind() protected method

Binds the closure to the current context.
protected _bind ( Closur\Closure $closure, string $name ) : Closur\Closure
$closure Closur\Closure The variable to check
$name string Name of the parent type (TODO: to use somewhere).
return Closur\Closure
    protected function _bind($closure, $name)
    {
        if (!is_callable($closure)) {
            throw new Exception("Error, invalid closure.");
        }
        return $closure->bindTo($this);
    }