Resolve the given type from the container.

(Overriding Container::make)

@param  string  $abstract
@param  array   $parameters
@return mixed
328844
public function make($abstract, $parameters = array())
    {
        $abstract = $this->getAlias($abstract);

        if (isset($this->deferredServices[$abstract])) {
            $this->loadDeferredProvider($abstract);
        }

        return parent::make($abstract, $parameters);
    }
971384
private function resolveParameter($parameter, $default = null)
    {
        if (($request = $this->resolveRequest()) === null) {
            return $default;
        }

        return $request->attributes->get('_lug_'.$parameter, $default);
    }
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);
        };
    }
331208
public function resolve(array $parameters) : array
    {
        if (!$number = $this->reflection->getNumberOfParameters()) {
            return [];
        }

        $arguments = \array_fill(0, $number, null);

        foreach ($this->getParameters() as $pos => $parameter) {
            $result = $this->match($parameter, $parameters);

            if ($result) {
                $arguments[$pos] = $result[1];
                unset($parameters[$result[0]]);
                continue;
            }

            if ($parameter->isDefaultValueAvailable()) {
                $arguments[$pos] = $parameter->getDefaultValue();
                continue;
            }

            throw UnresolvableArgumentException::fromParameter($parameter);
        }

        return $arguments;
    }
647768
public function type(string $type): ResolverInterface
    {
        $this->type = DataType::make($type);

        return $this;
    }
589955
public function resolve($concrete, array $parameters = [])
    {
        if ($concrete instanceof Closure) {
            return $concrete($this, $parameters);
        }

        try {
            $instance = Reflection::newInstance($concrete, $parameters);
        } catch (ReflectionException $e) {
            throw new ContainerException(
                sprintf('Container error while retrieving "%s"', $concrete),
                null,
                $e
            );
        }

        return $instance;
    }
873788
public function resolveSerializer($resource, array $parameters = [], $version = null)
    {
        return $this->resolve('serializer', $resource, $parameters, $version);
    }
677609
public function make($abstract, $parameters = [])
    {
        $abstract = ucfirst($abstract);
        if (isset($this->Instances[$abstract])) {
            return $this->Instances[$abstract];
        }
        //未定义的服务类 返回空值;
        if (!isset($this->Providers[$abstract])) {
            return null;
        }
        // echo $abstract;
        $parameters = $parameters ?: isset($this->ObjectConfig[$abstract]) ? $this->ObjectConfig[$abstract] : [];
        $this->Instances[$abstract] = $this->build($abstract, $parameters);
        return $this->Instances[$abstract];
    }
722681
@NonNull
	public static ResolvedType resolve(@NonNull Type type, @NonNull Type... typeParameters)
	{
		return typeResolver.resolve(type, typeParameters);
	}
416427
public function resolveRequestHandler(
        $resource,
        array $parameters = [],
        $version = null,
        $resolveDefaultRequestHandler = true
    )
    {
        try {
            return $this->resolve('requestHandler', $resource, $parameters, $version);
        } catch (ResourceNotDefinedException $e) {
            if ($resolveDefaultRequestHandler) {
                return $this->app->make(DefaultRequestHandler::class, $parameters);
            }
            throw $e;
        }
    }
901225
protected function createDeclaration(array $parameters = []): ClassDeclaration
    {
        return $this->container->get(FactoryInterface::class)->make(
            $this->config->declarationClass(static::ELEMENT),
            [
                'name'    => $this->getClass(),
                'comment' => (string)$this->option('comment')
            ] + $parameters + $this->config->declarationOptions(static::ELEMENT)
        );
    }
