protected function setClosure(Shell $shell, \Closure $closure)
    {
        if (self::shouldBindClosure()) {
            $that = $shell->getBoundObject();
            if (\is_object($that)) {
                $closure = $closure->bindTo($that, \get_class($that));
            } else {
                $closure = $closure->bindTo(null, $shell->getBoundClass());
            }
        }

        $this->closure = $closure;
    }
protected function setClosure(Shell $shell, \Closure $closure)
    {
        if (self::shouldBindClosure()) {
            $that = $shell->getBoundObject();
            if (\is_object($that)) {
                $closure = $closure->bindTo($that, \get_class($that));
            } else {
                $closure = $closure->bindTo(null, $shell->getBoundClass());
            }
        }

        $this->closure = $closure;
    }
protected function setClosure ( Shell $ shell , \ Closure $ closure ) { if ( self :: shouldBindClosure ( ) ) { $ that = $ shell -> getBoundObject ( ) ; if ( \ is_object ( $ that ) ) { $ closure = $ closure -> bindTo ( $ that , \ get_class ( $ that ) ) ; } else { $ closure = $ closure -> bindTo ( null , $ shell -> getBoundClass ( ) ) ; } } $ this -> closure = $ closure ; }
Set the closure instance.

@param Shell    $psysh
@param \Closure $closure
Set the closure instance .