public function createAutoWireClosure($className, callable $parameterFactory = null)
    {
        return function (Container $app) use ($className, $parameterFactory) {
            $parameters = $parameterFactory ? $parameterFactory($app) : [];
            return $this->injector->create($className, $parameters);
        };
    }
public function createAutoWireClosure($className, callable $parameterFactory = null)
    {
        return function (Container $app) use ($className, $parameterFactory) {
            $parameters = $parameterFactory ? $parameterFactory($app) : [];
            return $this->injector->create($className, $parameters);
        };
    }
public function createAutoWireClosure ( $ className , callable $ parameterFactory = null ) { return function ( Container $ app ) use ( $ className , $ parameterFactory ) { $ parameters = $ parameterFactory ? $ parameterFactory ( $ app ) : [ ] ; return $ this -> injector -> create ( $ className , $ parameters ) ; } ; }
Generate a closure that will use the Injector to auto-wire a service definition.

@param string $className FQCN of a class to auto-wire bind.
@param callable|null $parameterFactory Callable to generate parameters to inject to the service. Will receive
the IoC container as its first parameter.
@return \Closure
Generate a closure that will use the Injector to auto - wire a service definition .