Get an extender Closure for resolving a type.

@param  string  $abstract
@param  \Closure  $closure
@return \Closure
178139
protected function getExtender($abstract, Closure $closure)
		{
			// To "extend" a binding, we will grab the old "resolver" Closure and pass it
			// into a new one. The old resolver will be called first and the result is
			// handed off to the "new" resolver, along with this Eventable instance.
			$resolver = $this->bindings[$abstract]['concrete'];

			return function($Eventable) use ($resolver, $closure) {
				return $closure($resolver($Eventable), $Eventable);
			};
		}
1220242
public function resolving($abstract, $listener)
    {
        $this->laravel->resolving($abstract, $this->buildResolvingCallable($listener));

        return $this->storeResolvingListener($abstract, $listener);
    }
825896
public function extend($abstract, \Closure $closure)
        {
            if (!Arrays::exists($abstract, $this->bindings)) {
                throw new \InvalidArgumentException("Type {$abstract} is not bound.");
            }
            // To "extend" a binding, we will grab the old "resolver" Closure and pass it
            // into a new one. The old resolver will be called first and the result is
            // handed off to the "new" resolver, along with this container instance.
            $resolver = $this->bindings[$abstract]['concrete'];
            $this->bind($abstract, function($container) use ($resolver, $closure) {
                return $closure($resolver($container), $container);
            }, $this->isShared($abstract));
        }
466070
static function p($allowAbstract, \Closure $f) {
		/** @var bool $prev */
		$prev = self::$allow_abstract;
		self::$allow_abstract = $allowAbstract;
		try {return $f();}
		finally {self::$allow_abstract = $prev;}
	}
1002738
public function extend($name, Closure $extender) {
		$name = $this->getAlias($name);
		$component = &$this->components[$name];

		if (!isset($component['extender'])) {
			$component['extender'] = [];
		}

		if ($this->isSingleton($name)) {
			$component = $this->make($name);

			$component = $this->resolveExtend($name, $component);

			return $this->instance($name, $component);
		}

		array_push($component['extender'], $extender);
	}
603452
public function closure(Closure $closure, array $params = [])
    {
        $reflection = new \ReflectionFunction($closure);
        $resolved = $this->resolve($reflection->getParameters(), $params);
        return call_user_func_array($closure, $resolved);
    }
1205728
protected function serializeClosure(Closure $closure)
    {
        $closure = (new Serializer())->serialize($closure);
        $serializedClosure = \http_build_query([$closure]);
        $crunzRoot = CRUNZ_BIN;

        return PHP_BINARY . " {$crunzRoot} closure:run {$serializedClosure}";
    }
1195348
protected function callExtendedField($abstract, $arguments = [])
    {
        if ($abstract instanceof \Closure) {
            return $this->as($abstract);
        }

        if (is_string($abstract) && class_exists($abstract)) {
            /** @var AbstractField $extend */
            $extend = new $abstract();
        }

        if ($abstract instanceof AbstractField) {
            /** @var AbstractField $extend */
            $extend = $abstract;
        }

        if (!isset($extend)) {
            admin_warning("[$abstract] is not a valid Show field.");

            return $this;
        }

        if (!$extend->escape) {
            $this->unescape();
        }

        $field = $this;

        return $this->as(function ($value) use ($extend, $field, $arguments) {
            if (!$extend->border) {
                $field->border = false;
            }

            $extend->setValue($value)->setModel($this);

            return $extend->render(...$arguments);
        });
    }
990842
protected function resolveCriteriaGroupClosure(\Closure $callback): Query
    {
        if ($this->closureResolver === null) {
            return $this->makeCopyForCriteriaGroup()->apply($callback);
        } else {
            return $this->closureResolver->resolveCriteriaGroupClosure($callback);
        }
    }
1043539
function filter(callable $closure) {
        $args = $this->baseStorageArgs;
        $args[] = parent::filter($closure)->all();
        
        return (new static(...$args));
    }
1135317
protected function getConcrete($abstract)
	{
		if ( ! is_null($concrete = $this->getContextualConcrete($abstract)))
		{
			return $concrete;
		}

		// If we don't have a registered resolver or concrete for the type, we'll just
		// assume each type is a concrete name and will attempt to resolve it as is
		// since the container should be able to resolve concretes automatically.
		if ( ! isset($this->bindings[$abstract]))
		{
			if ($this->missingLeadingSlash($abstract) &&
				isset($this->bindings['\\'.$abstract]))
			{
				$abstract = '\\'.$abstract;
			}

			return $abstract;
		}

		return $this->bindings[$abstract]['concrete'];
	}
907835
public function fmap(callable $closure)
    {
        return $this->bind(function ($a) use ($closure) {
            return $this->of($closure($a));
        });
    }
892617
public function afterResolving($abstract, Closure $callback = null)
    {
        if ($abstract instanceof Closure && $callback === null) {
            $this->afterResolvingCallback($abstract);
        } else {
            $this->afterResolvingCallbacks[$abstract][] = $callback;
        }
    }
914586
protected function resolve($abstract, array $parameters = [])
    {
        if ($this->bound($abstract)) {
            array_unshift($parameters, $this);

            return call_user_func_array($this->bindings[$abstract]['concrete'], $parameters);
        }

        $reflector = new ReflectionClass($abstract);

        if (!$constructor = $reflector->getConstructor()) {
            return new $abstract($parameters);
        }

        $constructorParams = $constructor->getParameters();

        $callParams = [];

        foreach ($constructorParams as $param) {
            if ($param->getClass()) {
                $callParams[] = $this->__invoke($param->getClass()->getName());
            }
        }

        foreach ($parameters as $key => $value) {
            $callParams[] = $value;
        }

        return $reflector->newInstanceArgs($callParams);
    }
99247
public function prop(string $class, string $property, Closure $closure)
  {
    if (!class_exists($class)) throw new ClassDoesNotExistException("Class {$class} does not exist");

    if (!in_array(
      Extendable::class,
      array_keys((new ReflectionClass($class))->getTraits()))
    ) {
      throw new CannotExtendClassException("Cannot extend \"{$class}::class\"");
    }

    return $class::prop($property, $closure);
  }
1349736
public function resolve(string $abstract)
    {
        $concrete = null;

        try {
            $concrete = $this->getContainer()
                ->make($abstract);
        } catch (ReflectionException $exception) {
            // ..
        } catch (BindingResolutionException $exception) {
            // ..
        } catch (NotFoundExceptionInterface $exception) {
            // ..
        }

        return $concrete;
    }
184310
static public function make($abstract)
    {
        $instance = isset(static::$instances[$abstract]) ? static::$instances[$abstract] : null;
        if ($instance instanceof Closure) {
            $instance = $instance();
            self::register($abstract, $instance);
        }

        return $instance;
    }