1115026
public function make($abstract, array $parameters = array())
    {
        $abstract = $this->getAlias($this->normalize($abstract));
        //反复make同一抽象时， 返回同一个对象
        if (isset($this->instances[$abstract]) && !is_null($this->instances[$abstract])) {
            return $this->instances[$abstract];
        }
        //获取抽象类对应的具体对象
        $concrete = $this->getConcrete($abstract);
        //当前具体类型是可以build时，
        if ($this->isBuildable($concrete, $abstract)) {
            $object = $this->build($concrete, $parameters);
        } else {
            $object = $this->make($concrete, $parameters);
        }
        //若容器中有该具体类的扩展回调
        foreach ($this->getExtenders($abstract) as $extender) {
            $object = $extender($object, $this);
        }
        if ($this->isShared($abstract)) {
            $this->instances[$abstract] = $object;
        }
        $this->resoleved[$abstract] = true;
        return $object;
    }
1365584
private function resolveParameters(?array $params = [], ?array $definitions = null) : array
    {
        $parameters = [];

        //method doesn't exist so there's no parameters
        if(!isset($params) || empty($params)) {
            return $parameters;
        }

        /** @var \ReflectionParameter $parameter */
        foreach($params as $parameter) {

            //handle definitions
            if(isset($definitions, $definitions[$parameter->name])
                && is_a($definitions[$parameter->name], Definition::class)) {

                /** @var Definition $definition */
                $definition = $definitions[$parameter->name];
                $parameters[] = $definition->getType() == Definition::CONTAINER
                    ? $this->container->get($definition->getValue()) : $definition->getValue();

            } elseif($parameter->isDefaultValueAvailable()) {
                $parameters[] = $parameter->getDefaultValue();
            } elseif($parameter->allowsNull() || $parameter->isOptional() || !$parameter->hasType()) {
                $parameters[] = null;
            } elseif($parameter->getClass() !== null) {

                $parameter_class = $parameter->getClass();
                $parameter_class_name = $parameter_class->getName();

                try {
                    $parameters[] = $this->container->get($parameter_class_name);
                } catch(\Exception $e) {
                    $parameters[] = null;
                }

            } elseif($parameter->isCallable()) {
                $parameters[] = function(){};
            } elseif($parameter->isArray()) {
                $parameters[] = [];
            } else {
                $parameters[] = $this->resolveDefaultType($parameter->getType());
            }
        }

        return $parameters;
    }
1150618
public function instance($abstract, $instance)
		{
			// First, we will extract the alias from the abstract if it is an array so we
			// are using the correct name when binding the type. If we get an alias it
			// will be registered with the container so we can resolve it out later.
			if (Arrays::is($abstract)) {
				list($abstract, $alias) = $this->extractAlias($abstract);
				$this->alias($abstract, $alias);
			}

			unset($this->aliases[$abstract]);

			// We'll check to determine if this type has been bound before, and if it has
			// we will fire the rebound callbacks registered with the container and it
			// can be updated with consuming classes that have gotten resolved here.
			$bound = $this->bound($abstract);
			$this->instances[$abstract] = $instance;
			if ($bound) {
				$this->rebound($abstract);
			}
		}
790919
protected function resolveCommand($command, array $parameters): CommandInterface
	{
		if($command instanceof CommandInterface)
		{
			return $command;
		}

		return $this->container->get($command, $parameters);
	}
162170
public function resolveNodeType(array $parameters)
    {
        $values = $this->getProviderParameters($parameters);
        $type   = key($values);

        return $type;
    }
1220065
public function &create($type, $parameters = array())
	{
		$class = $this->get_class($type);

		if (in_array($class, $this->legacy))
		{
			switch ($type)
			{
				case 'locator':
					// Legacy: file, timeout, useragent, file_class, max_checked_feeds, content_type_sniffer_class
					// Specified: file, timeout, useragent, max_checked_feeds
					$replacement = array($this->get_class('file'), $parameters[3], $this->get_class('content_type_sniffer'));
					array_splice($parameters, 3, 1, $replacement);
					break;
			}
		}

		if (!method_exists($class, '__construct'))
		{
			$instance = new $class;
		}
		else
		{
			$reflector = new ReflectionClass($class);
			$instance = $reflector->newInstanceArgs($parameters);
		}

		if (method_exists($instance, 'set_registry'))
		{
			$instance->set_registry($this);
		}
		return $instance;
	}