private function preparePrototypeBindingClosure($id, $blueprint, $dependencies): Closure
    {
        if ($blueprint instanceof ReflectionClass) {
            return $this->cache[$id] = function () use ($blueprint, $dependencies) {
                foreach ($dependencies as $key => $dependency) {
                    if ($dependency instanceof Closure) {
                        $dependencies[$key] = $dependency();
                    }
                }

                return $blueprint->newInstanceArgs($dependencies);
            };
        }
        if ($blueprint instanceof Closure) {
            return $this->cache[$id] = $blueprint;
        }

        return $this->cache[$id] = function () use ($blueprint) {
            return new $blueprint;
        };
    }
private function preparePrototypeBindingClosure($id, $blueprint, $dependencies): Closure
    {
        if ($blueprint instanceof ReflectionClass) {
            return $this->cache[$id] = function () use ($blueprint, $dependencies) {
                foreach ($dependencies as $key => $dependency) {
                    if ($dependency instanceof Closure) {
                        $dependencies[$key] = $dependency();
                    }
                }

                return $blueprint->newInstanceArgs($dependencies);
            };
        }
        if ($blueprint instanceof Closure) {
            return $this->cache[$id] = $blueprint;
        }

        return $this->cache[$id] = function () use ($blueprint) {
            return new $blueprint;
        };
    }
private function preparePrototypeBindingClosure ( $ id , $ blueprint , $ dependencies ) : Closure { if ( $ blueprint instanceof ReflectionClass ) { return $ this -> cache [ $ id ] = function ( ) use ( $ blueprint , $ dependencies ) { foreach ( $ dependencies as $ key => $ dependency ) { if ( $ dependency instanceof Closure ) { $ dependencies [ $ key ] = $ dependency ( ) ; } } return $ blueprint -> newInstanceArgs ( $ dependencies ) ; } ; } if ( $ blueprint instanceof Closure ) { return $ this -> cache [ $ id ] = $ blueprint ; } return $ this -> cache [ $ id ] = function ( ) use ( $ blueprint ) { return new $ blueprint ; } ; }
Make a prototype binding closure method to store in the cache.

@param  string $id
@param  mixed $blueprint
@param  array $dependencies
@return Closure
Make a prototype binding closure method to store in the cache .