Find the concrete binding for the given abstract in the contextual binding array.

@param  string  $abstract
@return \Closure|string|null
188841
protected function findInContextualBindings($abstract)
    {
        if (isset($this->contextual[end($this->buildStack)][$abstract])) {
            return $this->contextual[end($this->buildStack)][$abstract];
        }
    }
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);
			};
		}
188909
protected function construct(string $abstract) : Closure
    {
        $inspector = new ReflectionClass($abstract);

        if (($constructor = $inspector->getConstructor()) && ($dependencies = $constructor->getParameters())) {

            // if, and only if, a class has a constructor with parameters, we try to solve then
            // creating a resolving callback that in every call will recalculate all dependencies
            // for the given class, and offcourse, using a cached resolving callback if exists.

            return function (string $abstract, array $parameters) use ($inspector, $dependencies) {
                return $inspector->newInstanceArgs(
                    $this->process($abstract, $parameters, $dependencies)
                );
            };
        }

        return function (string $abstract) {
            return new $abstract;
        };
    }
999562
protected function isShared($abstract)
    {
        $abstract = $this->normalize($abstract);
        //存在实列集合中， 肯定是共享的
        if (isset($this->instances[$abstract])) {
            return true;
        }
        if (! isset($this->bindings[$abstract]['shared'])) {
            return false;
        }
        return $this->bindings[$abstract]['shared'] === true;
    }
1080313
public function make( $abstract )
	{
		$service = isset( $this->services[$abstract] )
			? $this->services[$abstract]
			: $this->addNamespace( $abstract );

		if( is_callable( $service )) {
			return call_user_func_array( $service, [$this] );
		}
		if( is_object( $service )) {
			return $service;
		}

		return $this->resolve( $service );
	}
715056
protected function getClosure($abstract, $concrete)
    {
        return function ($container, array $parameters = array()) use ($abstract, $concrete) {
            $method = ($abstract == $concrete) ? 'build' : 'make';
            return $container->$method($concrete, $parameters);
        };
    }
403933
public function extend($abstract, Closure $closure)
    {
        if (! isset($this->bindings[$abstract])) {
            throw new \InvalidArgumentException("Type {$abstract} is not bound.");
        }

        if (isset($this->instances[$abstract])) {
            $this->instances[$abstract] = $closure($this->instances[$abstract], $this);

            $this->rebound($abstract);
        } else {
            $extender = $this->getExtender($abstract, $closure);

            $this->bind($abstract, $extender, $this->isShared($abstract));
        }
    }
1072682
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 container instance.
        $resolver = $this->bindings[$abstract]['concrete'];

        return function($container) use ($resolver, $closure)
        {
            return $closure($resolver($container), $container);
        };
    }
1039355
public function extend($abstract, Closure $closure)
	{
		if ( ! isset($this->bindings[$abstract]))
		{
			throw new \InvalidArgumentException("Type {$abstract} is not bound.");
		}

		$extender = $this->getExtender($abstract, $closure);

		$this->bind($abstract, $extender, $this->isShared($abstract));
	}
939493
public static function getByClassName($className)
    {
        $bind = self::getInstance()->bind;

        foreach ($bind as $abstract => $abstractClassName) {
            if ($className == $abstractClassName) {
                return self::get($abstract);
            }
        }

        throw new ContainerException('Cannot find "' . $className . '" in container');
    }
976189
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])) {
            return $this->bindings[$abstract]['concrete'];
        }

        return $abstract;
    }
863555
public function bindIf($abstract, $concrete = null, $shared = false)
    {
        if (! $this->bound($abstract)) {
            $this->bind($abstract, $concrete, $shared);
        }
    }
1185074
public function bindForCallback(string $abstract, $concrete, callable $callback)
    {
        $hasOriginal      = $this->container->bound($abstract);
        $originalInstance = false;

        if ($hasOriginal) {
            $binding = $this->container->getBindings()[$abstract] ?? null;

            $hasInstance = $binding && $binding['shared'] && $this->container->resolved($abstract);

            if ($hasInstance) {
                $originalInstance = $this->container->make($abstract);
            }
        }

        $this->container->instance($abstract, $concrete);

        try {
            $return = $callback();
            return $return;
        } finally {
            unset($this->container[$abstract]);

            if ($hasOriginal && (isset($binding) && $binding)) {
                $this->container->bind($abstract, $binding['concrete'], $binding['shared']);

                if ($originalInstance) {
                    $this->container->instance($abstract, $originalInstance);
                }
            }
        }
    }
216337
public function bind($abstract, $callback, $singleton = false)
    {
        $this->laravel->bind($abstract, $this->buildBindingProxy($callback), $singleton);

        return $this;
    }
221303
public function instance($abstract, $instance)
    {
        $this->sharedInstances[$abstract] = $instance;

        // This will never be called, but makes resolved, bound etc. easier
        $this->storeBinding($abstract, function ($container) use ($instance) {
            return $instance;
        }, true);

        $this->callAllListeners($abstract, $instance);

        return $this;
    }
177003
public function instance($abstract, $instance)
    {
        $abstract = $this->normalize($abstract);
        if (is_array($abstract)) {
            list($abstract, $alias) = $this->extractAlias($abstract);
            $this->alias($abstract, $alias);
        }
        unset($this->aliases[$abstract]);
        $bound = $this->bound($abstract);

        $this->instances[$abstract] = $instance;
        if ($bound) {
            $this->rebound($abstract);
        }
    }
80155
public function bind($abstract, $concrete = null, $singleton = false)
    {
        if (is_array($abstract)) {
            list($abstract, $alias) = [key($abstract), current($abstract)];
            $this->alias($abstract, $alias);
        }

        $abstract = $this->filter($abstract);
        $concrete = $this->filter($concrete);

        if (is_null($concrete)) {
            $concrete = $abstract;
        }

        $this->binds[$abstract] = compact('concrete', 'singleton');
        return $this;
    }